Downloads · 30 days
1.1K
0% of all-time downloads
ml6team/bert-base-uncased-city-country-ner
bert-base-uncased-city-country-ner is a token classification model from ml6team. Use it when you need labels on individual words, such as names. It is set up for transformers.
A bert-base-uncased model finetuned on a custom dataset to detect Country and City names from a given sentence.
Downloads · 30 days
1.1K
0% of all-time downloads
All-time downloads
287K
Public
Repo size
2.2 GB
Likes
16
Public
Click a slice to open those files.
.h5436 MB · 50%
From the Hugging Face model README
A bert-base-uncased model finetuned on a custom dataset to detect Country and City names from a given sentence.
We weakly supervised the Ultra-Fine Entity Typing dataset to include the City and Country information. We also did some extra preprocessing to remove false labels.
The model predicts 3 different tags: OTHER, CITY and COUNTRY
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("ml6team/bert-base-uncased-city-country-ner")
model = AutoModelForTokenClassification.from_pretrained("ml6team/bert-base-uncased-city-country-ner")
from transformers import pipeline
nlp = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="simple")
nlp("My name is Kermit and I live in London.")