[소셜분석] 베이지안 감정 분류 모델, 소셜분석 파싱 실습
Naive Bayes Classifier 실습1 NLTK 1. 필요한 라이브러리, 패키지, 데이터 불러오기 from nltk.tokenize import word_tokenize import nltk import numpy import scipy # 학습 데이터 train = [('I like you', 'pos'), ('I hate you', 'neg'), ('You like me', 'neg'), ('I like her', 'pos')] 2. 학습 데이터에서 문장과 단어 분리하고 포함여부 확인하기 # word.lower() for sentence in train: 학습용 데이터에서 문장 가져와 소문자로 # for word in word_tokenize(sentence[0]): 소문자로 만든 것 중 s..
2022. 7. 14.