
148
2
부
빌딩 블록
StructField('path', StringType()),
StructField('text', StringType()),
])
texts = spark.createDataFrame(texts, schema=schema).persist()
## 예제를 위해 수정된 미니 뉴스 그룹에서 발췌
example = '''
Nick's right about this. It's always easier to obtian forgiveness than
permission. Not many poeple remember that Britan'sKng George III
expressly forbade his american subjects to cross the alleghany/appalachian
mountains. Said subjects basically said, "Stop us if you can." He
couldn't.
'''
example = spark.createDataFrame([('.', example)], schema=schema).persist()
5.1
토큰화
텍스트와 음성의 언어 데이터는 순차적인 데이터다. 순차적인 데이터로 작업할 때는 시퀀스가
무엇으로 구성되어 있는지 이해하는 것이 중요하다. 디스크와 메모리에서 텍스트 데이터는 ...