Install the Japanese dependency parser CaboCha on Linux Mint 13 (Ubuntu 12.04) and install it. Make it callable in Python.
I was allowed to refer to the following site.
-> MeCab / MeCab dictionary download page -> MeCab / MeCab dictionary installation procedure page
sudo apt-get install mecab libmecab-dev mecab-utils mecab-ipadic-utf8
I was allowed to refer to the following site.
-> Install yamcha & Cabocha on Ubuntu for forgetful memories
I was allowed to refer to the following site.
-> Easy way to install UTF-8 version of cabocha on Ubuntu --Syo-Takasaki's diary
※Caution -The part of "/etc/apt/source.list" may be "/etc/apt/sources.list". ・ After completing the work on the above site, issue the following command.
sudo apt-get install libcabocha-dev
Find the installation folder for CaboCha. Search the drive for "CaboCha.py" and move to the folder containing the file.
find / -name CaboCha.py
※Caution -If you installed with make, the installation source folder will also be hit in the search.
Issue the following command and execute setup.py.
sudo python setup.py install
Call Cabocha.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import CaboCha
c = CaboCha.Parser()
sent = 'After passing through a long tunnel on the border, it was a snow country. The bottom of the night turned white. The train stopped at the signal box.'
print c.parseToString(sent)
Border---D
long-D
Tunnel-D
When you exit-D
It was a snow country.-----D
At night-D |
The bottom is-D
It turned white.-----D
At the signal box---D
The train-D
Stopped.
EOS
-> MeCab: Yet Another Part-of-Speech and Morphological Analyzer -> cabocha - Yet Another Japanese Dependency Structure Analyzer - Google Project Hosting -> Install yamcha & Cabocha on Ubuntu for forgetful memories -> Easy way to install UTF-8 version of cabocha on Ubuntu --Syo-Takasaki's diary
Recommended Posts