leadingbridge commited on
Commit
3338882
·
1 Parent(s): 08488e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -88,26 +88,26 @@ def chatgpt_clone(input, history):
88
  with gr.Blocks() as demo:
89
  gr.Markdown('Welcome to the Chinese NLP Demo! Please select a model tab to interact with:')
90
  with gr.Tab("🗣️Chatbot"):
91
- gr.Markdown("This is a Chinese chatbot powered by the OpenAI language model. Enter your message below in Chinese and the chatbot will respond.")
92
  chatbot = gr.Chatbot()
93
  message = gr.Textbox(placeholder="You can discuss any topic with the Chinese Chatbot assistant by typing Chinese in here")
94
  state = gr.State()
95
  submit = gr.Button("Send")
96
  submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
97
  with gr.Tab("🤗Sentiment Analysis"):
98
- gr.Markdown("This is a self-trained fine-tuned model using Chinese BERT for sentiment analysis. Enter a sentence in Chinese in the input box and click the 'proceed' button to get the sentiment analysis result.")
99
  inputs = gr.Textbox(placeholder="Type a Chinese sentence here, either positive or negative in sentiment.")
100
  outputs = gr.Textbox(label="Sentiment Analysis")
101
  proceed_button = gr.Button("Proceed")
102
  proceed_button.click(fn=sentiment_analysis, inputs=inputs, outputs=outputs)
103
  with gr.Tab("🀄Chinese Translation"):
104
- gr.Markdown("This model translate an English sentence to Chinese using the OpenAI engine. Enter an English short sentence in the input box and click the 'Translate' button to get the translation result in Chinese.")
105
  inputs = gr.Textbox(placeholder="Enter a short English sentence to translate to Chinese here.")
106
  outputs = gr.Textbox(label="Translation Result")
107
  proceed_button = gr.Button("Translate")
108
  proceed_button.click(fn=openai_translation_ec, inputs=inputs, outputs=outputs)
109
  with gr.Tab("🔤English Translation"):
110
- gr.Markdown("This model translate a Chinese sentence to English using the OpenAI engine. Enter a Chinese short sentence in the input box and click the 'Translate' button to get the translation result in English.")
111
  inputs = gr.Textbox(placeholder="Enter a short Chinese sentence to translate to English here.")
112
  outputs = gr.Textbox(label="Translation Result")
113
  proceed_button = gr.Button("Translate")
 
88
  with gr.Blocks() as demo:
89
  gr.Markdown('Welcome to the Chinese NLP Demo! Please select a model tab to interact with:')
90
  with gr.Tab("🗣️Chatbot"):
91
+ gr.Markdown("""<h5>🗣️This is a Chinese chatbot powered by the OpenAI language model. Enter your message below in Chinese and the chatbot will respond.</h5>""")
92
  chatbot = gr.Chatbot()
93
  message = gr.Textbox(placeholder="You can discuss any topic with the Chinese Chatbot assistant by typing Chinese in here")
94
  state = gr.State()
95
  submit = gr.Button("Send")
96
  submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
97
  with gr.Tab("🤗Sentiment Analysis"):
98
+ gr.Markdown("🤗This is a self-trained fine-tuned model using Chinese BERT for sentiment analysis. Enter a sentence in Chinese in the input box and click the 'proceed' button to get the sentiment analysis result.")
99
  inputs = gr.Textbox(placeholder="Type a Chinese sentence here, either positive or negative in sentiment.")
100
  outputs = gr.Textbox(label="Sentiment Analysis")
101
  proceed_button = gr.Button("Proceed")
102
  proceed_button.click(fn=sentiment_analysis, inputs=inputs, outputs=outputs)
103
  with gr.Tab("🀄Chinese Translation"):
104
+ gr.Markdown("🀄This model translate an English sentence to Chinese using the OpenAI engine. Enter an English short sentence in the input box and click the 'Translate' button to get the translation result in Chinese.")
105
  inputs = gr.Textbox(placeholder="Enter a short English sentence to translate to Chinese here.")
106
  outputs = gr.Textbox(label="Translation Result")
107
  proceed_button = gr.Button("Translate")
108
  proceed_button.click(fn=openai_translation_ec, inputs=inputs, outputs=outputs)
109
  with gr.Tab("🔤English Translation"):
110
+ gr.Markdown("🔤This model translate a Chinese sentence to English using the OpenAI engine. Enter a Chinese short sentence in the input box and click the 'Translate' button to get the translation result in English.")
111
  inputs = gr.Textbox(placeholder="Enter a short Chinese sentence to translate to English here.")
112
  outputs = gr.Textbox(label="Translation Result")
113
  proceed_button = gr.Button("Translate")