ManavDhayeCoder commited on
Commit
ea91484
·
verified ·
1 Parent(s): 510e88f

# Fine-tuned BERT for IMDB Sentiment Classification

**Model:** google-bert/bert-base-uncased → fine-tuned on IMDB (binary sentiment)

**Task:** Sequence classification (sentiment analysis)

**Author:** Manav Dhaye/

@ManavDhayeCoder

---

## Description
This is a BERT-base model fine-tuned on the IMDB movie reviews dataset for binary sentiment classification (positive / negative).
It accepts raw text and returns a label and confidence score.

**Input:** string (movie review)
**Output:** dictionary with `label` and `score`. By default the model may return `LABEL_0` and `LABEL_1`.
Use the `id2label` mapping below to convert to human-readable labels:
- `LABEL_0` → `negative`
- `LABEL_1` → `positive`


## Example usage
```python
from transformers import pipeline

clf = pipeline("text-classification", model="YourHFusername/sentiment-bert")

print(clf("I loved this movie!"))
# [{'label': 'LABEL_1', 'score': 0.998}]

# map to human-readable label
map = { "LABEL_0": "negative", "LABEL_1": "positive" }
out = clf("I loved this movie!")[0]
print(map[out["label"]], out["score"])
# positive 0.998

Files changed (1) hide show
  1. README.md +14 -0
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ {}
3
+ ---
4
+ # Sentiment Analysis Model (BERT Fine-Tuned on IMDB)
5
+
6
+ This model is a fine-tuned version of **google-bert/bert-base-uncased** on the **IMDB sentiment classification dataset**.
7
+
8
+ ## 🧠 Usage
9
+
10
+ ```python
11
+ from transformers import pipeline
12
+
13
+ classifier = pipeline("text-classification", model="ManavDhayeCoder/sentiment-bert")
14
+ classifier("This movie was amazing!")