Location>code7788 >text

One-Click Syntax Error Enhancer ChineseErrorCorrector

Popularity:447 ℃/2024-07-29 09:44:07

One-Click Syntax Error Enhancement Tool

Welcome to use my recent open source use of one-click syntax error enhancement tool , the tool can be 14 kinds of syntax error enhancement , different industries can be based on their own data for error replacement to train their own grammar and spelling model , I hope to promote the development of the industry's text error correction , welcome to Star, 14 kinds of errors are shown below :

 

For each type of error, the corresponding usage is shown below:

Installation of the environment

 

pip install ChineseErrorCorrector

Different types of data enhancements

1. Missing words and omissions

 

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.lack_word("Xiaoming lives in Beijing."))

# Output: Xiaoming in Beijing

 

2. Typo errors

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.wrong_word("Xiaoming lives in Beijing."))
# Output: Ming lives in North Whale

 

 

3. Lack of punctuation

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.lack_char("Xiaoming lives in Beijing and loves NLP."))
# Output: Xiaoming lives in Beijing and loves NLP.

 

4. Misuse of punctuation

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.wrong_char("Xiaoming lives in Beijing."))
# Output: Xiaoming lives in Beijing. Passionate about NLP.

 

5. Unknown subject

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.unknow_sub("Xiaoming lives in Beijing."))
# Output: Live in Beijing

 

6. Predicate mutilation

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.unknow_pred("Xiaoming lives in Beijing."))
# Output: Xiaoming in Beijing

 

7. Object mutilation

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.lack_obj("Xiaoming lives in Beijing and loves NLP."))
# Output: Xiaoming lives in Beijing and loves.

 

8. Other components missing

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.lack_others("Xiaoming lives in Beijing and loves NLP."))
# Output: Xiaoming lives in Beijing and loves NLP.

 

9. Void word redundancy

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.red_fun("Xiaoming lives in Beijing and loves NLP."))
# Output: Xiaoming lives in Beijing and loves NLP.

 

10. Other ingredients are superfluous

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.red_component("Xiaoming lives in Beijing and loves NLP."))
# Output: Xiaoming lives in Beijing and loves NLP. looking at the

 

11. Subject redundancy

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.red_sub("Xiaoming lives in Beijing and loves NLP."))
# Output: Xiaoming lives in Beijing, Xiaoming loves NLP.

 

12. Inappropriate word order

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.wrong_sentence_order("Xiaoming lives in Beijing and loves NLP."))
# Output: Love NLP. xiao Ming lives in Beijing.

 

13. Inappropriate collocation of verbs and objects

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.wrong_ver_obj("Xiaoming lives in Beijing and loves NLP."))
# Output: None , i.e. enhancement of this type of error is not possible

 

14. Other mismatches

from  import GrammarErrorDat

cged_tool = GrammarErrorDat()
print(cged_tool.other_wrong("Xiaoming lives in Beijing and loves NLP."))
# Output: None, i.e. enhancement of this type of error is not possible

Code Address:/TW-NLP/ChineseErrorCorrector