shibing624 commited on
Commit
04a455f
1 Parent(s): c659f9c

update demo.

Browse files
Files changed (1) hide show
  1. app.py +16 -19
app.py CHANGED
@@ -40,22 +40,19 @@ def ai_text(texts):
40
  return result
41
 
42
 
43
- print(ai_text(['少先队员因该为老人让坐']))
44
-
45
- examples = [
46
- ['真麻烦你了。希望你们好好的跳无'],
47
- ['少先队员因该为老人让坐'],
48
- ['机七学习是人工智能领遇最能体现智能的一个分知'],
49
- ['今天心情很好'],
50
- ['老是较书。'],
51
- ['遇到一位很棒的奴生跟我聊天。'],
52
- ['他的语说的很好,法语也不错'],
53
- ['他法语说的很好,的语也不错'],
54
- ['他们的吵翻很不错,再说他们做的咖喱鸡也好吃'],
55
- ['不过在许多传统国家,女人向未得到平等'],
56
- ]
57
-
58
- output_text = gr.outputs.Textbox()
59
- gr.Interface(ai_text, "text", "text", title="Chinese Text Correction shibing624/macbert4csc-base-chinese",
60
- description="Copy or input error Chinese text. Submit and the machine will correct text.",
61
- examples=examples).launch()
 
40
  return result
41
 
42
 
43
+ if __name__ == '__main__':
44
+ print(ai_text(['少先队员因该为老人让坐']))
45
+
46
+ examples = [
47
+ [['真麻烦你了。希望你们好好的跳无']],
48
+ [['少先队员因该为老人让坐']],
49
+ [['机七学习是人工智能领遇最能体现智能的一个分知']],
50
+ [['今天心情很好']],
51
+ [['他法语说的很好,的语也不错']],
52
+ [['他们的吵翻很不错,再说他们做的咖喱鸡也好吃']],
53
+ ]
54
+
55
+ output_text = gr.outputs.Textbox()
56
+ gr.Interface(ai_text, "textbox", output_text, title="Chinese Text Correction shibing624/macbert4csc-base-chinese",
57
+ description="Copy or input error Chinese text. Submit and the machine will correct text.",
58
+ examples=examples).launch()