-
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
217092b
commit b956036
Showing
2 changed files
with
46 additions
and
0 deletions.
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(xuming624@qq.com) | ||
@description: | ||
""" | ||
import sys | ||
|
||
sys.path.append("..") | ||
from pycorrector.electra.electra_corrector import ElectraCorrector | ||
|
||
if __name__ == '__main__': | ||
error_sentences = [ | ||
'真麻烦你了。希望你们好好的跳无', | ||
'少先队员因该为老人让坐', | ||
'机七学习是人工智能领遇最能体现智能的一个分知', | ||
'一只小鱼船浮在平净的河面上', | ||
'我的家乡是有明的渔米之乡', | ||
] | ||
|
||
m = ElectraCorrector() | ||
for line in error_sentences: | ||
correct_sent, err = m.electra_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@author:XuMing(xuming624@qq.com) | ||
@description: | ||
""" | ||
import sys | ||
|
||
sys.path.append("..") | ||
from pycorrector.ernie.ernie_corrector import ErnieCorrector | ||
|
||
if __name__ == '__main__': | ||
error_sentences = [ | ||
'真麻烦你了。希望你们好好的跳无', | ||
'少先队员因该为老人让坐', | ||
'机七学习是人工智能领遇最能体现智能的一个分知', | ||
'一只小鱼船浮在平净的河面上', | ||
'我的家乡是有明的渔米之乡', | ||
] | ||
|
||
m = ErnieCorrector() | ||
for line in error_sentences: | ||
correct_sent, err = m.ernie_correct(line) | ||
print("original sentence:{} => {}, err:{}".format(line, correct_sent, err)) |