Views
No views yet
distilbert-base-uncased on the IMDb movie review dataset for binary sentiment classification (positive/negative). It was trained using Hugging Face Transformers and PyTorch.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "bmdavis/my-language-model"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
8text = "This movie was amazing and really well-acted!"
9inputs = tokenizer(text, return_tensors="pt")
10outputs = model(**inputs)
11prediction = torch.argmax(outputs.logits).item()
12
13print("Sentiment:", "Positive" if prediction == 1 else "Negative")
14
15📊 Dataset
16IMDb Dataset
17
1825,000 training samples
19
2025,000 test samples
21
22Labels: 0 = Negative, 1 = Positive
23
24🧠 Model Details
25Base Model: distilbert-base-uncased
26
27Architecture: Transformer (BERT-like)
28
29Framework: PyTorch
30
31Tokenizer: WordPiece
32
33🛠️ Training
34Epochs: 3
35
36Batch Size: 8
37
38Optimizer: AdamW
39
40Loss: CrossEntropy
41
42Trainer API used
43
44🔐 License
45This model is released under the Apache 2.0 license.
46
47✍️ Author
48Created by Brody Davis (@bmdavis)
49Trained and uploaded using Hugging Face Hub and Transformers