강의

멘토링

로드맵

Inflearn Community Q&A

testerhyuk2142928's profile image
testerhyuk2142928

asked

Introduction to Deep Learning Natural Language Processing with Examples NLP with TensorFlow - From RNN to BERT

Experiment 2 - Text Classification Using BERT on the Naver Movie Review Dataset (NSMC) (BERT Korean Fine-Tuning)

네이버 영화리뷰 파인튜닝 질문드려요

Written on

·

305

0

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
 
앞선 과정에서 한글이든 영어든 토크나이저로 토큰화 시킨 후에 모델에 입력값으로 넣어야 하는 것으로 이해했습니다. 그런데, bert 모델에 넣을때는 토큰화 하지 않는 것 같은데 토큰화를 안해주는 이유가 있나요? 아니면 제가 토큰화하는 코드를 못본걸까요?
tensorflowNLP딥러닝

Quiz

What is the core idea of using the BERT model?

Training a model from scratch using only the given data

Transfer learning using model parameters learned from other problems as initial values

Improving training efficiency by minimizing model size

Converting text data into image data for processing

Answer 1

0

AISchool님의 프로필 이미지
AISchool
Instructor

안녕하세요~. 반갑습니다.

bert 모델에 넣기 전에 아래 코드에서 토크나이징을 진행한 후 bert 모델에 들어가게 됩니다.

text_test = ['지루하지는 않은데 완전 막장임... 돈주고 보기에는....']

text_preprocessed = bert_preprocess_model(text_test)

 

print(f'Keys       : {list(text_preprocessed.keys())}')

print(f'Shape      : {text_preprocessed["input_word_ids"].shape}')

print(f'Word Ids   : {text_preprocessed["input_word_ids"][0, :12]}')

print(f'Input Mask : {text_preprocessed["input_mask"][0, :12]}')

print(f'Type Ids   : {text_preprocessed["input_type_ids"][0, :12]}')


위 코드아래에서 text_preprocessed값이 bert 모델의 인풋으로 들어가는 모습을 확인하실 수 있습니다.

그럼 좋은 하루되세요~.

감사합니다.

testerhyuk2142928's profile image
testerhyuk2142928

asked

Ask a question