-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e853581
commit 217092b
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@author:XuMing([email protected]) | ||
@description: | ||
""" | ||
import sys | ||
|
||
sys.path.append("..") | ||
from pycorrector.bert.bert_corrector import BertCorrector | ||
if __name__ == '__main__': | ||
|
||
error_sentences = [ | ||
'真麻烦你了。希望你们好好的跳无', | ||
'少先队员因该为老人让坐', | ||
'机七学习是人工智能领遇最能体现智能的一个分知', | ||
'一只小鱼船浮在平净的河面上', | ||
'我的家乡是有明的渔米之乡', | ||
] | ||
|
||
m = BertCorrector() | ||
for line in error_sentences: | ||
correct_sent, err = m.bert_correct(line) | ||
print("original sentence:{} => {}, err:{}".format(line, correct_sent, err)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters