JiaqiLee commited on
Commit
a0d3e85
·
1 Parent(s): 77a648f

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +35 -0
README.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: openrail
3
+ datasets:
4
+ - imdb
5
+ language:
6
+ - en
7
+ metrics:
8
+ - accuracy
9
+ library_name: transformers
10
+ pipeline_tag: text-classification
11
+ ---
12
+
13
+ ## Model description
14
+ This model is a fine-tuned version of the [bert-base-uncased](https://huggingface.co/transformers/model_doc/bert.html) model to classify the sentiment of movie reviews into one of two
15
+ categories: negative(label 0), positive(label 1).
16
+
17
+ ## How to use
18
+
19
+ You can use the model with the following code.
20
+
21
+ ```python
22
+ from transformers import BertForSequenceClassification, BertTokenizer, TextClassificationPipeline
23
+ model_path = "JiaqiLee/imdb-finetuned-bert-base-uncased"
24
+ tokenizer = BertTokenizer.from_pretrained(model_path)
25
+ model = BertForSequenceClassification.from_pretrained(model_path, num_labels=2)
26
+ pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
27
+ print(pipeline("The movie depicted well the psychological battles that Harry Vardon fought within himself, from his childhood trauma of being evicted to his own inability to break that glass ceiling that prevents him from being accepted as an equal in English golf society."))
28
+ ```
29
+
30
+ ## Training data
31
+ The training data comes HuggingFace [IMDB dataset](https://huggingface.co/datasets/imdb). We use 90% of the `train.csv` data to train the model and the remaining 10% for evaluation.
32
+
33
+ ## Evaluation results
34
+
35
+ The model achieves 0.91 classification accuracy in IMDB test dataset.