반응형

 

/*******************************************************************************************************************
-- Title : [NLP] Stemming vs. Lemmatizing 정의
-- Key word : nlp 자연어 처리 자연어처리 스태밍 stemming lemma lemmatizing lemmatize
*******************************************************************************************************************/

■ Stemming vs. Lemmatizing

 Stemming  Lemmatizing 출처
stemming can often create non-existent words
So, your root stem, meaning the word you end up with, is not something you can just look up in a dictionary.


( stemming은 없는 말을 만들어 내기도 해서, 결과 stem이 사전에 없을 수도 있다. )
lemmas are actual words
so, you can look up a lemma a dictionary.

(lemma는 사전에 실제로 있는 단어다.)
 >> Link
Stemming은 단어 그 자체만을 고려한다.

예를 들면, ‘flies’가 주어졌을 때, Stemming은 단순히 이 단어의 어근을 내놓는데 비해
 Lemmatization은 그 단어가 문장 속에서 어떤 품사(Part-of-speech)로 쓰였는지까지 판단한다.

Lemmatization은 문장 속에서 ‘files’가 동사 ‘날다’ 와 명사 ‘파리’ 중 어떤 뜻으로 쓰였는지까지 결정할 수 있어야 한다.
  >> Link
 Stemming usually refers to a crude heuristic process that chops off the ends of words in the hope of achieving this goal correctly most of the time, and often includes the removal of derivational affixes.

(Stemming은, 단어의 어미를 잘라 파생적 의미를 제거하고자 하는 단순 휴리스틱 프로세스)
 Lemmatization usually refers to doing things properly with the use of a vocabulary and morphological analysis of words, normally aiming to remove inflectional endings only and to return the base or dictionary form of a word, which is known as the lemma . 

( Lemmatization은, 단어의 형태소적, 사전적 분석을 통해 파생적 의미를 제거하고, 기본 사전형인 lemma를 제공하고자 하는 일 )
  >> Link
print(ps.stem("flying"))
print(ps.stem("flies"))

# fli
# fli
print(lemmatizer.lemmatize('flying', pos='v'))
print(lemmatizer.lemmatize('flies', pos='n'))

# fly
# fly
  




 

반응형

+ Recent posts