TedYeh
commited on
Commit
·
03bdda8
1
Parent(s):
64fe5a1
update app
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ model = T5ForConditionalGeneration.from_pretrained("CodeTed/traditional_CSC_t5")
|
|
5 |
|
6 |
|
7 |
def cged_correction(sentence = '為了降低少子化,政府可以堆動獎勵生育的政策。'):
|
8 |
-
input_ids = tokenizer('
|
9 |
outputs = model.generate(input_ids, max_length=256)
|
10 |
edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
11 |
return edited_text
|
|
|
5 |
|
6 |
|
7 |
def cged_correction(sentence = '為了降低少子化,政府可以堆動獎勵生育的政策。'):
|
8 |
+
input_ids = tokenizer('糾正句子裡的錯字:' + sentence + "_輸出句:", return_tensors="pt").input_ids
|
9 |
outputs = model.generate(input_ids, max_length=256)
|
10 |
edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
11 |
return edited_text
|