This model performs comment categories detect on Turkish texts. It gives sevent outputs:
- "0": "general_comment",
- "1": "store_comment",
- "2": "product_comment"
from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
config = AutoConfig.from_pretrained("erythropygia/distilbert-turkish-comment-analysis")
tokenizer = AutoTokenizer.from_pretrained("erythropygia/distilbert-turkish-comment-analysis", config=config)
model = AutoModelForSequenceClassification.from_pretrained("erythropygia/distilbert-turkish-comment-analysis", config=config)
text = "Bu mağazanın ürünleri çok kötü sakın buradan almayın"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
_, predicted = torch.max(outputs.logits, dim=1)
predicted_label = config.id2label[predicted.item()]
print(predicted_label)
#store_comment
- Downloads last month
- 32
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support