This is a method to install CaboCha [^ 1] without root privileges. To install Cabocha
--CRF ++ (0.55 or later) [^ 2] --MeCab (0.993 or later) [^ 3]
Is required, so it is installed together in advance.
Create a location in ~ / usr
to install CRF ++, MeCab, CaboCha.
echo "export PATH=$HOME/usr/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=${HOME}/usr/lib" >> ~/.bashrc
source ~/.bashrc
mkdir $HOME/usr
wget 'https://docs.google.com/uc?export=download&id=0B4y35FiV1wh7QVR6VXJ5dWExSTQ' -O CRF++-0.58.tar.gz
tar xf CRF++-0.58.tar.gz
cd CRF++-0.58/
./configure --prefix=$HOME/usr
make
make install
git clone https://github.com/taku910/mecab.git
cd mecab/mecab
./configure --prefix=$HOME/usr --with-charset=UTF8
make
make install
wget 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM' -O mecab-ipadic-2.7.0-20070801.tar.gz
tar xvzf mecab-ipadic-2.7.0-20070801.tar.gz
cd mecab-ipadic-2.7.0-20070801/
./configure --with-mecab-config=$HOME/usr/bin/mecab-config --with-charset=UTF8 --prefix=$HOME/usr
make
make install
$ echo "Of the thighs and thighs" | ~/usr/bin/mecab
Plum noun,General,*,*,*,*,Plum,Plum,Plum
Also particles,Particle,*,*,*,*,Also,Mo,Mo
Peach noun,General,*,*,*,*,Peaches,peach,peach
Also particles,Particle,*,*,*,*,Also,Mo,Mo
Peach noun,General,*,*,*,*,Peaches,peach,peach
Particles,Attributive,*,*,*,*,of,No,No
Noun,Non-independent,Adverbs possible,*,*,*,home,Uchi,Uchi
EOS
Download cabocha-0.69.tar.bz2. If you want to download the latest version, please search from the following.
https://drive.google.com/drive/u/1/folders/0B4y35FiV1wh7cGRCUUJHVTNJRnM
curl -sc /tmp/gcokie "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU" > /dev/null
getcode="$(awk '/_warning_/ {print $NF}' /tmp/gcokie)"
curl -Lb /tmp/gcokie "https://drive.google.com/uc?export=download&confirm=${getcode}&id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU" -o cabocha-0.69.tar.bz2
tar xvf cabocha-0.69.tar.bz2
cd cabocha-0.69
export LDFLAGS="-L$HOME/usr/lib"
export CPPFLAGS="-I$HOME/usr/include"
./configure --with-mecab-config=$HOME/usr/bin/mecab-config --with-charset=UTF8 --prefix=$HOME/usr
make
make install
cd python
python setup.py build
python setup.py --user install
$ echo "Your reporter returned by train" | cabocha
Your company-D
Reporter---D
By train-D
Returned to work
EOS
References
[^ 1]: Kudo et al., CaboCha / Pumpkin: Yet Another Japanese Dependency Structure Analyzer
Recommended Posts