Instructions to use erythropygia/bert-turkish-entityrecognition with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erythropygia/bert-turkish-entityrecognition with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="erythropygia/bert-turkish-entityrecognition")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("erythropygia/bert-turkish-entityrecognition") model = AutoModelForTokenClassification.from_pretrained("erythropygia/bert-turkish-entityrecognition") - Notebooks
- Google Colab
- Kaggle
This model detects name-entity on Turkish texts. It tags the words Person, Location, Organization.
The model usage is as follows:
import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer, AutoConfig, pipeline
config_ner = AutoConfig.from_pretrained("erythropygia/bert-turkish-entityrecognition")
model_ner = AutoModelForTokenClassification.from_pretrained("erythropygia/bert-turkish-entityrecognition",config=config_ner)
tokenizer_ner= AutoTokenizer.from_pretrained("erythropygia/bert-turkish-entityrecognition")
device = torch.device('cpu') #or 'cuda'
ner_pipeline = pipeline(
task='ner',
model=model_ner,
tokenizer=tokenizer_ner,
framework='pt',
#device=device
)
input = "Bugün Fenerbahçe maçına gideceğim. Maçtan sonra Mehmet Yıldırım'la Bostancıda buluşacağım"
ner_result = ner_pipeline(input)
print(ner_result)
- Downloads last month
- 1