2023 용인시 SW/AI 해커톤

용인시 | 알고리즘 | 언어 | 분류 | Macro F1 Score

  • moneyIcon 상금 : 총 500만원
  • 112명 마감

 

[Private 9th] roberta-base + preprocessing

공동작성자

stroke
2023.10.20 19:47 549 조회 language

시드 설정
- random.seed(42)
- np.random.seed(42)
- torch.manual_seed(42)
- torch.cuda.manual_seed_all(42)

모델은 트위터 기반 감정분석 학습모델을 사용하였고 large모델은 GPU메모리 때문에 사용하지 못해 base모델을 사용했습니다.

모델: cardiffnlp/twitter-roberta-base-sentiment-latest

url: https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest

전처리를 간단하게 했을 때와 n-gram 등 캐글 코드를 참고하여 작성하였을때 public fl score가 0.5정도 차이나서 전처리에 집중을 하였습니다.

배치크기를 늘리거나 max_len를 늘리면 GPU 메모리가 오버되서 배치 크기는 32, max_len는 320, learning_rate는 5e-5를 사용했습니다.

validation data로 하이퍼 파라미터를 조절하며 성능이 그나마 제일 잘나온 하이퍼 파라미터를 사용했습니다.

캐글 함수 사이트: https://www.kaggle.com/competitions/nlp-getting-started/code?competitionId=17777&sortBy=voteCount

코드