문자열 토큰 처리 + LSTM으로 감성 분류 토큰 : 의미가 있는 최소한의 단위로 나눔 토큰 분리 방법 1 > for이용 # 토큰 분리 방법 1 token_index = {} for sam in samples: for word in sam.split(sep=' '): if word not in token_index: token_index[word] = len(token_index) print(token_index) ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ {'The': 0, 'cat': 1, 'say': 2, 'on': 3, 'the': 4, 'mat.': 5, 'dog': 6, 'ate': 7, 'my': 8, 'homework.': 9} 토큰 분리 방법 2 > Tokenizer 사용 # 토큰 ..