Downloads · 30 days
23
43% of all-time downloads
erythropygia/bert-turkish-subject
bert-turkish-subject 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 subject detect on <bTurkish texts</b. It gives sevent outputs:
Downloads · 30 days
23
43% of all-time downloads
All-time downloads
54
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 subject detect on <b>Turkish texts</b>. It gives sevent outputs:
import torch
from transformers import AutoModelForSequenceClassification AutoTokenizer, AutoConfig, pipeline
config_subject = AutoConfig.from_pretrained("erythropygia/bert-turkish-subject")
model_subject = AutoModelForSequenceClassification.from_pretrained('erythropygia/bert-turkish-subject', config=config_subject)
tokenizer_subject = AutoTokenizer.from_pretrained("erythropygia/bert-turkish-subject")
device = torch.device('cpu') #or 'cuda'
subject_pipeline = pipeline(
task='text-classification',
model=model_subject,
tokenizer=tokenizer_subject,
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."
subject_result = subject_pipeline(input)
print(subject_result)