transformers pytorch rembert text-classification polarity polarity classification sentiment analysis kk dataset:issai/kazsandra license:cc-by-4.0 autotrain_compatible endpoints_compatible region:us
---
datasets:
- issai/kazsandra
language:
- kk
license: cc-by-4.0
metrics:
- f1
pipeline_tag: text-classification
tags:
- polarity
- polarity classification
- sentiment analysis
widget:
- text: Түк ұнаған жоқ.
  example_title: Negative
---
# Polarity Classification Model for Kazakh

<p align = "justify">
  This is a <a href = "https://huggingface.co/google/rembert">RemBERT</a> model fine-tuned for sentiment analysis on product reviews in Kazakh. 
  It predicts the polarity of a review as positive or negative.
  The model was fine-tuned on <a href = "https://huggingface.co/datasets/issai/kazsandra">KazSAnDRA</a>.
</p>

| Model | Accuracy | Precision | Recall | F1 |
| :---: | :---: | :---: | :---: | :---: |
RemBERT | 0.89 | 0.81 | 0.82 | 0.81

## How to use

<p align = "justify">You can use this model with the Transformers pipeline for text classification.</p>

```python
from transformers import AutoModelForSequenceClassification
from transformers import AutoTokenizer
from transformers import TextClassificationPipeline

model = AutoModelForSequenceClassification.from_pretrained("issai/rembert-sentiment-analysis-polarity-classification-kazakh")
tokenizer = AutoTokenizer.from_pretrained("issai/rembert-sentiment-analysis-polarity-classification-kazakh")

pipe = TextClassificationPipeline(model = model, tokenizer = tokenizer)

reviews = ["Бұл бейнефильм маған түк ұнамады.", "Осы кітап қызық сияқты."]

for review in reviews:
    print(pipe(review))
```