qdap으로 텍스트 정리하기
qdap 패키지에는 다양한 텍스트 정리 함수가 있습니다. 각 함수는 자체적으로도 유용하며, 서로 결합하면 특히 강력합니다.
bracketX(): 괄호 안의 모든 텍스트를 제거합니다(예: "It's (so) cool" → "It's cool").replace_number(): 숫자를 해당하는 영어 단어로 바꿉니다(예: "2" → "two").replace_abbreviation(): 약어를 전체 표기로 바꿉니다(예: "Sr" → "Senior").replace_contraction(): 축약형을 원래 단어 형태로 되돌립니다(예: "shouldn't" → "should not").replace_symbol(): 일반적인 기호를 해당하는 단어로 바꿉니다(예: "$" → "dollar").
이 연습은 강의의 일부입니다
R로 배우는 Bag-of-Words 텍스트 마이닝
연습 안내
이전 연습 문제의 text 객체에 다음 함수를 차례로 적용하세요:
bracketX()replace_number()replace_abbreviation()replace_contraction()replace_symbol()
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
## text is still loaded in your workspace
# Remove text within brackets
___
# Replace numbers with words
___
# Replace abbreviations
___
# Replace contractions
___
# Replace symbols with words
___