SuganyaP commited on
Commit
92c06e0
·
verified ·
1 Parent(s): c2fa4bd

Updated README.md (Professional Model Card)

Browse files
Files changed (1) hide show
  1. README.md +40 -37
README.md CHANGED
@@ -1,40 +1,43 @@
1
- ---
2
- license: mit
3
- language:
4
- - en
5
- metrics:
6
- - accuracy
7
- - f1
8
- base_model:
9
- - distilbert/distilbert-base-uncased-finetuned-sst-2-english
10
- ---
11
- # Quick DistilBERT IMDB Sentiment Classifier
12
-
13
- This is a fine-tuned DistilBERT model for **sentiment analysis** on the IMDB movie reviews dataset.
14
- The model classifies reviews as **positive** or **negative**.
15
-
16
- ## Model Details
17
- - **Base model**: `distilbert-base-uncased`
18
- - **Dataset**: IMDB (cleaned train/test splits)
19
- - **Task**: Sentiment classification (binary)
20
- - **Framework**: Hugging Face Transformers
21
-
22
- ## Training
23
- - Optimized DistilBERT on IMDB dataset
24
- - Used standard text classification head
25
- - Training args saved in `training_args.bin`
26
-
27
- ## Evaluation
28
- Accuracy and F1-score on the IMDB test set:
29
- (Add numbers from your `eval_report.txt` here)
30
-
31
- Misclassified examples are available in `misclassified_examples.csv`.
32
-
33
- ## How to Use
34
  ```python
35
- from transformers import pipeline
 
 
 
 
 
36
 
37
- model_id = "SuganyaP/quick-distilbert-imdb"
38
- classifier = pipeline("sentiment-analysis", model=model_id)
 
39
 
40
- print(classifier("This movie was excellent!"))
 
1
+ # DistilBERT IMDB Sentiment Classifier
2
+
3
+ ## Overview
4
+ This repository contains a fine-tuned DistilBERT model for binary sentiment classification on the IMDB movie reviews dataset. The model predicts whether a given review expresses positive or negative sentiment. It is intended as a lightweight, reproducible NLP model suitable for demonstrations, small-scale applications, and experimentation.
5
+
6
+ ## Base Model
7
+ - Model: distilbert-base-uncased
8
+ - Framework: Hugging Face Transformers
9
+ - Task: Text Classification (Binary Sentiment)
10
+
11
+ ## Training Details
12
+ - Dataset: IMDB movie review dataset (train/test split)
13
+ - Objective: Binary sentiment classification
14
+ - Optimization:
15
+ - Adam optimizer
16
+ - Learning rate scheduling
17
+ - Early stopping
18
+ - Regularization:
19
+ - Dropout applied as per DistilBERT architecture
20
+ - Gradient clipping
21
+
22
+ ## Evaluation Metrics
23
+ The model was evaluated using standard binary classification metrics:
24
+ - Accuracy
25
+ - Precision
26
+ - Recall
27
+ - F1-score
28
+
29
+ ## Inference Example
30
+
 
 
 
31
  ```python
32
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
33
+ import torch
34
+
35
+ model_name = "SuganyaP/quick-distilbert-imdb"
36
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
37
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
38
 
39
+ inputs = tokenizer("This movie was excellent!", return_tensors="pt")
40
+ outputs = model(**inputs)
41
+ prediction = torch.argmax(outputs.logits).item()
42
 
43
+ print("Positive" if prediction == 1 else "Negative")