Skip to main content

Quickstart

Welcome to the GLinker Framework Quickstart Guide! GLinker is a modular, production-ready entity linking framework that combines NER, multi-layer database search, and neural entity disambiguation.

Installation

To install GLinker, run the following command:

pip install git+https://github.com/Knowledgator/GLinker.git

Basic Usage

Here is a simple example using ProcessorFactory.create_simple to get started:

from glinker import ProcessorFactory

# Create a simple entity linking pipeline
executor = ProcessorFactory.create_simple(
model_name="knowledgator/gliner-bi-base-v2.0",
threshold=0.5,
entities=[
{"entity_id": "Q101", "label": "insulin", "description": "Peptide hormone regulating blood glucose"},
{"entity_id": "Q102", "label": "glucose", "description": "Primary blood sugar and key metabolic fuel"},
{"entity_id": "Q103", "label": "GLUT4", "description": "Insulin-responsive glucose transporter in muscle and adipose tissue"},
{"entity_id": "Q104", "label": "pancreatic beta cell", "description": "Endocrine cell type that secretes insulin"},
],
)

result = executor.execute({
"texts": [
"After a meal, pancreatic beta cells release insulin, which promotes GLUT4 translocation and increases glucose uptake in muscle."
]
})

l0_result = result.get("l0_result")
for entity in l0_result.entities:
if entity.linked_entity:
print(f"{entity.mention_text}{entity.linked_entity.label}")
print(f" Confidence: {entity.linked_entity.score:.3f}")
Expected Output
pancreatic beta cells → pancreatic beta cell
Confidence: 0.912
insulin → insulin
Confidence: 0.945
GLUT4 → GLUT4
Confidence: 0.938
glucose → glucose
Confidence: 0.887

Next Steps

  • Check out the Intro for an overview of the GLinker architecture
  • See the Installation guide for detailed setup instructions
  • Explore the Usage guide for advanced pipeline configurations
  • Browse the Configuration reference for YAML-based pipeline setup

Happy coding!