ManavDhayeCoder commited on
Commit
8cbd529
Β·
verified Β·
1 Parent(s): f5ede23

label_map = {"LABEL_0": "negative", "LABEL_1": "positive"}
out = clf("I hated this movie.")[0]
print(label_map[out["label"]], out["score"])

Files changed (1) hide show
  1. README.md +48 -23
README.md CHANGED
@@ -1,37 +1,62 @@
1
- # Fine-tuned BERT for IMDB Sentiment Classification
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- **Model:** google-bert/bert-base-uncased β†’ fine-tuned on IMDB (binary sentiment)
4
 
5
- **Task:** Sequence classification (sentiment analysis)
6
 
7
- **Author:** Your Name / @YourHFusername
8
- **License:** Apache-2.0 (choose appropriate license)
 
9
 
10
  ---
11
 
12
- ## Description
13
- This is a BERT-base model fine-tuned on the IMDB movie reviews dataset for binary sentiment classification (positive / negative).
14
- It accepts raw text and returns a label and confidence score.
 
 
 
 
 
 
 
15
 
16
- **Input:** string (movie review)
17
- **Output:** dictionary with `label` and `score`. By default the model may return `LABEL_0` and `LABEL_1`.
18
- Use the `id2label` mapping below to convert to human-readable labels:
19
- - `LABEL_0` β†’ `negative`
20
- - `LABEL_1` β†’ `positive`
21
 
22
  ---
23
 
24
- ## Example usage
 
25
  ```python
26
  from transformers import pipeline
27
 
28
- clf = pipeline("text-classification", model="YourHFusername/sentiment-bert")
29
-
30
- print(clf("I loved this movie!"))
31
- # [{'label': 'LABEL_1', 'score': 0.998}]
32
 
33
- # map to human-readable label
34
- map = { "LABEL_0": "negative", "LABEL_1": "positive" }
35
- out = clf("I loved this movie!")[0]
36
- print(map[out["label"]], out["score"])
37
- # positive 0.998
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - sentiment-analysis
6
+ - text-classification
7
+ - bert
8
+ - manav
9
+ - ManavDhayeCoder/sentiment-bert
10
+ - ManavDhaye
11
+ pipeline_tag: text-classification
12
+ base_model:
13
+ - google-bert/bert-base-uncased
14
+ datasets:
15
+ - imdb
16
+ library_name: transformers
17
+ widget:
18
+ - text: This movie was amazing!
19
+ - text: Worst movie I have ever seen.
20
+ model-index:
21
+ - name: sentiment-bert
22
+ results: []
23
+ metrics:
24
+ - accuracy
25
+ ---
26
 
27
+ # πŸ“˜ BERT Sentiment Analysis Model (Fine-Tuned on IMDB)
28
 
29
+ This model is a fine-tuned version of **google-bert/bert-base-uncased**, trained on the **IMDB movie reviews dataset** for binary sentiment classification.
30
 
31
+ It predicts whether text expresses **negative** or **positive** sentiment.
32
+
33
+ This model is hosted by **[@ManavDhayeCoder](https://huggingface.co/ManavDhayeCoder)**.
34
 
35
  ---
36
 
37
+ # πŸš€ Model Overview
38
+
39
+ | Property | Value |
40
+ |----------|--------|
41
+ | **Base model** | google-bert/bert-base-uncased |
42
+ | **Task** | Sentiment Analysis (Sequence Classification) |
43
+ | **Labels** | negative / positive |
44
+ | **Dataset** | IMDB |
45
+ | **Library** | Hugging Face Transformers |
46
+ | **Format** | model.safetensors |
47
 
48
+ The model has two classes:
49
+
50
+ - `LABEL_0` β†’ **negative**
51
+ - `LABEL_1` β†’ **positive**
 
52
 
53
  ---
54
 
55
+ # πŸ”₯ Quick Usage Example
56
+
57
  ```python
58
  from transformers import pipeline
59
 
60
+ clf = pipeline("text-classification", model="ManavDhayeCoder/sentiment-bert")
 
 
 
61
 
62
+ print(clf("This movie was amazing!"))