Install MeCab with pip
!pip install mecab-python
import MeCab
# Example 1
s = MeCab.Tagger('-Ochasen')
print(s.parse('There is a chicken in the haniwa'))

# Example 2
s = MeCab.Tagger('-Ochasen')
print(s.parse('There are two chickens in the yard'))

Result of Analysis by MeCab(mecab-python3-0.996.5)

Result of Analysis by janome(janome-0.3.10)

It became a collaboration by "crocodile", "haniwa" and "chicken"
Result of Analysis by MeCab(mecab-python3-0.996.5)

Result of Analysis by janome(janome-0.3.10)

Reference
■ [Google Colaboratory] Preprocessing of Natural Language Processing & Morphological Analysis (janome) ■ [Google Colaboratory] Use morphological analysis (janome) Install Python from source What are configure, make, make install Do not install to / usr or / usr / local when building and installing software yourself
Recommended Posts