GPT를 이용해 NLP의 예시코드를 받아왔습니다.import refrom collections import Counterimport torchimport torch.nn as nnfrom torch.utils.data import DataLoader, Dataset# 예제 텍스트 데이터train_data = [ ("I loved this movie", 1), ("This film was terrible", 0), ("Amazing story and great acting", 1), ("Worst movie ever", 0)]def build_vocab(data): words = [] for sentence, _ in data: words.extend(re.fi..