/ Модель

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

Контекст
40 960 токенов
Параметры
14 млрд
Размер весов
29,5 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-14B-MLX-4bit
Библиотека
mlx
Опубликована
1 апр 2026

tei-entity-linker-qwen3-14b-mlx

Генерация текстаТекст → текст3 профессии
265скачиваний за 30 дней0лайковвеса обновлены2 апр 2026

Описание модели

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

LoRA-адаптер Qwen3-14B проверяет соответствие сущностей из исторических TEI-регистров кандидатам GND и Wikidata.

TEI Entity Linker — Qwen3-14B LoRA — это адаптер, дообученный автором репозитория для связывания именованных сущностей из исторических TEI-регистров с авторитетными записями GND и Wikidata. Он принимает имя сущности, её тип, варианты написания и контекст, а также список кандидатов с описаниями, и выдаёт для каждого кандидата оценку MATCH, PARTIAL или NONE в JSON. Модель предназначена для этапа проверки кандидатов в конвейерах цифровых гуманитарных исследований: помогает различать одноимённых людей и места, учитывать исторические варианты написания и отклонять неподходящие совпадения.

В основе — плотная авторегрессионная архитектура Qwen3-14B; адаптер обучен методом LoRA на Apple Silicon с MLX. Базовая модель указана как Qwen/Qwen3-14B-MLX-4bit, размер — 14 млрд параметров, контекст — до 40 960 токенов. Карточка сообщает о немецком и английском языках; обучающие данные также включают сущности из греческих и латинских классических текстов. Для запуска через описанный MLX-сервер требуется Apple Silicon, хотя автор указывает возможность конвертации адаптера для других платформ. Модель распространяется по лицензии Apache-2.0.

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

  • сопоставление исторических персон с записями GND и Wikidata
  • сопоставление географических названий с учётом исторического написания
  • различение одноимённых людей по биографическим сведениям
  • разбор неоднозначных сущностей из классических греческих и латинских регистров
  • отклонение неподходящих кандидатов для связывания сущностей

Ограничения

Модель обучалась на конкретных исторических TEI-регистрах и наиболее точно соответствует обучающему формату с одной сущностью на запрос; пакеты из 2–5 сущностей также заявлены как рабочие. Для MLX-инференса требуется Apple Silicon и около 10 ГБ оперативной памяти; качество зависит от полноты контекста и предоставленных кандидатов.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

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

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

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

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

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

Открыть на Hugging Face

TEI Entity Linker — Qwen3-14B LoRA

A fine-tuned LoRA adapter for authority file linking in historical TEI editions. Given an entity from a TEI register (person, place, organization) and a list of candidates from Wikidata/GND, the model decides whether a candidate matches, partially matches, or does not match.

Task

The model solves a core problem in digital scholarly editing: linking named entities in historical registers to authority files (GND, Wikidata). This requires:

  • Disambiguating entities by biographical data, descriptions, and context
  • Handling historical spelling variants (Creveld → Krefeld, Coeln → Köln, Alderkyrchen → Aldekerk)
  • Distinguishing mythological figures from literary works of the same name
  • Recognizing ethnic groups, allegories, and personifications as valid entities
  • Rejecting false matches when candidates don't fit

Usage

Start the server

pip install mlx-lm

python3 -m mlx_lm.server \
  --model Qwen/Qwen3-14B-MLX-4bit \
  --adapter-path ./adapters-14b \
  --port 1234

Recommended inference parameters

ParameterValueNotes
temperature0.1Low temperature for deterministic JSON output. Higher values cause malformed JSON.
top_p0.9Nucleus sampling, slightly narrowed
max_tokens2048Sufficient for batches of 5 entities. Scale up for larger batches.
repetition_penalty1.0No penalty needed — the model was trained on structured output
stop] (optional)Can be used to stop after the JSON array closes

The model uses Qwen3's built-in thinking mode (<think>...</think>). With these parameters, the thinking block is typically empty and the model responds directly with JSON. If you want to explicitly disable thinking, set enable_thinking: false in the chat template or prepend <think>\n\n</think>\n\n to the assistant message.

Send a request

