kniv v7 xlarge-u (UltraBERT-380M)

One English encoder that gives a full linguistic analysis and extracts knowledge against a schema you supply at inference time.

  • Linguistic layer: part of speech, morphology, lemmas, named entities, dependency trees, semantic roles, dialogue act and sentiment per sentence, coreference.
  • Knowledge layer: entities of the types you name, facts for the relations you name (a name plus an optional description), and for every fact its polarity, modality, holder and time. In a conversation each speaker is an entity, so "I live in Berlin" yields (user, lives in, Berlin).

A sibling model, kniv-v7-xlarge-d-en, shares the design. Choose this one if you want the better zero-shot model (new relation and entity types), the better memory extractor, with longer windows (1,024 subwords) and about 50M fewer parameters.

GUIDE.md compares the two models and shows how to work around their known failure modes in your own code.

The kniv v7 models, smallest first:

model base encoder parameters role
kniv-v7-tiny-en ettin-encoder-17m 55M distilled student
kniv-v7-small-en ettin-encoder-32m 76M distilled student
kniv-v7-medium-en ettin-encoder-68m 122M distilled student
kniv-v7-large-en ModernBERT-base 221M distilled student
kniv-v7-xlarge-d-en deberta-v3-large 538M teacher
kniv-v7-xlarge-u-en (this model) UltraBERT-380M 485M teacher

Model details

developed by Dragonscale (dragonscale-ai)
model type multi-task transformer encoder
version kniv v7.1.2 (ultrabert-380m-v7b8ev), 2026-11-13; v7.1.1 2026-11-09; v7.1 2026-11-03; v7.0 2026-10-20
base model dmis-lab/UltraBERT-380M
parameters 485M
input up to 512 words per window (1,024 subwords)
language English
licence Apache-2.0

Uses

Intended. Analysing English prose and conversations; extracting entities and facts for your own schema without fine-tuning, for agent memory, knowledge graphs, search and document analytics.

Out of scope.

  • Languages other than English.
  • Acting on extracted facts without review where errors matter (medical, legal, financial or employment decisions about people).
  • Profiling individuals without their consent.

Installation

Everything needed to run the model is in this repository: the ONNX graphs, the tokenizer, the settings, and the kniv_v7 Python package that turns text into results. There is nothing else to install from elsewhere: download the repository and put it on your Python path.

pip install onnxruntime tokenizers numpy huggingface_hub
import sys
from huggingface_hub import snapshot_download

path = snapshot_download("dragonscale-ai/kniv-v7-xlarge-u-en")    # includes kniv_v7/
sys.path.insert(0, path)
from kniv_v7 import Kniv

Quick start

kniv = Kniv(path)
out = kniv.analyse(
    turns=[("user", "I live in Berlin and work for Siemens."),
           ("assistant", "Nice, how long have you been there?")],
    relations=[{"name": "lives in", "description": "the place where the head resides"},
               {"name": "employer", "description": "the organization the head works for"}],
    entity_types=[{"name": "location"}, {"name": "organization"}, {"name": "person"}])

w = out[0]
for f in w["facts"]:
    print(w["entities"][f["head"]]["text"], f["relation"], w["entities"][f["tail"]]["text"],
          f["polarity"], f["modality"])
# user lives in Berlin positive asserted
# user employer Siemens positive asserted

Plain text works the same way:

out = kniv.analyse(
    "Henry Wager Halleck (January 16, 1815 – January 9, 1872) was a United States Army "
    "officer, scholar, and lawyer.",
    relations=[{"name": "date of birth", "description": "date on which the subject was born"},
               {"name": "date of death", "description": "date on which the subject died"},
               {"name": "military branch", "description": "branch to which this person belongs"}],
    entity_types=[{"name": "person"}, {"name": "organization"}, {"name": "date"}])

w = out[0]
for f in w["facts"]:
    print(w["entities"][f["head"]]["text"], f["relation"], w["entities"][f["tail"]]["text"],
          f["polarity"], f["modality"])
# Henry Wager Halleck date of birth January 16 , 1815 positive asserted
# Henry Wager Halleck date of death January 9 , 1872 positive asserted
# Henry Wager Halleck military branch United States Army positive asserted

Every kniv v7 model returns exactly these facts for both examples, in fp32 and INT8. (The sentence is from the English Wikipedia article on Henry Halleck, CC BY-SA 4.0.) Pass text as kniv.analyse(text, ...) (paragraphs separated by blank lines) or a conversation as turns. analyse returns one record per window:

key content
tokens, sentences words; sentence spans (and speakers)
words per word: pos, morph, lemma, head (0 = root, else 1-based), deprel
ner [type, start, end) named-entity spans
srl frames: predicate and args as [role, start, end)
sentence_layers per sentence: dialogue acts (cls), sentiment
coref clusters of [start, end] word spans (inclusive)
entities type, text, mentions, spans (speakers first in a conversation)
facts head, relation, tail (indices into entities), margin, polarity, modality, holder, time

kniv.extract(...) returns entities and facts only. Without entity_types, entities get six coarse types (PER, ORG, LOC, TIME, NUM, MISC).

Variants

