dina1 commited on
Commit
64af738
·
verified ·
1 Parent(s): a537908

Add README with model description

Browse files
Files changed (1) hide show
  1. README.md +35 -0
README.md CHANGED
@@ -1,15 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # BERT IMDB Sentiment Classifier
2
 
3
  This model is a fine-tuned version of `bert-base-uncased` on the IMDB movie reviews dataset.
4
 
5
  ## Task
 
6
  Binary Sentiment Classification:
7
  - `0` → Negative
8
  - `1` → Positive
9
 
10
  ## Usage
 
11
  ```python
12
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
13
 
14
  model = AutoModelForSequenceClassification.from_pretrained("dina1/bert-imdb-sentiment")
15
  tokenizer = AutoTokenizer.from_pretrained("dina1/bert-imdb-sentiment")
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ datasets:
4
+ - imdb
5
+ metrics:
6
+ - accuracy
7
+ model-index:
8
+ - name: BERT IMDB Sentiment Classifier
9
+ results:
10
+ - task:
11
+ type: text-classification
12
+ name: Sentiment Analysis
13
+ dataset:
14
+ name: IMDB
15
+ type: imdb
16
+ metrics:
17
+ - type: accuracy
18
+ value: 0.93
19
+ tags:
20
+ - sentiment
21
+ - imdb
22
+ - text-classification
23
+ - bert
24
+ license: apache-2.0
25
+ ---
26
+
27
  # BERT IMDB Sentiment Classifier
28
 
29
  This model is a fine-tuned version of `bert-base-uncased` on the IMDB movie reviews dataset.
30
 
31
  ## Task
32
+
33
  Binary Sentiment Classification:
34
  - `0` → Negative
35
  - `1` → Positive
36
 
37
  ## Usage
38
+
39
  ```python
40
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
41
 
42
  model = AutoModelForSequenceClassification.from_pretrained("dina1/bert-imdb-sentiment")
43
  tokenizer = AutoTokenizer.from_pretrained("dina1/bert-imdb-sentiment")
44
+
45
+ text = "This movie was absolutely wonderful!"
46
+ inputs = tokenizer(text, return_tensors="pt", truncation=True)
47
+ outputs = model(**inputs)
48
+
49
+ predicted_class = outputs.logits.argmax().item()
50
+ print("Predicted Sentiment:", predicted_class)