/ Модель

Характеристики

Контекст
262 144 токена
Лицензия
Apache 2.0
Базовая модель
gliformer-omni-2b-post
Библиотека
gliformer
Опубликована
12 ноя 2026

gliformer-2b-v1.5

Разметка токеновТекст → label12 профессий

GLiFormer 2B v1.5 — энкодер Knowledgator для извлечения сущностей, классификации и структурированных данных из текста.

71скачиваний за 30 дней12лайковвеса обновлены20 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

GLiFormer 2B v1.5 — модель семейства GLiFormer от Knowledgator для извлечения информации из текста. Она использует двунаправленный энкодер Qwen3.5-2B и специализированные головы задач. Основа содержит 2,21 млрд параметров, а полный чекпойнт с головами — 2,65 млрд; для работы предусмотрен фреймворк GLiFormer на PyTorch.

Модель предназначена для извлечения именованных сущностей, классификации текста, извлечения отношений и структурированных записей по заданной схеме, включая вложенные поля и вычисляемые значения. Также она поддерживает редактирование текста, текстовые эмбеддинги и выполнение нескольких задач за один проход. Метки, типы сущностей, отношения и схемы записей можно задавать во время инференса. В чекпойнте также есть головы классификации изображений и обнаружения объектов, но приведённые в карточке примеры и оценки относятся к текстовым задачам.

Карточка приводит оценки на наборах данных для NER, классификации и извлечения отношений; результаты зависят от набора и протокола оценки. В метаданных указан английский язык. Модель опубликована под лицензией Apache-2.0.

Сценарии применения

  • извлечение именованных сущностей с заданными типами
  • классификация обращений по теме и тональности
  • извлечение отношений между сущностями в документах
  • преобразование текста в записи по заданной схеме
  • извлечение дат и чисел с вычислением производных полей
  • создание текстовых эмбеддингов

Ограничения

Указанные примеры и результаты оценки относятся к текстовым задачам; наличие в чекпойнте голов для изображений не сопровождается здесь примерами или оценками. Качество зависит от задачи и набора данных, а сводные метрики рассчитаны по описанным в карточке протоколам.

Для каких профессий подходит12

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

GLiFormer 2B v1.5 - the most versatile system one model

The model supports many different tasks

What is GLiFormer

GLiFormer is a family of encoder models for information extraction. One shared encoder reads the text together with what to look for, and lightweight task heads produce the outputs: named entities, classes, relations, structured records (including categorical, number and date fields, nested records, and fields calculated from numbers in the text), text edits, and text embeddings. Entity types, class labels, relation types and record schemas are given at inference time, so no retraining is needed for new labels or schemas, and several tasks can run in one pass.

knowledgator/gliformer-2b-v1.5 uses the bidirectional Qwen3.5 encoder (Qwen/Qwen3.5-2B). The checkpoint also carries image classification and object detection heads; the usage examples and results below cover text tasks only.

Size: 2B refers to the backbone (2.21B parameters); with the task heads the checkpoint has 2.65B parameters in total.

Usage

pip install gliformer -U

Or install the GLiFormer framework in a Python 3.10+ environment from the source:

git clone https://github.com/Knowledgator/GLiFormer.git
cd GLiFormer
pip install -e .

The following examples reuse model:

import torch
from gliformer import GLiFormer

model = GLiFormer.from_pretrained(
    "knowledgator/gliformer-2b-v1.5",
    load_tokenizer=True,
)
model = model.to("cuda" if torch.cuda.is_available() else "cpu").eval()

For a local copy, replace the model ID with the checkpoint directory.

Named entity recognition

entities = model.predict_entities(
    "Alice works at Acme in London.",
    ["person", "organization", "location"],
    threshold=0.5,
)
for entity in entities:
    print(entity["text"], entity["label"], entity["score"])

Each entity includes text, label, start, end, and score. Offsets are character positions with an exclusive end. Pass a list of texts and batch_size=8 for batched extraction.

Text classification

predictions = model.classify(
    "The new search feature is fast and easy to use.",
    ["positive", "negative", "neutral"],
    threshold=0.5,
)
print(predictions)  # Label dictionaries containing class_name and score.

Named groups are also supported, for example {"sentiment": ["positive", "negative"], "topic": ["product", "support"]}.

Joint relation extraction

