Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,15 +64,12 @@ def process_classification(text, model1, model2, tokenizer1):
|
|
64 |
|
65 |
return f"{round(prediction1, 1)}", f"{round(prediction2, 1)}", f"{round(score, 2)}"
|
66 |
|
|
|
|
|
|
|
67 |
# Define Gradio interface
|
68 |
iface = gr.Interface(
|
69 |
-
fn=
|
70 |
-
"NER - Extended Sequence Classification": lambda text: process_ner(text, pipe_ext),
|
71 |
-
"NER - Autobiographical Interview Scoring": lambda text: process_ner(text, pipe_ais),
|
72 |
-
"Internal Detail Count": lambda text: process_classification(text, model1, model2, tokenizer1)[0],
|
73 |
-
"External Detail Count": lambda text: process_classification(text, model1, model2, tokenizer1)[1],
|
74 |
-
"Approximated Internal Detail Ratio": lambda text: process_classification(text, model1, model2, tokenizer1)[2]
|
75 |
-
},
|
76 |
inputs=gr.Textbox(placeholder="Enter sentence here..."),
|
77 |
outputs=[
|
78 |
gr.HighlightedText(label="NER - Extended Sequence Classification"),
|
|
|
64 |
|
65 |
return f"{round(prediction1, 1)}", f"{round(prediction2, 1)}", f"{round(score, 2)}"
|
66 |
|
67 |
+
def all():
|
68 |
+
return process_ner(text, pipe_ext), process_ner(text, pipe_ais), process_classification(text, model1, model2, tokenizer1)[0], process_classification(text, model1, model2, tokenizer1)[1], process_classification(text, model1, model2, tokenizer1)[2]
|
69 |
+
|
70 |
# Define Gradio interface
|
71 |
iface = gr.Interface(
|
72 |
+
fn=all,
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
inputs=gr.Textbox(placeholder="Enter sentence here..."),
|
74 |
outputs=[
|
75 |
gr.HighlightedText(label="NER - Extended Sequence Classification"),
|