BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Paper
โข
1810.04805
โข
Published
โข
25
์ด ๋ชจ๋ธ์ BERT-base-uncased๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ฉฐ, IMDB ์ํ ๋ฆฌ๋ทฐ ๋ฐ์ดํฐ์
์ ์ด์ฉํด ๊ฐ์ฑ ๋ถ์(Sentiment Analysis) ์์
์ ๋ง๊ฒ ํ์ธํ๋๋์์ต๋๋ค.
ํ
์คํธ๋ฅผ ๋ ๊ฐ์ง ๊ฐ์ ์ผ๋ก ๋ถ๋ฅํฉ๋๋ค:
bert-base-uncased | ์งํ | ์ ์ |
|---|---|
| ์ ํ๋ (Accuracy) | 0.88 |
| F1 ์ ์ (F1 Score) | 0.88 |
์ธก์ ์ IMDB ํ ์คํธ ์ธํธ์์ ์ํ๋์์ต๋๋ค.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "your-username/bert-based-uncased-imdb-sentiment"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "This movie was amazing!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
pred = outputs.logits.argmax(-1).item()
print("Sentiment:", "Positive" if pred == 1 else "Negative")
์ด ๋ชจ๋ธ์ ์์ด ์ํ ๋ฆฌ๋ทฐ ๊ฐ์ฑ ๋ถ์ ์์
์ ์ํด ์ค๊ณ๋์์ต๋๋ค.
๋ค๋ฅธ ์์ด ํ
์คํธ ๊ฐ์ฑ ๋ถ์ ๊ณผ์ ์ ์ฌ์ฉํ ๊ฒฝ์ฐ, ์ถ๊ฐ ํ์ธํ๋์ ํตํด ํ์ฅ ์์ฉํ ์ ์์ต๋๋ค.
์ฐ๊ตฌ ๋๋ ์๋น์ค์์ ๋ณธ ๋ชจ๋ธ์ ์ฌ์ฉํ ๊ฒฝ์ฐ ์๋์ ๊ฐ์ด ์ธ์ฉํด์ฃผ์ธ์.
@misc{bert-imdb-finetuned,
title={BERT-base-uncased fine-tuned on IMDB Sentiment Dataset},
author={Your Name},
year={2025},
howpublished={Hugging Face Hub},
}
๋ณธ ๋ชจ๋ธ์ Apache 2.0 ๋ผ์ด์ ์ค ํ์ ๋ฐฐํฌ๋ฉ๋๋ค.