results = model.inference(
    "Alice works at Acme.",
    joint_relations={
        "employment": {
            "entities": ["person", "organization"],
            "relations": ["works_at"],
        }
    },
    threshold=0.5,
)
for relation in results["joint_relex"][0]:
    print(relation["head"]["text"], relation["relation"], relation["tail"]["text"])

Structured extraction

records = model.structure(
    "Alice works at Acme.",
    {"employee": ["name", "company"]},
)
print(records)
# {'employee': [{'name': 'Alice', 'company': 'Acme'}]}

Fields can be typed. A categorical field ("$type": "class") picks from the given $options instead of copying text from the input ("$multi": False keeps a single label); date and number fields return parsed values:

records = model.structure(
    "Ticket #4821: Maria Lopez reports that her laptop will not boot after the update. "
    "She needs it for a client demo tomorrow. Opened on March 3, 2025.",
    {"ticket": {
        "customer": {"$type": "text"},
        "category": {"$type": "class", "$options": ["hardware", "software", "billing", "account"], "$multi": False},
        "priority": {"$type": "class", "$options": ["low", "medium", "high"], "$multi": False},
        "opened": {"$type": "date"},
    }},
)
print(records)
# {'ticket': [{'customer': 'Maria Lopez', 'category': 'hardware', 'priority': ..., 'opened': datetime.date(2025, 3, 3)}]}

Without "$multi": False, a categorical field returns every option that applies, as a list.

Nested Pydantic schemas support multilevel records:

from pydantic import BaseModel

class Employee(BaseModel):
    name: str
    role: str

class Department(BaseModel):
    name: str
    employees: list[Employee]

class Company(BaseModel):
    name: str
    departments: list[Department]

records = model.structure(
    "At Acme, Engineering includes Alice, a software engineer, and Bob, "
    "a designer. Sales includes Carol, an account manager.",
    {"company": Company},
    validate_output=True,
)
print(records)

Calculated fields

A field marked "$calculate": true is computed by a small program over numbers read from the text (copy, add, subtract, multiply, divide, ...). The optional prompt states the question:

result = model.inference(
    "Revenue was $1,200 million in 2023 and $1,000 million in 2022.",
    structures={"$root": {"growth": {
        "$type": "text",
        "$format": "number",
        "$description": "Revenue change from 2022 to 2023",
        "$calculate": True,
    }}},
    prompt="By how much did revenue grow from 2022 to 2023?",
    decoder_kwargs={"value_spans": True},
)
print(result["structuring"][0])   # {'growth': {'value': ..., 'text': ...}}
print(result["calculation"][0])   # the program, e.g. subtract over the "1,200" and "1,000" spans

Text editing

edited = model.edit_text("She go to school every days.", instruction="fix grammar")
print(edited["text"])   # the corrected text
print(edited["edits"])  # character-level edits against the input

Multiple tasks in one call

results = model.inference(
    "Alice joined Acme as a software engineer.",
    entities=["person", "organization"],
    classes=["business", "sports", "technology"],
    structures={"employee": ["name", "company"]},
)
print(results["ner"][0])
print(results["classification"][0])
print(results["structuring"][0])

Text embeddings

import torch.nn.functional as F

embeddings = model.embed_text([
    "A scientist works in a laboratory.",
    "A researcher conducts an experiment.",
])
print(F.cosine_similarity(embeddings[0:1], embeddings[1:2]).item())

Evaluation results

TaskMetricScore
NER, 26 datasets (up to 500 examples each)Mean dataset strict entity F156.80
NER, CrossNER + MIT (7 datasets)Mean dataset strict entity F169.09
Classification, 13 datasetsMean dataset macro-F178.39
Joint relation extraction, 3 datasetsMean dataset micro-F127.58
Multilevel structuring, 500 examplesOrder-free, boundary-tolerant JSON F184.54
Flat multi-record structuring, 300 examplesOrder-free, boundary-tolerant JSON F191.08
Calculation (FinQA / ConvFinQA / TAT-QA), 595 questionsExact answer52.44

Dataset means weight datasets equally. NER requires both the entity span and type to match; NER and relation extraction use a 0.5 threshold. Classification macro-F1 averages class F1 scores within each dataset. Structuring compares flattened JSON value paths; "order-free, boundary-tolerant" aligns records without requiring their original order and allows the evaluator's limited boundary repairs; it is not exact JSON match. Most evaluated datasets contributed 30-200 training-split examples (never test examples) to the final fine-tuning data; † marks datasets with none, whose scores are zero-shot.

Comparison with other models

