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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4da8f37f2387df6bb70ecdf76e66749d1adf822577862c9879d9024a4026231b |
|
MD5 | 32dd89248377f217ad9d7ed91d8b62d3 |
|
BLAKE2b-256 | 2fa6d629fab6fc4bfd6320127d9eac9e50567370adfaffa0f4dbb9cd0be47dc1 |
Close
Hashes for ChineseErrorCorrector-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56bb3ff17d8c5cd817d26af37ab5f3318f8a85c945ef25d5c4724c067e13d626 |
|
MD5 | 9d60ceac46583c4becfd321f155e5958 |
|
BLAKE2b-256 | c808625ada0414f18c9de0de21206b658de2b537023baad25fb15036e3181ce7 |