AI
word2vec - 학습 데이터 준비
맥락과 타깃 word2vec 신경망 입력은 '맥락' 정답 레이블은 맥락에 둘러싸인 중앙의 단어 '타깃' 말뭉치에서 맥락과 타깃을 만드는 예 말뭉치 텍스트 단어 ID로 변환 - preprocess() import sys sys.path.append('..') from util import preprocess text = 'You say goodbye I say hello.' corpus, word_to_id, id_to_word = preprocess(text) print(corpus) print(id_to_word) 단어 ID의 배열인 corpus로부터 맥락과 타깃 작성하는 예 맥락과 타깃을 만드는 함수 def create_contexts_target(corpus, window_size=1): targe..
2020. 12. 30. 23:20
최근댓글