The model expects an OpenAI-compatible chat format with a system prompt defining the task and a user prompt listing entities with candidates:

curl http://localhost:1234/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
  "model": "Qwen/Qwen3-14B-MLX-4bit",
  "temperature": 0.1,
  "messages": [
    {
      "role": "system",
      "content": "Du bist ein Normdaten-Experte fuer historische TEI-Editionen.\nEntscheide ob Normdaten-Kandidaten (Wikidata/GND) zu Entities aus historischen Registern passen.\n\nRegeln:\n- MATCH: >=90% sicher. PARTIAL: 75-90%. NONE: kein Kandidat passt.\n- Lebensdaten und Register-Notizen sind die staerksten Indikatoren.\n- Abstammung/Verwandtschaft MUSS uebereinstimmen.\n- Antworte NUR als JSON-Array.\n\nFormat pro Entity:\n{\"idx\": 1, \"verdict\": \"MATCH\"|\"PARTIAL\"|\"NONE\", \"best\": 1, \"confidence\": 0.95, \"reason\": \"Max 1 Satz\", \"modern_name\": null}"
    },
    {
      "role": "user",
      "content": "--- Entity 1 ---\nName: Philipp Melanchthon\nTyp: person\nNote: nachantik/fruehneuzeitlich; Lebensdaten: 1497-1560; Reformator und Humanist\n\nKandidaten:\n  1. GND 118580485 \"Melanchthon, Philipp\" — Theologe, Humanist, Reformator; 1497-1560\n  2. Wikidata Q76325 \"Philipp Melanchthon\" — German Protestant reformer (1497-1560)\n  3. GND 1089928572 \"Melanchthon, Philipp\" — Sohn des vorigen"
    }
  ]
}'

Response

[
  {
    "idx": 1,
    "verdict": "MATCH",
    "best": 1,
    "confidence": 0.99,
    "reason": "Lebensdaten (1497-1560) und Beruf (Reformator, Humanist) stimmen ueberein.",
    "modern_name": null
  }
]

Input Format

Entity block structure

Each entity in the user prompt follows this structure:

--- Entity N ---
Name: <register name>
Typ: person|place|org
Alternativnamen: <optional, e.g. Greek/Latin forms>
Lebensdaten (Register): geb. 1533, gest. 1613
Amt/Beruf (Register): <optional>
Register-Notiz: <optional biographical/geographical context>
Quelltext-Kontext: <optional, surrounding text from TEI source>
Kandidaten:
  1. [wikidata] <label> — <description> (Score 0.80)
     ID: Q128176
  2. [gnd] <label> — <description> (geb. 1497, gest. 1560)
     ID: 118580485

Candidate format

Candidates are listed with their source ([wikidata] or [gnd]), a label, description, and an optional pre-computed similarity score. The authority file ID (Wikidata Q-ID or GND number) is passed on a separate ID: line below each candidate.

Important: The model was trained on single-entity prompts (one entity per request). It also works well with batches of 2-5 entities per call, but single-entity prompts match the training distribution most closely.

Entity fields

FieldRequiredDescription
NameyesEntity name as it appears in the register
Typyesperson, place, or org. Subtypes can be annotated: person (PERSONENGRUPPE/VOLK), person (KOERPERSCHAFT)
AlternativnamennoAlternative name forms (Greek, Latin, historical spellings)
Lebensdaten (Register)noBirth/death dates from the register
Amt/Beruf (Register)noOccupation or title from the register
Register-NotiznoFree-text note with biographical/geographical context. This is the strongest disambiguation signal.
Quelltext-KontextnoSurrounding text from the TEI source document
KandidatenyesNumbered list of candidates with source, label, description, score, and ID

Candidate fields

FieldRequiredExample
Source tagyes[wikidata] or [gnd]
LabelyesMelanchthon, Philipp
DescriptionnoTheologe, Humanist, Reformator; 1497-1560
Life datesno(geb. 1497, gest. 1560) — appended after description
Scoreno(Score 0.77) — pre-computed similarity score
ID lineyesID: Q76325 or ID: 118580485 on the next line

If no candidates were found, use: (Keine Kandidaten gefunden)

Prompt header

The user prompt should start with a verification instruction, optionally including project-specific context:

