From 53f5ef6df5290b46a60cca9560379216b80c73ab Mon Sep 17 00:00:00 2001 From: Spencer Adams Date: Tue, 21 Apr 2020 14:31:36 -0500 Subject: [PATCH] create readme for spentaur/yelp model (#3874) * create readme for spentaur/yelp model * update spentaur/yelp/README.md * remove typo --- model_cards/spentaur/yelp/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 model_cards/spentaur/yelp/README.md diff --git a/model_cards/spentaur/yelp/README.md b/model_cards/spentaur/yelp/README.md new file mode 100644 index 00000000000..aaa4bf1f4c0 --- /dev/null +++ b/model_cards/spentaur/yelp/README.md @@ -0,0 +1,19 @@ +# DistilBERT Yelp Review Sentiment +This model is used for sentiment analysis on english yelp reviews. +It is a DistilBERT model trained on 1 million reviews from the yelp open dataset. +It is a regression model, with outputs in the range of ~-2 to ~2. With -2 being 1 star and 2 being 5 stars. +It was trained using the [ktrain](https://github.com/amaiya/ktrain) because of it's ease of use. + +Example use: + +``` +tokenizer = AutoTokenizer.from_pretrained( + 'distilbert-base-uncased', use_fast=True) +model = TFAutoModelForSequenceClassification.from_pretrained( + "spentaur/yelp") + +review = "This place is great!" +input_ids = tokenizer.encode(review, return_tensors='tf') +pred = model(input_ids)[0][0][0].numpy() +# pred should === 1.9562385 +```