Syntax Error Data Enhancement
Project description
一键语法错误增强工具
使用:pip install ChineseErrorCorrector
开源不易,欢迎 star🌟
pypi:https://pypi.org/project/ChineseErrorCorrector/
介绍
一键语法错误增强工具,支持:
- 1.缺字漏字
- 2.错别字错误
- 3.缺少标点
- 4.错用标点
- 5.主语不明
- 6.谓语残缺
- 7.宾语残缺
- 8.其他成分残缺
- 9.虚词多余
- 10.其他成分多余
- 11.主语多余
- 12.语序不当
- 13.动宾搭配不当
- 14.其他搭配不当
注意
如果没有进行数据增强,则返回None
API
1.缺字漏字
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.lack_word("小明住在北京"))
2.错别字错误
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.wrong_word("小明住在北京"))
3.缺少标点
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.lack_char("小明住在北京"))
4.错用标点
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.wrong_char("小明住在北京"))
5.主语不明
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.unknow_sub("小明住在北京"))
6.谓语残缺
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.unknow_pred("小明住在北京"))
7.宾语残缺
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.lack_obj("小明住在北京"))
8.其他成分残缺
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.lack_others("小明住在北京"))
9.虚词多余
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.red_sub("小明住在北京"))
10.其他成分多余
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.red_component("小明住在北京"))
11.主语多余
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.red_sub("小明住在北京"))
12.语序不当
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.wrong_sentence_order("小明住在北京"))
13.动宾搭配不当
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.wrong_ver_obj("小明住在北京"))
14.其他搭配不当
from ChineseErrorCorrector.dat import GrammarErrorDat
cged_tool = GrammarErrorDat()
print(cged_tool.other_wrong("小明住在北京"))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for chineseerrorcorrector-1.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64ece0cd5ccc827750bf482ac796b94ba6d57ce33d173f460176f75dcb630156 |
|
MD5 | 50b63c15df21c155c910219060c6e053 |
|
BLAKE2b-256 | dd55d27952826c9af91d6426734529ed98114909d7efed286389a7ac31179d33 |
Close
Hashes for ChineseErrorCorrector-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02b740beea37640b186b2ad439a3de622ad7b1cfd8e2628c3f61858673ee724a |
|
MD5 | 83118771e51adc862207eed95fc2055a |
|
BLAKE2b-256 | 2497bd15e793e86b2ce1f7389633e9c6d164601ddac4159a29e075d60982b86a |