Verifiziere diese Zuordnungen.

WICHTIG: KEINE zeitliche Filterung durchfuehren!
Pruefe NUR ob der Kandidat zur Register-Note passt.
Antike, mittelalterliche und biblische Figuren sind gueltig.

Prüfe auf historische Schreibweisen!

--- Entity 1 ---
...

Antwort als JSON-Array:

Output Format

JSON array with one object per entity:

FieldTypeDescription
idxintEntity index (1-based)
verdictstringMATCH (>=90%), PARTIAL (75-90%), NONE
bestint1-based index of best candidate (0 if NONE)
confidencefloat0.0 - 1.0
reasonstringBrief justification (1 sentence)
modern_namestring|nullModern spelling if register name is a historical variant (e.g. "Krefeld" for "Creveld")

Training

Method

The model was fine-tuned using LoRA (Low-Rank Adaptation) on Apple Silicon via MLX. Training data was generated through a teacher-student approach: Claude Sonnet 4 served as the verification oracle on real TEI register data, producing high-quality labeled examples. These were deduplicated, quality-filtered, and converted to ChatML format for supervised fine-tuning.

Each training example is a single entity with its candidates — the model learns to evaluate candidate quality based on name matching, biographical data, descriptions, and register context.

Hyperparameters

ParameterValue
Base modelQwen/Qwen3-14B-MLX-4bit
MethodLoRA (rank 16, alpha 32, dropout 0.05)
Target modulesq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Trained layers16
Training examples7,098
Validation examples789
Iterations1,500 (checkpoints every 300)
Learning rate1.5e-4
Max sequence length2,048
OptimizerAdam
Gradient checkpointingEnabled
Batch size1 (with grad accumulation)

Training Data Composition

CategoryCount
Persons7,398
Places489
MATCH verdicts6,343
NONE verdicts1,544
Total (after dedup)7,887

Training data sources:

  • Historical TEI editions (early modern German correspondence, 16th century)
  • Classical philology registers (Greek/Latin named entities)
  • Enrichment pipeline output verified by Claude Sonnet 4

The data covers a wide range of entity types: historical persons with life dates, mythological/biblical figures, ethnic groups and peoples, geographic locations with historical spelling variants, and personifications/allegories.

Capabilities

Tested on representative entities from a 16th-century TEI edition:

  • Biographical disambiguation: Correctly distinguishes father/son with same name by life dates
  • Historical spelling: Recognizes Creveld→Krefeld, Coeln→Köln, Alderkyrchen→Aldekerk
  • Mythology vs. literature: Picks Q202990 (Hecuba the queen) over Q1421115 (Hecuba the play)
  • Ethnic groups/peoples: Matches "Trojaner" to GND 4060976-3 (Volk), not the city
  • Correct rejection: Returns NONE for underspecified entries like "Fridericus, Ilfelder Schüler"
  • Geographic disambiguation: Dillingen an der Donau vs. Dillingen/Saar, Wesel (NRW) vs. Wesel (Niedersachsen)

Integration

This adapter was built for the TEI-NER-Stack (GitHub repository TBA), an automated entity linking pipeline for historical TEI editions. The pipeline handles candidate retrieval (Wikidata/GND API), batching, confidence scoring, and XML output — the model serves as the verification step.

Requirements

  • Apple Silicon Mac (M1 or later) for MLX inference
  • ~10 GB RAM for the 4-bit model + adapter
  • Python 3.10+, mlx-lm package

For GPU inference on other platforms, convert the adapter to Hugging Face PEFT format and use vLLM or text-generation-inference with the full-precision Qwen3-14B base model.

License

Apache 2.0 (inherited from Qwen3-14B)

Citation

@software{makowski2026tei_entity_linker,
  author = {Makowski, Stephan},
  title = {TEI Entity Linker: Fine-tuned Qwen3-14B for Authority File Linking in Historical Editions},
  year = {2026},
  note = {GitHub repository TBA}
}

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

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

GPU в ailist

Универсальный рантайм · mlx

Нельзя запустить

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

Класс архитектуры
Qwen3ForCausalLM
Ревизия весов
6a45070

0 моделей