Downloads · 30 days
14
23% of all-time downloads
erythropygia/bert-turkish-sentiment-analysis
bert-turkish-sentiment-analysis is a text classification model from erythropygia. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model performs sentiment analysis on <bTurkish texts</b. It gives two outputs, Positive and Negative.
Downloads · 30 days
14
23% of all-time downloads
All-time downloads
62
Public
Repo size
885 MB
Likes
0
Public
Click a slice to open those files.
.bin443 MB · 100%
From the Hugging Face model README
This model performs sentiment analysis on <b>Turkish texts</b>. 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)