![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqPwC0%2FbtqXwcjmo43%2FG52GFjv3eSm7dlqK9Dkfd0%2Fimg.png)
# 전처리 함수 생성 후 적용 def preprocessing(data,stopword): rm = re.compile('[:;\\'\\"\\[\\]\\(\\)\\.,@]') rm_data = data.astype(str).apply(lambda x: re.sub(rm, '', x)) word_token = [word_tokenize(x) for x in rm_data] remove_stopwords_tokens = [] for sentence in word_token: temp = [] for word in sentence: if word not in stopword: temp.append(word) remove_stopwords_tokens.append(temp) return remove_stopwo..