표제어추출
-
[Deep Learning] NLP - 어간추출(stemming) & 표제어추출(lemmatization)Data Science/Machine Learning & Deep Learning 2021. 4. 16. 15:46
어간 추출과 표제어 추출은 token 의 수를 줄일 수 있습니다. apple, apples가 있다면 apple 하나로 하여 단어의 수를 줄일 수 있는 것입니다. 어간추출 Stemming 접사를 제거하고 단어의 의미가 포함된 핵심 부분만 남겨 변환 어간과 접사 분리( ing, ed, s 와 같은 것들을 제거 ) ex ) wolves -> wolv from nltk.stem import PorterStemmer ps = PorterStemmer() text = 'Wolves were feeding in the forest' words = text.split(" ") for word in words: print(ps.stem(word)) 표제어추출 Lemmatization 단어들은 기본 사전형 단어 형태인 l..