I tried the getting started colab demo notebook, but the person entities were not detected.
Marius Petipa & Charles Nodier => person
from gliner import GLiNER
model = GLiNER.from_pretrained("urchade/gliner_mediumv2.1")
model.eval()
text = """
Libretto by Marius Petipa, based on the 1822 novella ``Trilby, ou Le Lutin d'Argail`` by Charles Nodier, first presented by the Ballet of the Moscow Imperial Bolshoi Theatre on January 25/February 6 (Julian/Gregorian calendar dates), 1870, in Moscow with Polina Karpakova as Trilby and Ludiia Geiten as Miranda and restaged by Petipa for the Imperial Ballet at the Imperial Bolshoi Kamenny Theatre on January 17–29, 1871 in St. Petersburg with Adèle Grantzow as Trilby and Lev Ivanov as Count Leopold.
"""
labels = ["person", "book", "location", "date", "actor", "character"]
entities = model.predict_entities(text, labels, threshold=0.4)
for entity in entities:
print(entity["text"], "=>", entity["label"])
==============================
Trilby => character
Moscow => location
January 25/February 6 => date
1870 => date
Moscow => location
Polina Karpakova => actor
Trilby => character
Ludiia Geiten => actor
Miranda => character
January 17–29, 1871 => date
St. Petersburg => location
Adèle Grantzow => actor
Trilby => character
Lev Ivanov => actor
Count Leopold => character
Name: gliner Version: 0.1.13
I tried the getting started colab demo notebook, but the person entities were not detected. Marius Petipa & Charles Nodier => person