All three GLiFormer v1.5 checkpoints are listed, with this model in bold. GLiNER, NLI, LLM and GLiFormer v1 numbers are published results from the GLiFormer paper (Tables 3-5); Params are total parameters, NR means not reported. Rows are sorted by average.

CrossNER, strict entity F1. The Perplexity Decider models were run through the OpenRouter Extractions API on the same test examples as the GLiFormer v1.5 rows (CrossNER politics and science: the same 500-example samples), with one list field per entity type and overlapping spans resolved by confidence. Paper baselines use the full test sets. CrossNER literature and music are zero-shot for GLiFormer v1.5 (see †).

ModelFamilyParamsAILiteratureMusicPoliticsScienceAvg.
Gemma-4-31B-ITLLM31.0B63.1274.7267.2876.9771.6070.74
GPT-OSS-120BLLM117.0B64.7271.3669.0076.5569.5870.24
GPT-5-miniLLMNR64.9971.1065.6876.7271.3369.97
gliformer-2b-v1.5GLiFormer v1.52.7B66.1664.6773.8272.6071.8469.82
gliformer-0.4b-v1.5GLiFormer v1.5794M60.0866.3776.6170.3768.0468.29
GLiNER Multitask Large v0.5GLiNER440M51.0568.9674.3078.2767.2967.97
NuNER Zero-spanGLiNER449M60.1264.8969.9572.7366.4266.82
gliformer-0.8b-v1.5GLiFormer v1.51.3B62.6663.0269.6666.8869.4866.34
GLiFormer-baseGLiFormer v1264M56.3862.6067.6571.3667.5165.10
GLiFormer-largeGLiFormer v1576M51.7661.5766.8271.4870.1364.35
Gemma4-12BLLM12.0B58.7061.5064.9068.2060.8062.80
Gemma-4-E4BLLM8.0B57.9051.4060.8070.3060.5060.20
Qwen3.5 9BLLM9.7B48.6048.7055.9062.9058.0054.80
Perplexity: Decider V1.3Decision modelNR55.2151.5761.1252.2852.3554.50
Perplexity: Decider Flash V1.3Decision modelNR56.0051.4056.6252.4152.1053.70
Gemma-4-E2BLLM5.1B50.3049.0054.7060.0053.0053.40
Qwen3.5-2BLLM2.3B20.9023.3028.3028.8030.9026.40
Qwen3.5-0.8BLLM873M14.9021.7019.3025.2024.9021.20

Text classification, mean macro-F1 over the same 13 datasets.

ModelFamilyParamsMean macro-F1
GPT-5-miniLLMNR79.79
Gemma-4-31B-ITLLM31.0B79.69
gliformer-2b-v1.5GLiFormer v1.52.7B78.39
Gemma4-12BLLM12.0B77.80
GPT-OSS-120BLLM117.0B77.76
gliformer-0.4b-v1.5GLiFormer v1.5794M76.02
gliformer-0.8b-v1.5GLiFormer v1.51.3B75.24
GLiFormer-largeGLiFormer v1576M75.03
Gemma-4-E4BLLM8.0B74.10
GLiFormer-baseGLiFormer v1264M72.36
Qwen3.5 9BLLM9.7B71.40
Gemma-4-E2BLLM5.1B70.80
BGE-M3 zero-shot v2.0NLI568M58.33
Qwen3.5-2BLLM2.3B57.30
mDeBERTa-v3-base MNLI/XNLINLI279M51.93
Qwen3.5-0.8BLLM873M45.20

Relation extraction, micro-F1. Averages cover only the three datasets evaluated here (the paper also reports CoNLL04). Baseline sample sizes and protocols follow their sources and may differ from the 500-document runs below, so treat this table as indicative. † uses gold entities.

ModelEntitiesDocREDCrossREFewRelAvg.
gliformer-0.4b-v1.5predicted25.5020.4856.7634.25
Qwen3.5 9Bprompted11.603.8071.6029.00
gliformer-2b-v1.5predicted17.7023.0142.0327.58
gliformer-0.8b-v1.5predicted16.7417.8536.0823.56
GLiNER-Relexpredicted31.3018.1012.5020.63
Gemma-4-31B-ITprompted17.969.8430.1819.33
GPT-OSS-120Bprompted17.7710.9928.7919.18
Qwen3.5-2Bprompted1.200.7053.5018.47
GLiFormer-largepredicted12.7812.6124.0816.49
Qwen3.5-0.8Bprompted0.100.6047.2015.97
GPT-5-miniprompted18.6012.4015.0015.33
GLiFormer-basepredicted10.0010.0023.4914.50
Gemma4-12Bprompted14.007.9015.5012.47
Gemma-4-E4Bprompted11.606.1013.7010.47
GLiREL †gold2.401.4024.009.27
Gemma-4-E2Bprompted2.903.509.605.33

