julien-c HF staff commited on
Commit
44060b3
1 Parent(s): 47e4237

Migrate model card from transformers-repo

Browse files

Read announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/spentaur/yelp/README.md

Files changed (1) hide show
  1. README.md +19 -0
README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DistilBERT Yelp Review Sentiment
2
+ This model is used for sentiment analysis on english yelp reviews.
3
+ It is a DistilBERT model trained on 1 million reviews from the yelp open dataset.
4
+ It is a regression model, with outputs in the range of ~-2 to ~2. With -2 being 1 star and 2 being 5 stars.
5
+ It was trained using the [ktrain](https://github.com/amaiya/ktrain) because of it's ease of use.
6
+
7
+ Example use:
8
+
9
+ ```
10
+ tokenizer = AutoTokenizer.from_pretrained(
11
+ 'distilbert-base-uncased', use_fast=True)
12
+ model = TFAutoModelForSequenceClassification.from_pretrained(
13
+ "spentaur/yelp")
14
+
15
+ review = "This place is great!"
16
+ input_ids = tokenizer.encode(review, return_tensors='tf')
17
+ pred = model(input_ids)[0][0][0].numpy()
18
+ # pred should === 1.9562385
19
+ ```