Text Classification
Transformers
Safetensors
English
distilbert
sentiment-analysis
Eval Results (legacy)
text-embeddings-inference
Instructions to use bmdavis/my-language-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bmdavis/my-language-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="bmdavis/my-language-model")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("bmdavis/my-language-model") model = AutoModelForSequenceClassification.from_pretrained("bmdavis/my-language-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
| 1 |
# π§ Sentiment Analysis Model β DistilBERT Fine-Tuned on IMDb π¬
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
This model is a fine-tuned version of [`distilbert-base-uncased`](https://huggingface.co/distilbert-base-uncased) on the [IMDb movie review dataset](https://huggingface.co/datasets/imdb) for **binary sentiment classification** (positive/negative). It was trained using Hugging Face Transformers and PyTorch.
|
| 4 |
|
| 5 |
## π Intended Use
|
|
@@ -26,3 +50,39 @@ outputs = model(**inputs)
|
|
| 26 |
prediction = torch.argmax(outputs.logits).item()
|
| 27 |
|
| 28 |
print("Sentiment:", "Positive" if prediction == 1 else "Negative")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# π§ Sentiment Analysis Model β DistilBERT Fine-Tuned on IMDb π¬
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- sentiment-analysis
|
| 6 |
+
- text-classification
|
| 7 |
+
- transformers
|
| 8 |
+
- distilbert
|
| 9 |
+
datasets:
|
| 10 |
+
- imdb
|
| 11 |
+
metrics:
|
| 12 |
+
- accuracy
|
| 13 |
+
model-index:
|
| 14 |
+
- name: DistilBERT IMDb Sentiment Classifier
|
| 15 |
+
results:
|
| 16 |
+
- task:
|
| 17 |
+
name: Sentiment Analysis
|
| 18 |
+
type: text-classification
|
| 19 |
+
dataset:
|
| 20 |
+
name: IMDb
|
| 21 |
+
type: imdb
|
| 22 |
+
metrics:
|
| 23 |
+
- name: Accuracy
|
| 24 |
+
type: accuracy
|
| 25 |
+
value: 0.88 # You can update this with your actual score later
|
| 26 |
+
|
| 27 |
This model is a fine-tuned version of [`distilbert-base-uncased`](https://huggingface.co/distilbert-base-uncased) on the [IMDb movie review dataset](https://huggingface.co/datasets/imdb) for **binary sentiment classification** (positive/negative). It was trained using Hugging Face Transformers and PyTorch.
|
| 28 |
|
| 29 |
## π Intended Use
|
|
|
|
| 50 |
prediction = torch.argmax(outputs.logits).item()
|
| 51 |
|
| 52 |
print("Sentiment:", "Positive" if prediction == 1 else "Negative")
|
| 53 |
+
|
| 54 |
+
π Dataset
|
| 55 |
+
IMDb Dataset
|
| 56 |
+
|
| 57 |
+
25,000 training samples
|
| 58 |
+
|
| 59 |
+
25,000 test samples
|
| 60 |
+
|
| 61 |
+
Labels: 0 = Negative, 1 = Positive
|
| 62 |
+
|
| 63 |
+
π§ Model Details
|
| 64 |
+
Base Model: distilbert-base-uncased
|
| 65 |
+
|
| 66 |
+
Architecture: Transformer (BERT-like)
|
| 67 |
+
|
| 68 |
+
Framework: PyTorch
|
| 69 |
+
|
| 70 |
+
Tokenizer: WordPiece
|
| 71 |
+
|
| 72 |
+
π οΈ Training
|
| 73 |
+
Epochs: 3
|
| 74 |
+
|
| 75 |
+
Batch Size: 8
|
| 76 |
+
|
| 77 |
+
Optimizer: AdamW
|
| 78 |
+
|
| 79 |
+
Loss: CrossEntropy
|
| 80 |
+
|
| 81 |
+
Trainer API used
|
| 82 |
+
|
| 83 |
+
π License
|
| 84 |
+
This model is released under the Apache 2.0 license.
|
| 85 |
+
|
| 86 |
+
βοΈ Author
|
| 87 |
+
Created by Brody Davis (@bmdavis)
|
| 88 |
+
Trained and uploaded using Hugging Face Hub and Transformers
|