Named entity recognition

DatasetExamplesPrecisionRecallF1
ACE 200450045.7032.5338.01
ACE 200550046.1533.8639.07
AnatEM50042.7653.2547.43
bc2gm50044.9861.0151.78
bc4chemd50041.7663.3750.35
bc5cdr50066.8174.2770.34
Broad Tweet Corpus50054.3574.9363.00
CoNLL 200350067.0775.8071.16
CrossNER_AI43170.5862.2566.16
CrossNER_literature †41666.8762.6264.67
CrossNER_music †46574.6273.0473.82
CrossNER_politics50073.5871.6672.60
CrossNER_science50076.7067.5571.84
FabNER50033.6025.0628.71
FindVehicle50047.2951.3349.23
GENIA_NER50048.8164.9155.72
HarveyNER50016.5551.6125.07
mit-movie50073.3771.2572.29
mit-restaurant †50067.0758.0662.24
MultiNERD50060.7789.2372.30
ncbi50047.3860.6753.21
Ontonotes50041.1848.1344.38
PolyglotNER50034.3472.8946.69
TweetNER750049.6851.2650.46
WikiANN en50059.0162.5960.75
WikiNeural50066.7586.8575.48

Text classification

DatasetExamplesAccuracyMacro-F1Weighted F1
SetFit/CR37692.0291.4492.06
SetFit/sst21,82193.4193.4193.41
SetFit/sst52,21053.4452.8653.55
stanfordnlp/imdb25,00095.3295.3295.32
SetFit/20_newsgroups †7,53257.9858.5559.77
SetFit/enron_spam2,00095.3595.3595.35
AmazonScience/massive2,97479.9677.4180.56
PolyAI/banking773,08078.5778.0578.05
mteb/financial_phrasebank1,12996.6396.3296.64
SetFit/ag_news †7,60088.3988.3588.35
dair-ai/emotion2,00066.8553.0365.04
MoritzLaurer/cap_sotu †23,04054.1150.2154.76
cornell-movie-review-data/rotten_tomatoes1,06688.8488.8288.82

Micro-F1 equals accuracy in these single-label runs. cap_sotu has no test split; its train split is scored.

Joint relation extraction

Runs use predicted entities, 500 documents per dataset (DocRED dev, CrossRE test, FewRel validation). Gold counts are relation instances, not documents.

DatasetGold relationsPrecisionRecallMicro-F1Macro-F1
DocRED5,92420.6615.4817.708.89
CrossRE1,92023.8322.2423.0117.36
FewRel50076.3229.0042.0337.67

Structured extraction

SetStrict JSON F1Order-free JSON F1Order-free, boundary-tolerant F1Structure F1
Multilevel, 500 examples72.5982.0184.5488.16
Flat multi-record, 300 examples82.1390.4291.0894.30

Multilevel set by gold JSON depth:

Gold JSON depthExamplesOrder-free, boundary-tolerant F1
230091.40
36782.01
46772.75
56667.84

Calculation

Financial question answering over tables and text: a 595-question sample of the FinQA, ConvFinQA and TAT-QA test splits. "Exact" requires the computed value to match the gold answer; "program exact" requires the predicted operation sequence to match.

SubsetQuestionsExactWithin 1%Program exact
All59552.4469.2476.47
FinQA18756.1565.7874.33
ConvFinQA24053.7568.3374.17
TAT-QA16846.4374.4082.14
Answer copied from text13365.4188.7284.21
Answer computed46248.7063.6474.24

Citation

If you use this model, please cite the GLiFormer paper (knowledgator.com/research/gliformer):

@misc{stepanov2026gliformer,
  title        = {GLiFormer: A Generalist Multitask Transformer Encoder},
  author       = {Stepanov, Ihor and Shtopko, Mykhailo and Vodianytskyi, Dmytro and Lukashov, Oleksandr and Yaroshenko, Mykyta},
  year         = {2026},
  month        = sep,
  publisher    = {Knowledgator},
  url          = {https://www.knowledgator.com/research/gliformer}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · gliformer · token-classification

Можно запустить

Подбираем GPU…

Ревизия весов
aa3ce99

0 моделей