Add README.md template
Browse files
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: google-bert/bert-base-uncased
|
| 4 |
+
tags:
|
| 5 |
+
- text-classification
|
| 6 |
+
- text-classification
|
| 7 |
+
- sst2
|
| 8 |
+
- fine-tuned
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
datasets:
|
| 12 |
+
- sst2
|
| 13 |
+
pipeline_tag: text-classification
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# bert-medium-tiny
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
|
| 20 |
+
Fine-tuned BERT model for sentiment classification on SST-2 dataset
|
| 21 |
+
|
| 22 |
+
## Base Model
|
| 23 |
+
- **Base Model**: [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased)
|
| 24 |
+
- **Task**: text-classification
|
| 25 |
+
- **Dataset**: sst2
|
| 26 |
+
|
| 27 |
+
## Usage
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 31 |
+
import torch
|
| 32 |
+
|
| 33 |
+
tokenizer = AutoTokenizer.from_pretrained("takedarn/bert-medium-tiny")
|
| 34 |
+
model = AutoModelForSequenceClassification.from_pretrained("takedarn/bert-medium-tiny")
|
| 35 |
+
|
| 36 |
+
text = "This movie is great!"
|
| 37 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|
| 38 |
+
|
| 39 |
+
with torch.no_grad():
|
| 40 |
+
outputs = model(**inputs)
|
| 41 |
+
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
| 42 |
+
predicted_class = torch.argmax(predictions, dim=-1)
|
| 43 |
+
|
| 44 |
+
print(f"Predicted class: {predicted_class.item()}")
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Training Details
|
| 48 |
+
|
| 49 |
+
This model was fine-tuned using the following configuration:
|
| 50 |
+
- Task: text-classification
|
| 51 |
+
- Dataset: sst2
|
| 52 |
+
- Base model: google-bert/bert-base-uncased
|
| 53 |
+
|
| 54 |
+
## Citation
|
| 55 |
+
|
| 56 |
+
If you use this model, please cite:
|
| 57 |
+
|
| 58 |
+
```bibtex
|
| 59 |
+
@misc{bert_medium_tiny,
|
| 60 |
+
author = {Your Name},
|
| 61 |
+
title = {bert-medium-tiny},
|
| 62 |
+
year = {2025},
|
| 63 |
+
publisher = {Hugging Face},
|
| 64 |
+
url = {https://huggingface.co/takedarn/bert-medium-tiny}
|
| 65 |
+
}
|
| 66 |
+
```
|