Model setup recipes
Last updated
Extract fields from English text with GLiNER2.5
Extract predefined fields from English inquiries and save them with the source.
GLiNER2.5 takes a sentence and the names of the items to find, then returns those items with spans from the original text. This example extracts a product name, error code, and issue description from English support text and saves them as a JSON record.
Extract structured data instead of generating prose
GLiNER2.5 is an information extraction model. It takes a sentence and the names of the items to find, then returns those items with their spans in the original text. This example extracts a product name, error code, and issue description from English support text and saves them as a JSON record.
The official repository presents fastino/gliner2.5-base-v1 as its recommended English checkpoint1 and documents pip install "gliner2[local]". Do not assume equivalent quality on Korean text; validate on English samples first.

Start with a small schema
Choose one document type, define entity names and relation direction, then load the model with AutoExtractor.from_pretrained("fastino/gliner2.5-base-v1") and supply the field, relation, and attribute schema.
Save the Python code below as extract.py. It stores source_id, original text, and the model response in one file so reviewers can compare output with its source.
import json
from gliner2 import AutoExtractor
model = AutoExtractor.from_pretrained("fastino/gliner2.5-base-v1")
source_id = "ticket-001"
text = "The Atlas 14 laptop stopped charging with error E-204 after the March update."
schema = {"product": [
"name::str::Product name and model",
"error_code::str::Error code mentioned in the report",
"issue::str::What went wrong",
]}
result = model.extract_json(text, schema)
record = {"source_id": source_id, "text": text, "extraction": result}
with open("extraction.json", "w", encoding="utf-8") as f:
json.dump(record, f, ensure_ascii=False, indent=2)
print(json.dumps(record, ensure_ascii=False, indent=2))python -m venv .venv
source .venv/bin/activate
python -m pip install -U "gliner2[local]"python extract.py
Audit results by field
Prepare 100 human-labeled sentences and measure entity-span precision/recall, relation precision/recall, and JSON parse success separately. A single aggregate score can hide fields that are often missed or linked incorrectly.
Record correction time and the downstream cost of incorrect relations. If documents are not English or contain complex layouts, first verify that OCR2 output matches the model's text-input assumptions.
If you must preserve table structure or convert a whole document at once, compare a document parser before an entity-extraction model. This guide only finds the fields you define, so cells and reading order still need separate checks.

Terminology notes
Checkpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.
Back to the textOCR — The process of recognizing characters in images or scanned documents and turning them into text. Table layout and reading order still need the original image to verify.
Back to the text
Frequently asked questions
- What should you check first in this article?
- GLiNER2.5 takes a sentence and the names of the items to find, then returns those items with spans from the original text. This example extracts a product name, error code, and issue description from English support text and saves them as a JSON record.
Read next
Model setup recipes
Which embedding model should you use for Korean document search? Qwen3, BGE, and EmbeddingGemma 2
read first
Local RAG Setup Guide: Build an AI That Answers from Your Documents
Model setup recipes
When OpenRouter Is Unavailable, How Do You Switch Your App to a Local LLM?
Model setup recipes
How to run Nemotron Bolt on an RTX 3090 or 5090
