Spaces:
Runtime error
Runtime error
SUPERFIRE777
commited on
Commit
·
9c1a0aa
1
Parent(s):
ce57911
Update app.py
Browse files
app.py
CHANGED
@@ -14,18 +14,20 @@ def analyze(sentence):
|
|
14 |
|
15 |
# Return a result
|
16 |
if polarity_score > 0:
|
17 |
-
sentiment = "
|
18 |
elif polarity_score == 0:
|
19 |
-
sentiment = "
|
20 |
else:
|
21 |
-
sentiment = "
|
22 |
|
23 |
return (en_sentence,sentiment)
|
24 |
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
|
28 |
iface = gr.Interface(fn=analyze,
|
29 |
-
inputs=
|
30 |
outputs=output_format)
|
31 |
iface.launch()
|
|
|
14 |
|
15 |
# Return a result
|
16 |
if polarity_score > 0:
|
17 |
+
sentiment = "ポジティブ"
|
18 |
elif polarity_score == 0:
|
19 |
+
sentiment = "ニュートラル"
|
20 |
else:
|
21 |
+
sentiment = "ネガティブ"
|
22 |
|
23 |
return (en_sentence,sentiment)
|
24 |
|
25 |
+
input_format = gr.Textbox(label="文章")
|
26 |
+
|
27 |
+
output_format = [gr.Textbox(label="翻訳後の文章"),
|
28 |
+
gr.Textbox(label="感情")]
|
29 |
|
30 |
iface = gr.Interface(fn=analyze,
|
31 |
+
inputs=input_format,
|
32 |
outputs=output_format)
|
33 |
iface.launch()
|