|
--- |
|
license: mit |
|
base_model: |
|
- cahya/distilbert-base-indonesian |
|
language: |
|
- id |
|
--- |
|
|
|
# Fine-Tuned DistilBERT Indonesia base model |
|
|
|
## Model Description |
|
This model is fine-tuned model version of the [Distilbert base Indonesian] (https://huggingface.co/cahya/distilbert-base-indonesian) |
|
|
|
This model is trained from a dataset of 10,000 review data on Tokopedia and Shopee on Google Playstore in Indonesian. |
|
|
|
## Intended uses & limitations |
|
|
|
### How to use |
|
You can use this model with the following steps: |
|
```python |
|
>>> from transformers import AutoModelForSequenceClassification, AutoTokenizer |
|
from transformers import AutoModelForSequenceClassification, AutoTokenizer |
|
|
|
model_name='rfahlevih/fine-tuned-cahya-distilbert-base-indonesia-reviews' |
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
model = AutoModelForSequenceClassification.from_pretrained(model_name) |
|
text = "Isi dengan sentimen apa saja." |
|
|
|
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True) |
|
outputs = model(**inputs) |
|
logits = outputs.logits |
|
predicted_class = logits.argmax(dim=-1).item() |
|
|
|
sentiment = "Negative" if predicted_class == 0 else "Positive" |
|
|
|
print(f"Predicted class: {predicted_class} - Sentimen: {sentiment}") |
|
``` |