1. First define your own vocabulary new_add.txt, the format is: one word per line, without part of speech and frequency;
2. Put the vocabulary in the path of pyhanlp in the lib/python3.7/site-packages/pyhanlp/static/data/dictionary/custom folder
3. Modify the content of the hanlp.properties file, the path is lib/python3.7/site-packages/pyhanlp/static/hanlp.properties. Specific method: add new_add.txt to the custom dictionary path on line 20 of the file, CustomDictionaryPath =data/dictionary/custom/CustomDictionary.txt; new_add.txt; Modern Chinese Supplementary Thesaurus.txt…
4. Delete the cache file, lib/python3.7/site-packages/pyhanlp/static/data/dictionary/custom/CustomDictionary.txt.bin