language_tool_python
language_tool_python copied to clipboard
Help adding n-gram data
Hi! I wanted to add the n-gram data to make the tool able to detect more errors but i don't know how to do it. I read the documentation and i tried adding in the config dict the languageModel param but i couldn't notice any changes in the responses.
!pip install language_tool_python !wget https://languagetool.org/download/ngram-data/ngrams-en-20150817.zip !unzip ngrams-en-20150817.zip -d ngrams import language_tool_python tool = language_tool_python.LanguageTool('en-US', config={ 'languageModel' : '/content/ngrams/en/'}) text = 'There sandwich was eaten' matches = tool.check(text) matches
matches returns [] (emtpy list), when should detect There -> Their.
Could you give me an example on how to load the data?