Downloads · 30 days
5
23% of all-time downloads
Lucky0626/bert-base-uncased-imdb2-v01
bert-base-uncased-imdb2-v01 is a machine learning model from Lucky0626. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a text classification model fine-tuned from the [translate:bert-base-uncased] base model. It is trained on the IMDB movie review dataset to classify sentiment into two categories: - 0: Negative - 1: Posi…
Downloads · 30 days
5
23% of all-time downloads
All-time downloads
22
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
---
language:
- en
license: apache-2.0
tags:
- text-classification
- sentiment-analysis
- bert
datasets:
- imdb
metrics:
- accuracy
- f1
base_model: bert-base-uncased
---
This model is a text classification model fine-tuned from the [translate:bert-base-uncased] base model.
It is trained on the IMDB movie review dataset to classify sentiment into two categories:
The model was fine-tuned using the IMDB dataset consisting of movie reviews labeled with positive or negative sentiments.
## Usage
---
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "Lucky0626/bert-base-uncased-imdb2-v01"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "This movie was absolutely fantastic!"
inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=-1)
print("Predicted sentiment:", predictions.item())
---