Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Text Classification Model
|
| 3 |
+
emoji: 🤗
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 3.14.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
tags:
|
| 11 |
+
- text-classification
|
| 12 |
+
- sentiment-analysis
|
| 13 |
+
- transformers
|
| 14 |
+
- distilbert
|
| 15 |
+
license: mit
|
| 16 |
+
language:
|
| 17 |
+
- en
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Text Classification Model
|
| 21 |
+
|
| 22 |
+
This model performs sentiment analysis using a pre-trained transformer model fine-tuned on a custom dataset.
|
| 23 |
+
|
| 24 |
+
## Features
|
| 25 |
+
- Sentiment analysis (positive/negative)
|
| 26 |
+
- Easy-to-use API
|
| 27 |
+
- Preprocessing included
|
| 28 |
+
- Configurable confidence threshold
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from text_classifier import TextClassifier
|
| 34 |
+
|
| 35 |
+
classifier = TextClassifier()
|
| 36 |
+
result = classifier.predict("This is a great product!")
|
| 37 |
+
print(result)
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## Model Details
|
| 41 |
+
- Architecture: DistilBERT
|
| 42 |
+
- Dataset: SST-2 (Stanford Sentiment Treebank)
|
| 43 |
+
- Accuracy: ~86% (on SST-2 test set)
|
| 44 |
+
|
| 45 |
+
## Hugging Face Space
|
| 46 |
+
|
| 47 |
+
This model can be deployed as a Hugging Face Space with a Gradio interface for easy interaction.
|
| 48 |
+
|
| 49 |
+
## Installation
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
pip install -r requirements.txt
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Local Testing
|
| 56 |
+
|
| 57 |
+
```bash
|
| 58 |
+
python test_model.py
|
| 59 |
+
```
|