Custom Detectors
Custom Detectors
Custom detectors let you extend Classifyre with signals that are specific to your team, domain, or compliance requirements. You define what to detect — a business policy, a content category, an image label — and pick the method that fits the job.
Each custom detector runs one of seven detection engines, or your own Python as a code detector — plus Tag, which runs nothing at all and instead records a fact a Custom connector already knows. This page describes each and links to its configuration reference.
Detection methods
Name the facts you want (parties, dates, amounts, any concept) and the categories to sort text into. A small model reads each document once on the scan's CPU and returns the exact words with their position. No training data, no API key, no text leaves your infrastructure.
Define precise pattern-matching rules using regular expressions. Fast, deterministic, zero ML overhead. Perfect for codes, IDs, and structured formats like IBANs or order numbers.
Use a large language model with a natural-language prompt to classify content and extract structured fields. Best for nuanced, context-dependent detection where examples and rules are hard to define explicitly.
Ask a decision model yes/no, pick-one and scale questions about your content. It answers each with a probability instead of text, and every answer becomes a finding with your label and priority. Works with TypeSafe Jev, OpenAI Decisions, Cloudflare Clef and self-hosted System One models.
Run any HuggingFace text-classification model. Map predicted labels to severity levels. Ideal for spam detection, toxicity, sentiment, and custom topic classifiers.
Classify images with any HuggingFace vision model. Useful for NSFW detection, harmful content filtering, and custom image category labelling.
Run any HuggingFace object-detection model on images. Findings include bounding boxes, confidence scores, and label-based severity mapping.
Quick comparison
| Method | Modality | ML required | Best for |
|---|---|---|---|
| GLiNER2 Extraction | Text | Small model on your CPU (zero-shot) | Exact facts with their position, plus categories, without labelled data |
| Regex | Text | No | Codes, IDs, structured patterns |
| AI Detector | Text | LLM (via provider) | Nuanced classification, structured extraction |
| Decision Detector | Text | Decision model (via provider) | Yes/no, pick-one and scale questions, answered with a probability |
| Text Classification | Text | Fine-tuned HF model | Spam, toxicity, sentiment, topic labels |
| Image Classification | Image | Fine-tuned HF model | NSFW, content moderation, custom image categories |
| Object Detection | Image | Object-detection HF model | Bounding-box localisation, label-based severity |
| Code detector | Any | No (bring your own) | Checks and rules: totals, lists, co-occurrence |
| Tag | — | No | Recording a fact the source system already holds |
When to use which method
Start with Regex if you have deterministic patterns — order numbers, internal codes, IBANs. No model, no latency, and the results are exact.
Use GLiNER2 Extraction when the answer is written in the text and you want the exact words back: parties, dates, amounts, product names, any concept you describe. It sorts text into categories in the same pass, runs on the scan’s own CPU, and needs no labelled data and no API key.
Use AI Detector for nuanced classification that would be hard to capture with a ruleset — risk signals, renewal intent, escalation tone, or any case where the context matters as much as the words.
Use a Decision Detector when you already know the possible answers and want a probability for each: is this a complaint, which team owns it, how urgent is it. A decision model returns numbers rather than text, so there is nothing to parse.
Use Text or Image Classification when you have a specific HuggingFace model already suited to your task. You get full control over the model checkpoint, device, and confidence threshold.
Use Object Detection when you need to locate objects in images with bounding boxes and map specific labels to severity levels.
Use a code detector when the rule is a check no pattern or model expresses: a total that must equal the sum of its parts, a name on a sanctions list, an IBAN next to a diagnosis, a metadata value past a threshold, a checksummed national ID, or scores from a model you trained yourself. You write detect(asset, ctx) in Python; it reads rows, text, bytes and metadata, and every finding carries a location and a stable identity.
Use a Tag when there is nothing to detect — the source system already knows the answer, and a classifier could only re-derive it less reliably. A Tag detector is applied from a Custom connector notebook by its key, and does not appear in a source’s detector list.
Classifyre creates semantic embeddings automatically during ingestion; they are infrastructure rather than detector findings.
Where a detector runs: scope
A custom detector is attached to a source, so by default it runs on everything the
source produces. Every detector type except Tag takes a scope in its pipeline
schema that narrows that. The fields are optional and combine with AND:
| Field | Runs only on | Example |
|---|---|---|
asset_kinds | assets of these kinds (record, document, page, file, table) | ["record"]: the derived summaries, not the documents they came from |
content_types | payloads of these MIME types or prefixes | ["application/pdf"] |
metadata | assets whose metadata has these values (compared as text) | {"record_type": "company_profile"} |
content_pattern | the pages whose text matches this regular expression (case-insensitive) | "free cash flow|freier cashflow" |
content_pattern is checked page by page. On a 500-page annual report a language
model asked about free cash flow then reads the dozen pages that use the term,
not the whole report: the cost of an expensive detector follows the pages that
can answer it. A payload without text (a picture, raw bytes) never matches; an
invalid pattern is logged and ignored rather than switching the detector off.
{
"type": "LLM",
"system_prompt": "Extract the free cash flow figure the company states for its own year …",
"scope": {
"asset_kinds": ["document"],
"content_pattern": "free cash flow|flux de trésorerie disponible|freier cashflow"
}
}