This model performs sentiment analysis on Turkish texts. It gives two outputs, Positive and Negative.
The model usage is as follows:
import torch
from transformers import AutoModelForSequenceClassification AutoTokenizer, AutoConfig, pipeline
config_sentiment = AutoConfig.from_pretrained("erythropygia/bert-turkish-sentiment-analysis")
model_sentiment = AutoModelForSequenceClassification.from_pretrained("erythropygia/bert-turkish-sentiment-analysis", config=config_sentiment)
tokenizer_sentiment = AutoTokenizer.from_pretrained("erythropygia/bert-turkish-sentiment-analysis")
device = torch.device('cpu') #or 'cuda'
sentiment_pipeline = pipeline(
task='text-classification',
model=model_sentiment,
tokenizer=tokenizer_sentiment,
framework='pt',
#device=device
)
input = "Ulus devlet kavramı, 18. yüzyılda aydınlanma düşüncesinin etkisiyle daha da yaygınlaşmış ve 19. yüzyılda Avrupa'da birçok ulus devlet kurulmuştur.
Örneğin, Almanya ve İtalya, 1871'de modern anlamda ulus devletler haline gelmiştir.
Dünya genelinde ulus devletlerin yaygınlaşması 20. yüzyılın başlarına kadar devam etmiştir.
Bugün, dünya genelinde birçok ulus devlet bulunmaktadır ve bu devletler, çoğunlukla belirli bir ulusun siyasi sınırlar içinde örgütlenmesini temsil etmektedir."
sentiment_result = sentiment_pipeline(input)
print(sentiment_result)
- Downloads last month
- 252
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.