File size: 1,921 Bytes
4cce243
 
 
 
 
 
 
 
 
 
 
 
2e964d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
license: apache-2.0
datasets:
- stanfordnlp/imdb
language:
- en
metrics:
- accuracy
- recall
- precision
base_model:
- google-bert/bert-base-uncased
---

# Fine-Tuned BERT for IMDB Sentiment Classification

![Hugging Face Model](https://huggingface.co/front/assets/huggingface_logo-noborder.svg)

## Model Description
This is a fine-tuned version of [BERT-Base-Uncased](https://huggingface.co/google-bert/bert-base-uncased) for binary sentiment classification on the [IMDB dataset](https://huggingface.co/datasets/stanfordnlp/imdb). The model is trained to classify movie reviews as either **positive** or **negative**.

## Model Details
- **Base Model**: [BERT-Base-Uncased](https://huggingface.co/google-bert/bert-base-uncased)
- **Dataset**: [IMDB Movie Reviews](https://huggingface.co/datasets/stanfordnlp/imdb)
- **Languages**: English (`en`)
- **Fine-tuning Epochs**: 3
- **Batch Size**: 8
- **Evaluation Metrics**: Accuracy, Precision, Recall
- **License**: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)

## Usage
### Load the Model
```python
from transformers import BertForSequenceClassification, BertTokenizer

model_name = "kparkhade/Fine-tuned-BERT-Imdb"

model = BertForSequenceClassification.from_pretrained(model_name)
tokenizer = BertTokenizer.from_pretrained(model_name)
```

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

sentiment_pipeline = pipeline("text-classification", model=model_name)
result = sentiment_pipeline("The movie was absolutely fantastic! I loved it.")
print(result)
```

## Citation
If you use this model, please cite:
@article{devlin2019bert,
  title={BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding},
  author={Devlin, Jacob and Chang, Ming-Wei and Lee, Kenton and Toutanova, Kristina},
  journal={arXiv preprint arXiv:1810.04805},
  year={2019}
}

## License
This model is released under the Apache 2.0 License.