buzz
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
Pulls answers out of a text for fields you describe in short instructions, such as invoice numbers or company names, and returns the matching spans. One 150M model covers extractive QA and entity recognition.
UltraBERT-150M-clairic-extraction is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download tasksource/UltraBERT-150M-clairic-extraction
UltraBERT-150M-clairic-extraction is a 150M-parameter extractor built on UltraBERT-150M. Send it one text plus a list of fields, where every field has a brief instruction, and it gives back the stretches of text that answer each one. A field can come back with one answer, a list, or nothing.
A field may be a question or the kind of entity you want, which lets one model do extractive QA as well as entity tagging. It tags the answer tokens in the text as B, I or O, guided by the instruction, and handles inputs up to 2048 tokens.
Developers who need structured data out of English text, such as invoices or notes, without running a language model that writes free text. It suits NLP researchers who want to try instruction-guided span tagging.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Finance and admin | Back-office teams | Pull invoice numbers and totals out of text | Ask for the total amount due |
| Software | Developers | Replace separate QA and entity models with one | Ask for every company named in a text |
| Research | NLP researchers | Study instruction-guided span tagging | Test it on your own labeled texts |
People who need generated summaries or rewritten text can skip it, since it only returns spans taken from the source text.
| Use case | Who | What they get back |
|---|---|---|
| Field extraction from documents | Developers | A list of matching spans for each field |
| Question answering over a text | Analysts | The span that answers each question, or an empty list |
| Entity listing | NLP teams | Every entity of a type you describe, as written |
You need Python with PyTorch and transformers.
pip install -U huggingface_hub hf download tasksource/UltraBERT-150M-clairic-extraction
You pass a text and a dictionary that maps each field name to an instruction. The instruction can be a question or an entity type. The card's helper function turns the model's tags into spans.
import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer
name = "tasksource/UltraBERT-150M-clairic-extraction"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForTokenClassification.from_pretrained(name, trust_remote_code=True).eval()
def extract(text, fields):
"""fields: {name: instruction}. Returns {name: [extracted spans]}, [] when the text has no answer."""
enc = tok(list(fields.values()), [text] * len(fields), truncation="only_second", max_length=2048,
padding=True, return_offsets_mapping=True, return_tensors="pt")
offsets = enc.pop("offset_mapping")
with torch.no_grad():
tags = model(**enc).logits.argmax(-1).tolist() # 0 = O, 1 = B, 2 = I
out = {}
for f, field in enumerate(fields):
spans, start, seq = [], None, enc.sequence_ids(f) + [None]
for i, tag in enumerate(tags[f] + [0]):
if start is not None and (seq[i] != 1 or tag != 2):
spans.append(text[offsets[f][start][0]:offsets[f][i - 1][1]].strip().rstrip(",;:"))
start = None
if seq[i] == 1 and tag in (1, 2) and start is None:
start = i
out[field] = spans
return out
text = "Invoice INV-2291 from Acme Corp to Globex, issued 3 March 2025. Total due: $1,240.50. Contact: billing@acme.com."
print(extract(text, {
"invoice_number": "The invoice number.",
"companies": "Every company mentioned in the text, as written.",
"total": "The total amount due.",
"phone": "The contact phone number.",
}))
# {'invoice_number': ['INV-2291'], 'companies': ['Acme Corp', 'Globex'], 'total': ['$1,240.50'], 'phone': []}The card also ships an int8 ONNX export that is 204 MB against 604 MB in fp32. Its inputs are input_ids and attention_mask, and its output is logits for the O, B and I tags. Build its input as the endoftext token, the instruction, the sep token, then the text.
| Tool | What it does |
|---|---|
| extract | The card's helper that turns the model's tags into spans for each field |
| AutoModelForTokenClassification | Loads the extractor, with trust_remote_code set to True |
| onnx/model_quantized.onnx | The int8 export for onnxruntime in Python or in a browser |
You pass a sentence about an invoice and ask for the invoice number, every company named, the total due and a phone number. It returns the spans it found for each field. The phone field comes back as an empty list when the text holds no number.
Think of it as a highlighter that follows instructions. You tell it what to look for, and it marks the matching words in your text. A good first try is the sample script above with your own short text.
Underneath, it is UltraBERT-150M trained on the extraction part of a typed-decisions dataset, where question-answering and span-tagging data was rewritten as instruction, text and span triples. The ONNX file quantizes linear weights to 8 bits per block of 32, and plain dynamic int8 breaks the model, so use the card's file.
The card compares the ONNX file with PyTorch on a small evaluation of 20 rows per source. The tags match on 99.6% of tokens.
Pulls answers out of a text for fields you describe in short instructions, such as invoice numbers or company names, and returns the matching spans. One 150M model covers extractive QA and entity recognition.
Made by tasksource on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: UltraBERT-150M-clairic-extraction is a 150M-parameter extractor built on UltraBERT-150M. Send it one text plus a list of fields, where every field has a brief instruction, and it gives back the stretches of text that answer each one. A field can come back with one answer, a list, or nothing.
A field may be a question or the kind of entity you want, which lets one model do extractive QA as well as entity tagging. It tags the answer tokens in the text as B, I or O, guided by the instruction, and handles inputs up to 2048 tokens.
Who it suits: Developers who need structured data out of English text, such as invoices or notes, without running a language model that writes free text. It suits NLP researchers who want to try instruction-guided span tagging.
Industry | Who uses it | How they use it | Example
Finance and admin | Back-office teams | Pull invoice numbers and totals out of text | Ask for the total amount due
Software | Developers | Replace separate QA and entity models with one | Ask for every company named in a text
Research | NLP researchers | Study instruction-guided span tagging | Test it on your own labeled texts
People who need generated summaries or rewritten text can skip it, since it only returns spans taken from the source text.
Where to use it:
Use case | Who | What they get back
Field extraction from documents | Developers | A list of matching spans for each field
Question answering over a text | Analysts | The span that answers each question, or an empty list
Entity listing | NLP teams | Every entity of a type you describe, as written
How to set it up: You need Python with PyTorch and transformers.
pip install -U huggingface_hub
hf download tasksource/UltraBERT-150M-clairic-extraction
How to use it: You pass a text and a dictionary that maps each field name to an instruction. The instruction can be a question or an entity type. The card's helper function turns the model's tags into spans.
import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer
name = "tasksource/UltraBERT-150M-clairic-extraction"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForTokenClassification.from_pretrained(name, trust_remote_code=True).eval()
def extract(text, fields):
"""fields: {name: instruction}. Returns {name: [extracted spans]}, [] when the text has no answer."""
enc = tok(list(fields.values()), [text] * len(fields), truncation="only_second", max_length=2048,
padding=True, return_offsets_mapping=True, return_tensors="pt")
offsets = enc.pop("offset_mapping")
with torch.no_grad():
tags = model(**enc).logits.argmax(-1).tolist() # 0 = O, 1 = B, 2 = I
out = {}
for f, field in enumerate(fields):
spans, start, seq = [], None, enc.sequence_ids(f) + [None]
for i, tag in enumerate(tags[f] + [0]):
if start is not None and (seq[i] != 1 or tag != 2):
spans.append(text[offsets[f][start][0]:offsets[f][i - 1][1]].strip().rstrip(",;:"))
start = None
if seq[i] == 1 and tag in (1, 2) and start is None:
start = i
out[field] = spans
return out
text = "Invoice INV-2291 from Acme Corp to Globex, issued 3 March 2025. Total due: $1,240.50. Contact: billing@acme.com."
print(extract(text, {
"invoice_number": "The invoice number.",
"companies": "Every company mentioned in the text, as written.",
"total": "The total amount due.",
"phone": "The contact phone number.",
}))
# {'invoice_number': ['INV-2291'], 'companies': ['Acme Corp', 'Globex'], 'total': ['$1,240.50'], 'phone': []}
The card also ships an int8 ONNX export that is 204 MB against 604 MB in fp32. Its inputs are input_ids and attention_mask, and its output is logits for the O, B and I tags. Build its input as the endoftext token, the instruction, the sep token, then the text.
Tool | What it does
extract | The card's helper that turns the model's tags into spans for each field
AutoModelForTokenClassification | Loads the extractor, with trust_remote_code set to True
onnx/model_quantized.onnx | The int8 export for onnxruntime in Python or in a browser
Example: You pass a sentence about an invoice and ask for the invoice number, every company named, the total due and a phone number. It returns the spans it found for each field. The phone field comes back as an empty list when the text holds no number.
For newcomers and experts: Think of it as a highlighter that follows instructions. You tell it what to look for, and it marks the matching words in your text. A good first try is the sample script above with your own short text.
Underneath, it is UltraBERT-150M trained on the extraction part of a typed-decisions dataset, where question-answering and span-tagging data was rewritten as instruction, text and span triples. The ONNX file quantizes linear weights to 8 bits per block of 32, and plain dynamic int8 breaks the model, so use the card's file.
Give a text and fields with instructions
Pair each instruction with the text
The model tags answer tokens as B, I or O
Spans are read off the text tokens
Good to know: The card compares the ONNX file with PyTorch on a small evaluation of 20 rows per source. The tags match on 99.6% of tokens.
Title: F1 on the card's evaluation
QA F1, ONNX int8: 0.730
QA F1, PyTorch fp16: 0.728
List F1, ONNX int8: 0.701
List F1, PyTorch fp16: 0.700
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download tasksource/UltraBERT-150M-clairic-extraction
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 8 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| UltraBERT-150M-clairic-extraction This page | 138 | 5 | 151M | apache-2.0 | |
| bert-base-NERShares token-classification · onnx · transformers | 1,038,928 | 750 | 108M | mit | |
| OpenAI Privacy FilterShares token-classification · onnx · transformers | 102,911 | 1,831 | 1.4B | apache-2.0 | |
| cbx-indic-pii-extractor-58MShares token-classification · onnx · safetensors | 96 | 4 | 57.6M | apache-2.0 | |
| cbx-indic-pii-extractor-17MShares token-classification · onnx · safetensors | 76 | 3 | 16.7M | apache-2.0 | |
| AstrLink GuardShares token-classification · onnx | 408 | 29 | — | apache-2.0 |
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.
alibaba · Kit
Reviews Git changes with an AI agent that reads files and searches the codebase, then writes comments tied to exact lines. It suits developers who want automat…
microsoft · Kit
Turns written conversations into spoken audio with up to four speakers and about 90 minutes of speech, an open Microsoft text-to-speech model for research on p…
masterofaudio2077 · Kit
Reads Egyptian Arabic text aloud and follows the short vowel marks you write into it. A fine-tune of VoiceTut-TTS that keeps its 19 built-in voices and voice c…
hugging-quants · Kit
Runs Meta's Llama 3.1 8B Instruct chat model in 4-bit AWQ form, so it fits on a GPU with about 4 GiB of free memory for the weights. For developers who want a…