From 66113bd62656070028eb44c87a0f8a25e5460e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sava=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Fri, 8 May 2020 01:31:22 +0300 Subject: [PATCH] Create README.md (#4202) --- .../README.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 model_cards/savasy/bert-base-turkish-sentiment-cased/README.md diff --git a/model_cards/savasy/bert-base-turkish-sentiment-cased/README.md b/model_cards/savasy/bert-base-turkish-sentiment-cased/README.md new file mode 100644 index 0000000000..a78f0d200b --- /dev/null +++ b/model_cards/savasy/bert-base-turkish-sentiment-cased/README.md @@ -0,0 +1,51 @@ +# Details + +https://huggingface.co/savasy/bert-base-turkish-sentiment-cased + +This model is used for Sentiment Analysis, which is based on BERTurk for Turkish Language https://huggingface.co/dbmdz/bert-base-turkish-cased + + +# Dataset + +We used product and movie dataset provided by the study [2] . This dataset includes +movie and product reviews. The products are book, DVD, electronics, and kitchen. +The movie dataset is taken from a cinema Web page (www.beyazperde.com) with +5331 positive and 5331 negative sentences. Reviews in the Web page are marked in +scale from 0 to 5 by the users who made the reviews. The study considered a review +sentiment positive if the rating is equal to or bigger than 4, and negative if it is less +or equal to 2. They also built Turkish product review dataset from an online retailer +Web page. They constructed benchmark dataset consisting of reviews regarding some +products (book, DVD, etc.). Likewise, reviews are marked in the range from 1 to 5, +and majority class of reviews are 5. Each category has 700 positive and 700 negative +reviews in which average rating of negative reviews is 2.27 and of positive reviews +is 4.5. + + +The dataset is used by following papers + + +* 1 Yildirim, Savaş. (2020). Comparing Deep Neural Networks to Traditional Models for Sentiment Analysis in Turkish Language. 10.1007/978-981-15-1216-2_12. +* 2 Demirtas, Erkin and Mykola Pechenizkiy. 2013. Cross-lingual polarity detection with machine translation. In Proceedings of the Second International Workshop on Issues of Sentiment +Discovery and Opinion Mining (WISDOM ’13) + +# Code Usage + +``` +from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline +model = AutoModelForSequenceClassification.from_pretrained("savasy/bert-base-turkish-sentiment-cased") +tokenizer = AutoTokenizer.from_pretrained("savasy/bert-base-turkish-sentiment-cased") +sa= pipeline("sentiment-analysis", tokenizer=tokenizer, model=model) + +p= sa("bu telefon modelleri çok kaliteli , her parçası çok özel bence") +print(p) +#[{'label': 'LABEL_1', 'score': 0.9871089}] +print (p[0]['label']=='LABEL_1') +#True + + +p= sa("Film çok kötü ve çok sahteydi") +print(p) +#[{'label': 'LABEL_0', 'score': 0.9975505}] +print (p[0]['label']=='LABEL_1') +#False +```