mecab

TOLL TERRY·2024년 3월 18일
0

error_or_download

목록 보기
16/16

mecab 사용하기

######################

apt-get install --upgrade
apt install sudo
sudo apt-get update
sudo apt-get install g++
apt -y install gcc
sudo apt-get install make
pip install jamo
pip install koeda

#############

  1. mecab-0.996-ko-0.9.2 폴더 만들기
wget https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz
tar xvfz mecab-0.996-ko-0.9.2.tar.gz
cd mecab-0.996-ko-0.9.2
apt-get install openjdk-8-jdk python-dev python3-dev
./configure
make
make check
sudo make install
  1. mecab-0.996-ko-0.9.2.tar 폴더안에 / mecab-ko-dic-2.1.1-20180720 폴더 만들기
wget https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz
tar xvfz mecab-ko-dic-2.1.1-20180720.tar.gz
cd .mecab-0.996-ko-0.9.2/mecab-ko-dic-2.1.1-20180720/
./configure
make
sudo apt-get install g++ openjdk-8-jdk python3-dev python3-pip curl
6 # asia
69 # seoul
bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
sudo make install
sudo pip3 install konlpy
pip install mecab-python
bash autogen.sh
make
sudo make install
bash tools/add-userdic.sh
  1. user-dic 경로 복사하기
# tmp 경로에 저장된 사용자 사전 명사에 새로운 단어 추가
pwd
/data/ephemeral/home/EDA/mecab-0.996-ko-0.9.2/mecab-ko-dic-2.1.1-20180720/user-dic/nnp.csv

with open('/data/ephemeral/home/EDA/mecab-0.996-ko-0.9.2/mecab-ko-dic-2.1.1-20180720/user-dic/nnp.csv', "r", encoding='utf-8') as f:
  user_dict = f.readlines()
profile
행복을 찾아서(크리스 가드너)

0개의 댓글