SUPERFIRE777 commited on
Commit
9c1a0aa
·
1 Parent(s): ce57911

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -14,18 +14,20 @@ def analyze(sentence):
14
 
15
  # Return a result
16
  if polarity_score > 0:
17
- sentiment = "Positive"
18
  elif polarity_score == 0:
19
- sentiment = "Neutral"
20
  else:
21
- sentiment = "Negative"
22
 
23
  return (en_sentence,sentiment)
24
 
25
- output_format = [gr.textbox(label="Translated Sentence"),
26
- gr.textbox(label="Sentiment")]
 
 
27
 
28
  iface = gr.Interface(fn=analyze,
29
- inputs="text",
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()