π A new commercially permissible multilingual version is available urchade/gliner_multiv2.1
π A subtle bug that causes performance degradation on some models has been corrected. Thanks to @yyDing1 for raising the issue.
from gliner import GLiNER
# Initialize GLiNER
model = GLiNER.from_pretrained("urchade/gliner_multiv2.1")
text = "This is a text about Bill Gates and Microsoft."
# Labels for entity prediction
labels = ["person", "organization", "email"]
entities = model.predict_entities(text, labels, threshold=0.5)
for entity in entities:
print(entity["text"], "=>", entity["label"])