knowledgator / gliner-bi-base-v1.0

huggingface.co
Total runs: 83
24-hour runs: 0
7-day runs: 25
30-day runs: 72
Model's Last Updated: August 25 2024
token-classification

Introduction of gliner-bi-base-v1.0

Model Details of gliner-bi-base-v1.0

About

GLiNER is a Named Entity Recognition (NER) model capable of identifying any entity type using a bidirectional transformer encoders (BERT-like). It provides a practical alternative to traditional NER models, which are limited to predefined entities, and Large Language Models (LLMs) that, despite their flexibility, are costly and large for resource-constrained scenarios.

This particular version utilize bi-encoder architecture, where textual encoder is DeBERTa v3 base and entity label encoder is sentence transformer - BGE-small-en .

Such architecture brings several advantages over uni-encoder GLiNER:

  • An unlimited amount of entities can be recognized at a single time;
  • Faster inference if entity embeddings are preprocessed;
  • Better generalization to unseen entities;

However, it has some drawbacks such as a lack of inter-label interactions that make it hard for the model to disambiguate semantically similar but contextually different entities.

Usage

Once you've downloaded the GLiNER library, you can import the GLiNER class. You can then load this model using GLiNER.from_pretrained and predict entities with predict_entities .

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner-bi-small-v1.0")

text = """
Cristiano Ronaldo dos Santos Aveiro (Portuguese pronunciation: [kɾiʃˈtjɐnu ʁɔˈnaldu]; born 5 February 1985) is a Portuguese professional footballer who plays as a forward for and captains both Saudi Pro League club Al Nassr and the Portugal national team. Widely regarded as one of the greatest players of all time, Ronaldo has won five Ballon d'Or awards,[note 3] a record three UEFA Men's Player of the Year Awards, and four European Golden Shoes, the most by a European player. He has won 33 trophies in his career, including seven league titles, five UEFA Champions Leagues, the UEFA European Championship and the UEFA Nations League. Ronaldo holds the records for most appearances (183), goals (140) and assists (42) in the Champions League, goals in the European Championship (14), international goals (128) and international appearances (205). He is one of the few players to have made over 1,200 professional career appearances, the most by an outfield player, and has scored over 850 official senior career goals for club and country, making him the top goalscorer of all time.
"""

labels = ["person", "award", "date", "competitions", "teams"]

entities = model.predict_entities(text, labels, threshold=0.3)

for entity in entities:
    print(entity["text"], "=>", entity["label"])
Cristiano Ronaldo dos Santos Aveiro => person
5 February 1985 => date
Al Nassr => teams
Portugal national team => teams
Ballon d'Or => award
UEFA Men's Player of the Year Awards => award
European Golden Shoes => award
UEFA Champions Leagues => competitions
UEFA European Championship => competitions
UEFA Nations League => competitions
Champions League => competitions
European Championship => competitions

If you have a large amount of entities and want to pre-embed them, please, refer to the following code snippet:

labels = ["your entities"]
texts = ["your texts"]

entity_embeddings = model.encode_labels(labels, batch_size = 8)

outputs = model.batch_predict_with_embeds([text], entity_embeddings, labels)
Benchmarks

Below you can see the table with benchmarking results on various named entity recognition datasets:

Dataset Score
ACE 2004 27.3%
ACE 2005 30.6%
AnatEM 31.8%
Broad Tweet Corpus 66.4%
CoNLL 2003 61.4%
FabNER 21.8%
FindVehicle 36.4%
GENIA_NER 52.6%
HarveyNER 11.4%
MultiNERD 60.9%
Ontonotes 26.5%
PolyglotNER 43.8%
TweetNER7 38.0%
WikiANN en 53.7%
WikiNeural 71.5%
bc2gm 59.4%
bc4chemd 50.4%
bc5cdr 68.4%
ncbi 65.6%
Average 46.2%
CrossNER_AI 48.4%
CrossNER_literature 61.9%
CrossNER_music 68.8%
CrossNER_politics 73.2%
CrossNER_science 63.2%
mit-movie 39.6%
mit-restaurant 39.0%
Average (zero-shot benchmark) 56.3%
Join Our Discord

Connect with our community on Discord for news, support, and discussion about our models. Join Discord .

Runs of knowledgator gliner-bi-base-v1.0 on huggingface.co

83
Total runs
0
24-hour runs
7
3-day runs
25
7-day runs
72
30-day runs

More Information About gliner-bi-base-v1.0 huggingface.co Model

More gliner-bi-base-v1.0 license Visit here:

https://choosealicense.com/licenses/apache-2.0

gliner-bi-base-v1.0 huggingface.co

gliner-bi-base-v1.0 huggingface.co is an AI model on huggingface.co that provides gliner-bi-base-v1.0's model effect (), which can be used instantly with this knowledgator gliner-bi-base-v1.0 model. huggingface.co supports a free trial of the gliner-bi-base-v1.0 model, and also provides paid use of the gliner-bi-base-v1.0. Support call gliner-bi-base-v1.0 model through api, including Node.js, Python, http.

gliner-bi-base-v1.0 huggingface.co Url

https://huggingface.co/knowledgator/gliner-bi-base-v1.0

knowledgator gliner-bi-base-v1.0 online free

gliner-bi-base-v1.0 huggingface.co is an online trial and call api platform, which integrates gliner-bi-base-v1.0's modeling effects, including api services, and provides a free online trial of gliner-bi-base-v1.0, you can try gliner-bi-base-v1.0 online for free by clicking the link below.

knowledgator gliner-bi-base-v1.0 online free url in huggingface.co:

https://huggingface.co/knowledgator/gliner-bi-base-v1.0

gliner-bi-base-v1.0 install

gliner-bi-base-v1.0 is an open source model from GitHub that offers a free installation service, and any user can find gliner-bi-base-v1.0 on GitHub to install. At the same time, huggingface.co provides the effect of gliner-bi-base-v1.0 install, users can directly use gliner-bi-base-v1.0 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gliner-bi-base-v1.0 install url in huggingface.co:

https://huggingface.co/knowledgator/gliner-bi-base-v1.0

Url of gliner-bi-base-v1.0

gliner-bi-base-v1.0 huggingface.co Url

Provider of gliner-bi-base-v1.0 huggingface.co

knowledgator
ORGANIZATIONS

Other API from knowledgator