variant load for
fp32 Kniv(path) reference
FP16 Kniv(path, variant="fp16") half the download; GPUs (providers=["CUDAExecutionProvider"])
INT8 Kniv(path, int8=True) CPU speed: about 2x faster than fp32

FP16 matches fp32 within 0.001 on every task. INT8 stays within 0.7 points. To download only the FP16 files:

path = snapshot_download("dragonscale-ai/kniv-v7-xlarge-u-en", ignore_patterns=[
    "model.pt", "onnx/plain.onnx", "onnx/label.onnx", "onnx/marker.onnx"])
kniv = Kniv(path, variant="fp16")

PyTorch

model.pt holds the PyTorch weights. They are used through the model code in kniv-nlp-models:

from kniv_v7 import Kniv
from v6.export.torch_backend import TorchBackend

kniv = Kniv(path, backend=TorchBackend.from_release(path))

How it works

One encoder runs up to three times per window:

  1. Plain pass. Every linguistic head, coreference and the entity typer.
  2. Label pass. Your type and relation names become vectors, cached per schema.
  3. Marker pass. The window with every entity mention marked. Every entity pair is scored against every relation, then each kept fact's attributes.

Decoding thresholds are in calibration.json, and every one can be changed at run time (see GUIDE.md).

Results

benchmark score
UD English EWT, POS 0.978
UD English EWT, lemma / morphology 0.976 / 0.977
UD English EWT, UAS / LAS 0.945 / 0.927
OntoNotes 5, NER 0.860
PropBank, SRL 0.797
SGD, dialogue acts 0.761
LitBank, coreference 0.709
Re-DocRED, relations (gold / predicted entities) 0.728 / 0.616
FewRel, zero-shot relations (5 / 10 / 15-way) 0.729 / 0.675 / 0.550
CrossNER, zero-shot entity types 0.580
Few-NERD, entity types 0.523
LongMemEval, answer in extracted entities / facts 0.693 / 0.480

Bias, risks and limitations

  • Coverage. People, places and organisations from well-covered regions are recognised and related more reliably than others.
  • Privacy. The model extracts facts about people, speakers included. Store and use them with the consent and data-protection care that implies.
  • Facts are candidates. Treat each fact as a candidate with a confidence (margin), not as verified truth. Keep a human in the loop where facts about people drive decisions.
  • Document-level relations. About 29% of facts are missed, mostly borderline decisions. Lower the thresholds for recall (GUIDE.md).
  • Entity grouping is rule-based. Partial names ("Obama" / "Barack Obama") are not merged.
  • Per-window facts. Facts are per window; nothing is linked across windows or documents.
  • Long windows. Text past 1,024 subwords in a window is not analysed.
  • English only.

Changelog

v7.1.2 (2026-11-13). A runtime fix; the weights and graphs are unchanged. Raw text was split into sentences at any period before a capital letter, so "Sen. Robert F. Kennedy" became three sentences and the name two entities ("Robert F." and "Kennedy"); titles ("Dr. Smith"), initials ("J. K. Rowling"), abbreviated months ("Dec. 13") and dotted acronyms ("U.S. Army") broke the same way. Sentences no longer end after these, and the word tokenizer keeps them whole ("U.S.", "F.", "Dec.", "Inc."), as the Penn Treebank and CoNLL do. On CoNLL04 from raw text, end-to-end relation F1 rises 1.1 to 3.8 points across the six v7 models; pre-tokenized input is unaffected. One known case goes the other way: a sentence ending in a single capital letter ("I met Mr. T. He was tall.") is not split. To get v7.1.1 back, download with revision="v7.1.1".

v7.1.1 (2026-11-09). A runtime fix; the weights, graphs and scores are unchanged. A window's only entity was dropped: the entity grouping step returned nothing below two entities. A text with one entity of the requested types gave no entities, and a conversation turn such as "I live in Berlin." gave no fact pairing the speaker with Berlin. The entity is now kept. To get v7.1 back, download with revision="v7.1".

v7.1 (2026-11-03). The trained weights are unchanged; the outputs change as below. To get v7.0 back, download with revision="v7.0".

  • Coreference considers 100 antecedent candidates per word instead of 50: LitBank 0.707 -> 0.709.
  • Faster coreference scoring. The pair scorer's first layer is split exactly into per-word and per-pair parts, so most of it runs once per word: the same scores, 13% faster end to end in fp32 and 7% in INT8.

Licence

Apache-2.0. The base encoder (dmis-lab/UltraBERT-380M) is Apache-2.0.

Citation

@misc{kniv_v7_2026,
  title        = {kniv v7: one encoder for linguistic analysis and schema-conditioned knowledge extraction},
  author       = {{Dragonscale}},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/dragonscale-ai/kniv-v7-xlarge-u-en}}
}

Contact

Questions and issues: https://github.com/rustic-ai/kniv-nlp-models/issues.

Downloads last month
167
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for dragonscale-ai/kniv-v7-xlarge-u-en

Quantized
(3)
this model

Collection including dragonscale-ai/kniv-v7-xlarge-u-en

Articles mentioning dragonscale-ai/kniv-v7-xlarge-u-en

Evaluation results