Commit
·
f25ba70
1
Parent(s):
03c9b66
app corrected
Browse files
app.py
CHANGED
@@ -15,11 +15,12 @@ def analyze_text(text):
|
|
15 |
emotion_result = emotion_classifier(text)
|
16 |
hate_result = hate_speech_classifier(text)
|
17 |
|
18 |
-
emotions = {res['label']:
|
19 |
-
hate_speech = {res['label']:
|
20 |
|
21 |
return emotions, hate_speech
|
22 |
|
|
|
23 |
iface = gr.Interface(
|
24 |
fn=analyze_text,
|
25 |
inputs=gr.Textbox(lines=4, placeholder="Enter your text here..."),
|
|
|
15 |
emotion_result = emotion_classifier(text)
|
16 |
hate_result = hate_speech_classifier(text)
|
17 |
|
18 |
+
emotions = {res['label']: res['score'] for res in emotion_result}
|
19 |
+
hate_speech = {res['label']: res['score'] for res in hate_result}
|
20 |
|
21 |
return emotions, hate_speech
|
22 |
|
23 |
+
|
24 |
iface = gr.Interface(
|
25 |
fn=analyze_text,
|
26 |
inputs=gr.Textbox(lines=4, placeholder="Enter your text here..."),
|