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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -6,6 +6,8 @@ def analyze(sentence):
6
  # Translate the sentence from Japanese to English
7
  en_sentence = translate(sentence, "en")
8
 
 
 
9
  # Create a TextBlob object for the sentence
10
  blob = TextBlob(en_sentence)
11
 
@@ -20,12 +22,13 @@ def analyze(sentence):
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,
 
6
  # Translate the sentence from Japanese to English
7
  en_sentence = translate(sentence, "en")
8
 
9
+ jp_sentence = translate(en_sentence, "ja")
10
+
11
  # Create a TextBlob object for the sentence
12
  blob = TextBlob(en_sentence)
13
 
 
22
  else:
23
  sentiment = "ネガティブ"
24
 
25
+ return (en_sentence, jp_sentence, sentiment)
26
 
27
+ input = gr.Textbox(label="文章")
28
 
29
  output_format = [gr.Textbox(label="翻訳後の文章"),
30
+ gr.Textbox(label="和訳"),
31
+ gr.Textbox(label="感情")]
32
 
33
  iface = gr.Interface(fn=analyze,
34
  inputs=input_format,