NLP β Sentiment & Text Classification
Collection
NLP β Sentiment & Text Classification by Harsha901 β’ 2 items β’ Updated
Run Harsha901/tinybert-imdb-sentiment-analysis-model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/Harsha901/tinybert-imdb-sentiment-analysis-model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/Harsha901/tinybert-imdb-sentiment-analysis-model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use Harsha901/tinybert-imdb-sentiment-analysis-model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Harsha901/tinybert-imdb-sentiment-analysis-model") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Harsha901/tinybert-imdb-sentiment-analysis-model")
model = AutoModelForSequenceClassification.from_pretrained("Harsha901/tinybert-imdb-sentiment-analysis-model", device_map="auto")This is a fine-tuned TinyBERT model for binary sentiment classification on a 5,000-sample subset of the IMDB dataset. It predicts whether a movie review is positive or negative.
huawei-noah/TinyBERT_General_4L_312DAutoTokenizer.from_pretrained('huawei-noah/TinyBERT_General_4L_312D')Trainer| Metric | Value |
|---|---|
| Accuracy | 88.02% |
| Evaluation Loss | 0.2962 |
| Runtime | 30.9 sec |
| Samples per Second | 485 |
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Harsha901/tinybert-imdb-sentiment-analysis-model"
)
result = classifier("This movie was absolutely amazing!")
print(result) # [{'label': 'LABEL_1', 'score': 0.98}]
Base model
huawei-noah/TinyBERT_General_4L_312D