Instructions to use ytu-ce-cosmos/modernbert-tr-absa-extraction 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-extraction with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="ytu-ce-cosmos/modernbert-tr-absa-extraction")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("ytu-ce-cosmos/modernbert-tr-absa-extraction") model = AutoModelForTokenClassification.from_pretrained("ytu-ce-cosmos/modernbert-tr-absa-extraction", device_map="auto") - encoderfile
How to use ytu-ce-cosmos/modernbert-tr-absa-extraction 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 Extraction
A 150M-parameter Turkish token classifier that extracts opinion targets with O, B-ASP, and I-ASP labels.
Results
Our model scores 64.09 +/- 0.30% exact entity-span F1 on the ABSA-TR test set. The released checkpoint scores 69.46% on the translated M-ABSA Turkish test set.
The quantized int8 version scores 61.30% on ABSA-TR test set.
Usage
from transformers import pipeline
extract = pipeline(
"token-classification",
model="ytu-ce-cosmos/modernbert-tr-absa-extraction",
aggregation_strategy="first",
)
extract("Kargo hızlıydı ama ürün kötüydü.")
You can call the tokenizer with is_split_into_words=True to allow the tokenizer to split the sentence into words, and keep the first WordPiece label for each word.
Training
We finetune ytu-ce-cosmos/modernbert-tr-base using about 8.7k translated M-ABSA records and 11,993 teacher-labeled data points. We use learning rate 4e-5, batch size 32, 15 epochs, linear warmup and decay, no weight decay, and first-subword alignment.
Standalone binaries are available in the encoderfile repo.
License
Apache-2.0.
- Downloads last month
- 57