일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 과적합
- 전이학습
- COLAB
- 원-핫 인코딩
- 클러스터링
- 풀링층
- 카운트 벡터
- 딥러닝
- 입력층
- 임베딩
- KONLPY
- 자연어 전처리
- NLTK
- 순환 신경망
- 프로그래머스
- 양방향 RNN
- 합성곱 신경망
- 합성곱층
- 코딩테스트
- RNN
- 시계열 분석
- 텍스트 마이닝
- 성능 최적화
- 생성모델
- 망각 게이트
- cnn
- 코랩
- 완전연결층
- 이미지 분류
- 출력층
Archives
- Today
- Total
Colab으로 하루에 하나씩 딥러닝
자연어 전처리_2.전처리_2) 불용어 제거 본문
728x90
불용어
- 문장 내에서 빈번하게 발생하여 의미를 부여하기 어려운 단어
- 자연어 처리에 있어 효율성을 감소시키며, 처리 시간을 길게하기 때문에 반드시 제거해야 함
- ex) 'a/an', 'the', 'of', ...
### 불용어 제거
import nltk
from nltk.corpus import stopwords
nltk.download('stopwords')
nltk.download('punkt')
from nltk.tokenize import word_tokenize
sample_text = """One of the first things that we ask ourselves is
what are the pros and cons of any task wwe perform."""
text_tokens = word_tokenize(sample_text)
tokens_without_sw = [word for word in text_tokens if not word in stopwords.words('english')]
print('불용어 제거 미적용:', text_tokens, '\n')
print('불용어 제거 적용:', tokens_without_sw)

출처: 서지영, 『딥러닝 텐서플로 교과서』, 길벗(2022)
'딥러닝_개념' 카테고리의 다른 글
자연어 전처리_3.임베딩_1) 희소 표현 기반 임베딩(원-핫 인코딩) (0) | 2022.12.12 |
---|---|
자연어 전처리_2.전처리_4) 정규화 (1) | 2022.12.10 |
자연어 전처리_2.전처리_3) 어간 추출 / 표제어 추출 (0) | 2022.12.09 |
자연어 전처리_2.전처리_1) 토큰화 (2) | 2022.12.08 |
자연어 전처리_1.자연어 처리 (2) | 2022.12.07 |