Token Classification
GLiNER
PyTorch
English
entity recognition
NER
named entity recognition
zero shot
zero-shot
Instructions to use numind/NuNER_Zero-4k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER
How to use numind/NuNER_Zero-4k with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("numind/NuNER_Zero-4k") text = "Cristiano Ronaldo dos Santos Aveiro was born on 5 February 1985 in Funchal, Madeira, Portugal." labels = ["person", "date", "location"] entities = model.predict_entities(text, labels) for entity in entities: print(entity["text"], "=>", entity["label"]) - Notebooks
- Google Colab
- Kaggle
Getting error for tokenizer add_prefix_space = True
#2
by Hitish9 - opened
i am getting to change this variable in tokenizer
AssertionError: You need to instantiate LongformerTokenizerFast with add_prefix_space=True to use it with pretokenized inputs.
when i am using 4k model for inference.
same
Ihor Stepanov helped me with answer
You can use:
from gliner import GLiNER
model = GLiNER.from_pretrained("numind/NuNER_Zero-4k")
model.data_processor.transformer_tokenizer.add_prefix_space=True
What about the quality? I tried and see that it goes in wrong direction!
I have not tried it much. you can also increase context window size of NunerZeroshot by increase max_len value in model config