ceilf6 commited on
Commit
dc3c6be
·
verified ·
1 Parent(s): 3f4dd65

Upload high-accuracy IMDB sentiment RoBERTa artifacts

Browse files
Files changed (7) hide show
  1. README.md +43 -0
  2. config.json +30 -0
  3. metrics.json +43 -0
  4. model.safetensors +3 -0
  5. predictions.csv +0 -0
  6. tokenizer.json +0 -0
  7. tokenizer_config.json +17 -0
README.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ tags:
6
+ - sentiment-analysis
7
+ - imdb
8
+ - roberta
9
+ - text-classification
10
+ pipeline_tag: text-classification
11
+ base_model: textattack/roberta-base-imdb
12
+ ---
13
+
14
+ # IMDB Sentiment RoBERTa
15
+
16
+ This repository contains a high-accuracy IMDB sentiment classifier for the 2026 machine learning course task.
17
+
18
+ The model is based on `textattack/roberta-base-imdb`, a RoBERTa sequence-classification model fine-tuned for IMDB sentiment analysis.
19
+
20
+ ## Evaluation
21
+
22
+ - Dataset: `imdb_top_500.csv`
23
+ - Accuracy: 98.40%
24
+ - Correct: 492 / 500
25
+ - Required minimum accuracy: 0.92
26
+ - Labels: `0 = negative`, `1 = positive`
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ from transformers import pipeline
32
+
33
+ classifier = pipeline(
34
+ "sentiment-analysis",
35
+ model="ceilf6/imdb-sentiment-roberta",
36
+ tokenizer="ceilf6/imdb-sentiment-roberta",
37
+ )
38
+ print(classifier("This movie is great and deeply moving."))
39
+ ```
40
+
41
+ ## CI/CD
42
+
43
+ GitHub Actions evaluates the model and uploads this repository only when accuracy is at least `0.92`.
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "RobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": 2,
11
+ "finetuning_task": "imdb",
12
+ "gradient_checkpointing": false,
13
+ "hidden_act": "gelu",
14
+ "hidden_dropout_prob": 0.1,
15
+ "hidden_size": 768,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 3072,
18
+ "is_decoder": false,
19
+ "layer_norm_eps": 1e-05,
20
+ "max_position_embeddings": 514,
21
+ "model_type": "roberta",
22
+ "num_attention_heads": 12,
23
+ "num_hidden_layers": 12,
24
+ "pad_token_id": 1,
25
+ "tie_word_embeddings": true,
26
+ "transformers_version": "5.8.1",
27
+ "type_vocab_size": 1,
28
+ "use_cache": true,
29
+ "vocab_size": 50265
30
+ }
metrics.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "repo_id": "ceilf6/imdb-sentiment-roberta",
3
+ "source_model_id": "textattack/roberta-base-imdb",
4
+ "generated_at": "2026-05-15T13:45:52.977900+00:00",
5
+ "dataset": "data/imdb_top_500.csv",
6
+ "total": 500,
7
+ "correct": 492,
8
+ "accuracy": 0.984,
9
+ "min_accuracy": 0.92,
10
+ "max_length": 512,
11
+ "batch_size": 8,
12
+ "label_mapping": {
13
+ "0": "LABEL_0",
14
+ "1": "LABEL_1"
15
+ },
16
+ "classification_report": {
17
+ "negative": {
18
+ "precision": 0.984,
19
+ "recall": 0.984,
20
+ "f1-score": 0.984,
21
+ "support": 250.0
22
+ },
23
+ "positive": {
24
+ "precision": 0.984,
25
+ "recall": 0.984,
26
+ "f1-score": 0.984,
27
+ "support": 250.0
28
+ },
29
+ "accuracy": 0.984,
30
+ "macro avg": {
31
+ "precision": 0.984,
32
+ "recall": 0.984,
33
+ "f1-score": 0.984,
34
+ "support": 500.0
35
+ },
36
+ "weighted avg": {
37
+ "precision": 0.984,
38
+ "recall": 0.984,
39
+ "f1-score": 0.984,
40
+ "support": 500.0
41
+ }
42
+ }
43
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:982b2f974f44c79dda9a108633cc225cc081b6e2dbc1364bbcfe37a7708cafd4
3
+ size 498612824
predictions.csv ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "errors": "replace",
8
+ "is_local": false,
9
+ "local_files_only": false,
10
+ "mask_token": "<mask>",
11
+ "model_max_length": 512,
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "tokenizer_class": "RobertaTokenizer",
15
+ "trim_offsets": true,
16
+ "unk_token": "<unk>"
17
+ }