Instructions to use ytu-ce-cosmos/modernbert-tr-absa-polarity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ytu-ce-cosmos/modernbert-tr-absa-polarity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ytu-ce-cosmos/modernbert-tr-absa-polarity")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ytu-ce-cosmos/modernbert-tr-absa-polarity") model = AutoModelForSequenceClassification.from_pretrained("ytu-ce-cosmos/modernbert-tr-absa-polarity", device_map="auto") - encoderfile
How to use ytu-ce-cosmos/modernbert-tr-absa-polarity with encoderfile:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
ModernBERT-TR Aspect Polarity
A 150M-parameter Turkish classifier that receives a sentence and an aspect, then predicts negative, neutral, or positive sentiment toward that aspect.
Results
Our model scores 72.74 +/- 2.10% macro-F1 on the ABSA-TR test set. The released checkpoint scores 72.87%.
The quantized int8 version scores 71.89% on ABSA-TR test set.
Usage
from transformers import pipeline
classify = pipeline(
"text-classification",
model="ytu-ce-cosmos/modernbert-tr-absa-polarity",
)
classify({"text": "Kargo hızlıydı ama ürün kötüydü.", "text_pair": "ürün"})
Training
We finetune ytu-ce-cosmos/modernbert-tr-base with mean pooling and a three-label head using translated M-ABSA pairs, 11,470 native Turkish clothing-review rows, and 17,186 usable pairs from teacher-labeled Turkish reviews. We use learning rate 3e-5, batch size 32, 15 epochs, linear warmup and decay, weight decay 0.01, label smoothing 0.1, and five seeds.
Standalone binaries are available in the encoderfile repo.
License
Apache-2.0.
- Downloads last month
- 46