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
File size: 2,191 Bytes
b63c1c4 203d2d5 b63c1c4 51f9232 203d2d5 | 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | ---
language: en
license: apache-2.0
tags:
- sentiment-analysis
- text-classification
- transformers
- distilbert
datasets:
- imdb
metrics:
- accuracy
model-index:
- name: DistilBERT IMDb Sentiment Classifier
results:
- task:
name: Sentiment Analysis
type: text-classification
dataset:
name: IMDb
type: imdb
metrics:
- name: Accuracy
type: accuracy
value: 0.88 # You can update this later
---
# ๐ง Sentiment Analysis Model โ DistilBERT Fine-Tuned on IMDb ๐ฌ
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.
## ๐ Intended Use
This model is designed to classify movie reviews (or other English text) as **positive** or **negative** sentiment. It's ideal for:
- Opinion mining
- Social media analysis
- Review classification
- Text classification demos
## ๐งช Example Usage
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "bmdavis/my-language-model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "This movie was amazing and really well-acted!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits).item()
print("Sentiment:", "Positive" if prediction == 1 else "Negative")
๐ Dataset
IMDb Dataset
25,000 training samples
25,000 test samples
Labels: 0 = Negative, 1 = Positive
๐ง Model Details
Base Model: distilbert-base-uncased
Architecture: Transformer (BERT-like)
Framework: PyTorch
Tokenizer: WordPiece
๐ ๏ธ Training
Epochs: 3
Batch Size: 8
Optimizer: AdamW
Loss: CrossEntropy
Trainer API used
๐ License
This model is released under the Apache 2.0 license.
โ๏ธ Author
Created by Brody Davis (@bmdavis)
Trained and uploaded using Hugging Face Hub and Transformers
|