Spaces:
Runtime error
Runtime error
wira.indra
commited on
Commit
•
ea552db
1
Parent(s):
2dd816c
add twitter feature
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def ner(text):
|
|
37 |
return {"text": text, "entities": output}
|
38 |
|
39 |
def sentiment_ner(text):
|
40 |
-
return
|
41 |
|
42 |
def sentiment_df(df):
|
43 |
text_list = list(df["Text"].astype(str).values)
|
@@ -76,7 +76,7 @@ if __name__ == "__main__":
|
|
76 |
sent_output = gr.Textbox(label="Sentiment Analysis")
|
77 |
ner_output = gr.Textbox(label="Named Entity Recognition")
|
78 |
|
79 |
-
analyze_button.click(
|
80 |
|
81 |
# sentiment_demo = gr.Interface(
|
82 |
# fn=sentiment_analysis,
|
|
|
37 |
return {"text": text, "entities": output}
|
38 |
|
39 |
def sentiment_ner(text):
|
40 |
+
return sentiment_analysis(text), ner(text)
|
41 |
|
42 |
def sentiment_df(df):
|
43 |
text_list = list(df["Text"].astype(str).values)
|
|
|
76 |
sent_output = gr.Textbox(label="Sentiment Analysis")
|
77 |
ner_output = gr.Textbox(label="Named Entity Recognition")
|
78 |
|
79 |
+
analyze_button.click(sentiment_ner, input_text, [sent_output, ner_output])
|
80 |
|
81 |
# sentiment_demo = gr.Interface(
|
82 |
# fn=sentiment_analysis,
|