leadingbridge commited on
Commit
d8ebd16
·
1 Parent(s): a1f109b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -79,24 +79,28 @@ def translate_to_english(text_to_translate):
79
 
80
  # Gradio Output Model
81
  with gr.Blocks() as demo:
82
- gr.Markdown("Choose the Chinese NLP model you want to use from the tabs")
83
  with gr.Tab("🗣️OpenAI Chatbot"):
 
84
  chatbot = gr.Chatbot()
85
  message = gr.Textbox(placeholder=prompt)
86
  state = gr.State()
87
  submit = gr.Button("SEND")
88
  submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
89
  with gr.Tab("🤗Sentiment Analysis"):
90
- inputs = gr.Textbox(placeholder="Enter a Chinese positive or negative sentence here")
 
91
  outputs = gr.Textbox(label="Sentiment Analysis")
92
  proceed_button = gr.Button("proceed")
93
  proceed_button.click(fn=sentiment_analysis, inputs=inputs, outputs=outputs)
94
  with gr.Tab("🀄Translation to Chinese"):
 
95
  inputs = gr.Textbox(placeholder="Enter a short English sentence to translate to Chinese here.")
96
  outputs = gr.Textbox(label="Translation Result")
97
  proceed_button = gr.Button("Translate")
98
  proceed_button.click(fn=translate_to_chinese, inputs=inputs, outputs=outputs)
99
  with gr.Tab("🔤Translation to English"):
 
100
  inputs = gr.Textbox(placeholder="Enter a short Chinese sentence to translate to English here.")
101
  outputs = gr.Textbox(label="Translation Result")
102
  proceed_button = gr.Button("Translate")
 
79
 
80
  # Gradio Output Model
81
  with gr.Blocks() as demo:
82
+ gr.Markdown("")
83
  with gr.Tab("🗣️OpenAI Chatbot"):
84
+ gr.Markdown("Interact with an OpenAI chatbot that can respond to your messages. Type your message in the input box and click the 'SEND' button to send it to the chatbot.")
85
  chatbot = gr.Chatbot()
86
  message = gr.Textbox(placeholder=prompt)
87
  state = gr.State()
88
  submit = gr.Button("SEND")
89
  submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
90
  with gr.Tab("🤗Sentiment Analysis"):
91
+ gr.Markdown("Perform sentiment analysis on a Chinese sentence. Enter a sentence in Chinese in the input box and click the 'proceed' button to get the sentiment analysis result.")
92
+ inputs = gr.Textbox(placeholder="Type a Chinese sentence here, either positive or negative in sentiment.")
93
  outputs = gr.Textbox(label="Sentiment Analysis")
94
  proceed_button = gr.Button("proceed")
95
  proceed_button.click(fn=sentiment_analysis, inputs=inputs, outputs=outputs)
96
  with gr.Tab("🀄Translation to Chinese"):
97
+ gr.Markdown("Translate an English sentence to Chinese. Enter an English sentence in the input box and click the 'Translate' button to get the translation result in Chinese.")
98
  inputs = gr.Textbox(placeholder="Enter a short English sentence to translate to Chinese here.")
99
  outputs = gr.Textbox(label="Translation Result")
100
  proceed_button = gr.Button("Translate")
101
  proceed_button.click(fn=translate_to_chinese, inputs=inputs, outputs=outputs)
102
  with gr.Tab("🔤Translation to English"):
103
+ gr.Markdown("Translate a Chinese sentence to English. Enter a Chinese sentence in the input box and click the 'Translate' button to get the translation result in English.")
104
  inputs = gr.Textbox(placeholder="Enter a short Chinese sentence to translate to English here.")
105
  outputs = gr.Textbox(label="Translation Result")
106
  proceed_button = gr.Button("Translate")