Skip to content

Detectors

Built-in rules find values with a fixed shape: emails, phone numbers, IBANs (mod-97 checked), payment cards (Luhn checked), IP and MAC addresses, US social security numbers, API keys with known prefixes, private keys, JSON web tokens and key=value secrets. Topic classes are found from the catalog's cue phrases and the model's concept cues.

Custom detectors

Names, addresses, organizations and free-text meaning need a machine-learning model. Any object with a name and a find(text) method that yields spans is a detector:

from opp_engine.detect import RuleDetector, Span
from opp_engine.engine import Engine

class MyNer:
    name = "my-ner"
    def find(self, text):
        for start, end, label in my_model(text):          # label: PERSON, ADDRESS, ORG, ...
            yield Span(label, start, end, score=0.9, detector=self.name)

engine = Engine(model, detectors=[RuleDetector(), MyNer()])

Span types map to classes through the catalog's hints.value_types. The generator uses the same detectors, so a model that finds names in prompts also finds name columns whose headers say nothing.

OPP Model

OPP Model is the project's open-weight detector. One release folder (model.onnx, tokenizer.json, labels.json) adds values in free text, topic probabilities without cue words, and meaning-based matching of an organization's own concepts.

opp-engine serve acme.opp.yaml --mcp --opp-model ./opp-model-v1      # or OPP_MODEL=./opp-model-v1

Source: src/opp_engine/detect.py.