Run this model with HF Jobs
Run saribasmetehan/bert-base-turkish-sentiment-analysis on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/saribasmetehan/bert-base-turkish-sentiment-analysis. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/saribasmetehan/bert-base-turkish-sentiment-analysis on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use saribasmetehan/bert-base-turkish-sentiment-analysis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use saribasmetehan/bert-base-turkish-sentiment-analysis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="saribasmetehan/bert-base-turkish-sentiment-analysis")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis") model = AutoModelForSequenceClassification.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis", device_map="auto") - Notebooks
- Google Colab
- Kaggle
bert-base-turkish-sentiment-analysis
This model is a fine-tuned version of dbmdz/bert-base-turkish-cased on an winvoker/turkish-sentiment-analysis-dataset (The shuffle function was used with a training dataset of 10,000 data points and a test dataset of 2,000 points.). It achieves the following results on the evaluation set:
- Loss: 0.2458
- Accuracy: 0.962
Model description
Fine-Tuning Process : https://github.com/saribasmetehan/Transformers-Library/blob/main/Turkish_Text_Classifiaction_Fine_Tuning_PyTorch.ipynb
- "Positive" : LABEL_1
- "Notr" : LABEL_0
- "Negative" : LABEL_2
Example
from transformers import pipeline
text = "senden nefret ediyorum"
model_id = "saribasmetehan/bert-base-turkish-sentiment-analysis"
classifer = pipeline("text-classification",model = model_id)
preds= classifer(text)
print(preds)
#[{'label': 'LABEL_2', 'score': 0.7510055303573608}]
Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis")
model = AutoModelForSequenceClassification.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis")
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 4
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.1902 | 1.0 | 625 | 0.1629 | 0.9575 |
| 0.1064 | 2.0 | 1250 | 0.1790 | 0.96 |
| 0.0631 | 3.0 | 1875 | 0.2358 | 0.96 |
| 0.0146 | 4.0 | 2500 | 0.2458 | 0.962 |
Framework versions
- Transformers 4.40.2
- Pytorch 2.2.1+cu121
- Datasets 2.19.1
- Tokenizers 0.19.1 bunu düzenleyip tekrar atar mısın
- Downloads last month
- 85
Model tree for saribasmetehan/bert-base-turkish-sentiment-analysis
Base model
dbmdz/bert-base-turkish-cased