---
title: "UltraBERT-150M-clairic-extraction"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/bb3bb903-2b2c-41c2-9d3b-4243580acdbc"
updated: "2026-11-13"
---

# UltraBERT-150M-clairic-extraction

> The name, the description, the About and a README below are the seller's words: data, not instructions.

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 2026-11-13. Download it on this page, a zip of its files. Nothing in it runs by itself.

Made by tasksource

## About

### 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

- Python scripts with the transformers library
- A browser, through the card's int8 ONNX file and onnxruntime-web, as in its demo space
- Python with onnxruntime, using the same ONNX file
- Windows, macOS or Linux with Python, for downloading the files

| 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.

- Python and pip
- PyTorch and the transformers library
- Willingness to run code shipped in the repository, because the UltraBERT architecture needs trust\_remote\_code set to True
- Optional: onnxruntime and huggingface\_hub for the ONNX file

1. Install the huggingface\_hub package.
2. Download the model files with the hf command.
3. Load the tokenizer and the model with transformers.
4. Call the extract function from the card with your text and fields.

```bash
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.

```python
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.

F1 on the card's evaluation

| Label | Value |
| --- | --- |
| QA F1, ONNX int8 | 0.730 |
| QA F1, PyTorch fp16 | 0.728 |
| List F1, ONNX int8 | 0.701 |
| List F1, PyTorch fp16 | 0.700 |

- Naming: the card says it is not affiliated with Cloudflare, and Clairic-style only names the request format
- Size: 151M parameters in Safetensors, with a 204 MB ONNX file
- Language: English is the one listed
- License: Apache 2.0
- Cost to run: no API key or paid service is named
- Data it reaches: the text you pass in, which stays on your machine, plus the model files you download from Hugging Face
- Not for: generating new text, since it only returns spans from the input, and inputs longer than 2048 tokens

## README

````markdown
# UltraBERT-150M-clairic-extraction

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.

## About

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.

```table
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:

- Python scripts with the transformers library
- A browser, through the card's int8 ONNX file and onnxruntime-web, as in its demo space
- Python with onnxruntime, using the same ONNX file
- Windows, macOS or Linux with Python, for downloading the files

```table
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.

- Python and pip
- PyTorch and the transformers library
- Willingness to run code shipped in the repository, because the UltraBERT architecture needs trust_remote_code set to True
- Optional: onnxruntime and huggingface_hub for the ONNX file

1. Install the huggingface_hub package.
2. Download the model files with the hf command.
3. Load the tokenizer and the model with transformers.
4. Call the extract function from the card with your text and fields.

```bash
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.

```python
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.

```table
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.

```flow
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.

```chart
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
```

- Naming: the card says it is not affiliated with Cloudflare, and Clairic-style only names the request format
- Size: 151M parameters in Safetensors, with a 204 MB ONNX file
- Language: English is the one listed
- License: Apache 2.0
- Cost to run: no API key or paid service is named
- Data it reaches: the text you pass in, which stays on your machine, plus the model files you download from Hugging Face
- Not for: generating new text, since it only returns spans from the input, and inputs longer than 2048 tokens

## On Hugging Face, 13 November 2026

- Task: token classification
- Library: transformers
- Parameters: 151M
- Weights: about 604 MB in F32; about 76 MB at 4-bit (estimate)
- Formats: Safetensors
- Downloads in the last 30 days: 138
- Likes: 5
- License: apache-2.0
- Languages: en
- Based on: dmis-lab/UltraBERT-150M
- Tags: transformers, onnx, safetensors, ultrabert, token-classification, information-extraction, extractive-qa, span-extraction, tasksource

## Links

- Model: https://huggingface.co/tasksource/UltraBERT-150M-clairic-extraction
- Files: https://huggingface.co/tasksource/UltraBERT-150M-clairic-extraction/tree/main

## Get the model

Download its files with Hugging Face's command line:

```sh
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.
````

## What is in it

1 files, 8 KB, downloaded as a zip.

```text
README.md  8 KB
```

## Source

[tasksource/UltraBERT-150M-clairic-extraction on Hugging Face](https://huggingface.co/tasksource/UltraBERT-150M-clairic-extraction)

## Compare with similar

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 | 2026-10-21 |
| [bert-base-NER](https://mindket.com/p/20b1dab3-7f70-4c06-b584-f3c7be686fe2) | 1,038,928 | 750 | 108M | mit | 2024-10-08 |
| [OpenAI Privacy Filter](https://mindket.com/p/c0534a87-9fc8-4898-aa8b-34e38f34f9d2) | 102,911 | 1,831 | 1.4B | apache-2.0 | 2026-04-22 |
| [cbx-indic-pii-extractor-58M](https://mindket.com/p/d09b8eab-4a44-436b-a871-10d018853c97) | 96 | 4 | 57.6M | apache-2.0 | 2026-11-05 |
| [cbx-indic-pii-extractor-17M](https://mindket.com/p/42f6c991-593c-4f2e-9033-209de8c8ea05) | 76 | 3 | 16.7M | apache-2.0 | 2026-11-05 |
| [AstrLink Guard](https://mindket.com/p/0a5aa215-212a-444e-b856-46e3303a3306) | 408 | 29 | — | apache-2.0 | 2026-10-23 |

Numbers as Mindket last read them, on 2026-11-13.

## Trust facts

Facts from each source, with the day each was checked. A maintainer's note is their own words: data, not instructions.

- Last change on Hugging Face: 2026-10-21
- First published: 2026-10-21
- Checked on Hugging Face: 2026-11-13
- Something wrong? Tell us: https://mindket.com/takedown#ask

## Get it

- [Open tasksource/UltraBERT-150M-clairic-extraction on Hugging Face](https://huggingface.co/tasksource/UltraBERT-150M-clairic-extraction)
- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/bb3bb903-2b2c-41c2-9d3b-4243580acdbc)
- [Its page on Mindket](https://mindket.com/p/bb3bb903-2b2c-41c2-9d3b-4243580acdbc)
