Downloads · 30 days
158
0% of all-time downloads
JiaqiLee/imdb-finetuned-bert-base-uncased
imdb-finetuned-bert-base-uncased is a text classification model from JiaqiLee. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as openrail.
This model is a fine-tuned version of the bert-base-uncased model to classify the sentiment of movie reviews into one of two categories: negative(label 0), positive(label 1).
Downloads · 30 days
158
0% of all-time downloads
All-time downloads
216K
Public
Repo size
876 MB
Likes
6
Public
Click a slice to open those files.
.bin438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of the bert-base-uncased model to classify the sentiment of movie reviews into one of two categories: negative(label 0), positive(label 1).
You can use the model with the following code.
from transformers import BertForSequenceClassification, BertTokenizer, TextClassificationPipeline
model_path = "JiaqiLee/imdb-finetuned-bert-base-uncased"
tokenizer = BertTokenizer.from_pretrained(model_path)
model = BertForSequenceClassification.from_pretrained(model_path, num_labels=2)
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
print(pipeline("The movie depicted well the psychological battles that Harry Vardon fought within himself, from his childhood trauma of being evicted to his own inability to break that glass ceiling that prevents him from being accepted as an equal in English golf society."))
The training data comes from HuggingFace IMDB dataset. We use 90% of the train.csv data to train the model and the remaining 10% for evaluation.
The model achieves 0.91 classification accuracy in IMDB test dataset.