JPFreq is a frequency processor for Japanese text. It uses the Cython wrapper for MeCab Fugashi to process Japanese text.
- Install Fugashi and Unidic
pip install fugashi[unidic] python3 -m unidic download
- Install JPFreq
pip install jpfreq
For detailed usage, see the documentation.
from jpfreq.jp_frequency_list import JapaneseFrequencyList
freq_list = JapaneseFrequencyList()
freq_list.process_line("私は猫です。")
print(freq_list.get_most_frequent())
from jpfreq.jp_frequency_list import JapaneseFrequencyList
freq_list = JapaneseFrequencyList()
freq_list.process_file("path/to/file.txt")
print(freq_list.get_most_frequent())