형태소분석,Lucene,mecap,komoran,tf-idf vector
KOMORAN 설치
jake_kim
2022. 1. 24. 17:37
반응형
# KoNLPy 를 설치하면 KOMORAN 까지 한방에 다 해결되니 아래 링크로 보자.
https://storycode.tistory.com/466
# https://github.com/shineware/PyKOMORAN
pip install PyKomoran
# 혹은
git clone https://github.com/shineware/PyKOMORAN
cd PyKOMORAN/python
sudo python setup.py install
sudo apt install openjdk-11-jre-headless
> vi test.py
from PyKomoran import *
komoran = Komoran("EXP")
print(komoran.get_plain_text("KOMORAN은 한국어 형태소 분석기입니다."))
print(komoran.get_plain_text("① 대한민국은 민주공화국이다."))
komoran = Komoran("STABLE")
print(komoran.get_plain_text("KOMORAN은 한국어 형태소 분석기입니다."))
print(komoran.get_plain_text("① 대한민국은 민주공화국이다."))
> python test.py
# EXP ( = Full )
KOMORAN/SL 은/JX 한국어/NNP 형태소/NNP 분석기/NNG 이/VCP ㅂ니다/EF ./SF
①/SW 대한민국/NNP 은/JX 민주공화국/NNP 이/VCP 다/EF ./SF
# STABLE ( = Light )
KOMORAN/SL 은/JX 한국어/NNP 형태소/NNG 분석기/NNG 이/VCP ㅂ니다/EF ./SF
①/SW 대한민국/NNP 은/JX 민주/NNG 공화국/NNG 이/VCP 다/EF ./SF
반응형