TedYeh
commited on
Commit
·
5cda2b6
1
Parent(s):
3970b0a
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('糾正句子裡的錯字:' + sentence
|
| 9 |
outputs = model.generate(input_ids, max_length=200)
|
| 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=200)
|
| 10 |
edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 11 |
return edited_text
|