Update app.py
Browse files
app.py
CHANGED
@@ -31,22 +31,30 @@ with gr.Blocks() as demo:
|
|
31 |
We also provide other two versions / 我们还提供了另外两种版本:
|
32 |
- [Sinlge-text version / 独立文本版](https://huggingface.co/spaces/Hello-SimpleAI/chatgpt-detector-single): detect whether a piece of text is ChatGPT generated, using PLM-based classifiers / 判断单条文本是否由ChatGPT生成,使用基于PTM的分类器来开发;
|
33 |
- [Linguistic version / 语言学版](https://huggingface.co/spaces/Hello-SimpleAI/chatgpt-detector-ling): detect whether a piece of text is ChatGPT generated, using linguistic features / 判断单条文本是否由ChatGPT生成,使用基于语言学特征的模型来开发;
|
|
|
|
|
34 |
""")
|
35 |
with gr.Tab("English"):
|
|
|
|
|
|
|
36 |
q1 = gr.Textbox(lines=2, label='Question',value="What stops a restaurant from noting down my credit card info and using it ? No offense to restaurants . Can be generalized to anyone who I give my credit card info to . Explain like I'm five.")
|
37 |
a1 = gr.Textbox(lines=5, label='Answer',value="There are a few things that can help protect your credit card information from being misused when you give it to a restaurant or any other business:\n\nEncryption: Many businesses use encryption to protect your credit card information when it is being transmitted or stored. This means that the information is transformed into a code that is difficult for anyone to read without the right key.")
|
38 |
button1 = gr.Button("🤖 Predict!")
|
39 |
label1 = gr.Textbox(lines=1, label='Predicted Label 🎃')
|
40 |
score1 = gr.Textbox(lines=1, label='Prob')
|
41 |
with gr.Tab("中文版"):
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
44 |
button2 = gr.Button("🤖 预测!")
|
45 |
label2 = gr.Textbox(lines=1, label='预测结果 🎃')
|
46 |
score2 = gr.Textbox(lines=1, label='模型概率')
|
47 |
|
48 |
button1.click(predict_en, inputs=[q1,a1], outputs=[label1,score1])
|
49 |
-
|
50 |
|
51 |
|
52 |
demo.launch()
|
|
|
31 |
We also provide other two versions / 我们还提供了另外两种版本:
|
32 |
- [Sinlge-text version / 独立文本版](https://huggingface.co/spaces/Hello-SimpleAI/chatgpt-detector-single): detect whether a piece of text is ChatGPT generated, using PLM-based classifiers / 判断单条文本是否由ChatGPT生成,使用基于PTM的分类器来开发;
|
33 |
- [Linguistic version / 语言学版](https://huggingface.co/spaces/Hello-SimpleAI/chatgpt-detector-ling): detect whether a piece of text is ChatGPT generated, using linguistic features / 判断单条文本是否由ChatGPT生成,使用基于语言学特征的模型来开发;
|
34 |
+
|
35 |
+
|
36 |
""")
|
37 |
with gr.Tab("English"):
|
38 |
+
gr.Markdown("""
|
39 |
+
Note: Providing more text to the `Answer` box can make the prediction more accurate!
|
40 |
+
""")
|
41 |
q1 = gr.Textbox(lines=2, label='Question',value="What stops a restaurant from noting down my credit card info and using it ? No offense to restaurants . Can be generalized to anyone who I give my credit card info to . Explain like I'm five.")
|
42 |
a1 = gr.Textbox(lines=5, label='Answer',value="There are a few things that can help protect your credit card information from being misused when you give it to a restaurant or any other business:\n\nEncryption: Many businesses use encryption to protect your credit card information when it is being transmitted or stored. This means that the information is transformed into a code that is difficult for anyone to read without the right key.")
|
43 |
button1 = gr.Button("🤖 Predict!")
|
44 |
label1 = gr.Textbox(lines=1, label='Predicted Label 🎃')
|
45 |
score1 = gr.Textbox(lines=1, label='Prob')
|
46 |
with gr.Tab("中文版"):
|
47 |
+
gr.Markdown("""
|
48 |
+
注意: 在`回答`栏中输入更多的文本,可以让预测更准确哦!
|
49 |
+
""")
|
50 |
+
q2 = gr.Textbox(lines=2, label='问题',value="如何评价 OpenAI 的超级对话模型 ChatGPT ?")
|
51 |
+
a2 = gr.Textbox(lines=5, label='回答',value="对于OpenAI大力出奇迹的工作,自然每个人都有自己的看点。我自己最欣赏的地方是ChatGPT如何解决 “AI校正(Alignment)“这个问题。这个问题也是我们课题组这两年在探索的学术问题之一。")
|
52 |
button2 = gr.Button("🤖 预测!")
|
53 |
label2 = gr.Textbox(lines=1, label='预测结果 🎃')
|
54 |
score2 = gr.Textbox(lines=1, label='模型概率')
|
55 |
|
56 |
button1.click(predict_en, inputs=[q1,a1], outputs=[label1,score1])
|
57 |
+
button2.click(predict_zh, inputs=[q2,a2], outputs=[label2,score2])
|
58 |
|
59 |
|
60 |
demo.launch()
|