docs(examples): add semantix-ai semantic validation example#1843
docs(examples): add semantix-ai semantic validation example#1843labrat-akhona wants to merge 1 commit into
Conversation
|
I took a look at the repo but could not see |
|
Hey @RobinPicard — fair catch, thanks for taking the time to look. You're right: semantix-ai doesn't depend on Given that, I don't think
Let me know which you prefer and I'll action it. |
|
Hi @labrat-akhona, sorry for the delay. 1 sounds good, it could in the |
Adds a runnable example showing how outlines (structural decoding) and semantix-ai (semantic intent validation via local NLI) compose: outlines guarantees the response parses, semantix-ai checks that the generated string actually means what was asked for. The script also scores a deliberately rude counterexample to show how semantix catches a violation that a schema check cannot. Per maintainer feedback on dottxt-ai#1843 — drops the docs/community/examples.md entry (semantix-ai does not depend on outlines) and replaces it with a real worked example in examples/.
e571d0f to
c892da4
Compare
|
Hey @RobinPicard — thanks for the steer. Pushed a fresh revision:
The example uses Happy to adjust naming / docstring style / move it into a subdirectory if you'd prefer — just let me know. |
|
Looks good. I just changed my mind on the location, could you put it in |
Summary
Adds a runnable example to
examples/showing howoutlines(structural decoding) andsemantix-ai(semantic intent validation via local NLI) compose:outlinesguarantees the response parses against a JSON schema.semantix-aichecks that the generated string actually means what was asked for, using a local cross-encoder NLI model (no API key required).The script generates a structured customer-support reply with
outlines, then scores thereplyfield for tone withsemantix-ai. It also scores a deliberately rude counterexample with the same judge — same schema, different semantics — to make the failure modeoutlinescannot catch on its own concrete.What changed since the previous revision
Per @RobinPicard's earlier feedback (
semantix-aidoesn't depend onoutlines, sodocs/community/examples.mdwasn't the right home), this revision:docs/community/examples.mdentry.examples/semantix_semantic_validation.py.mainso the diff is just the new file.Run
semantix-ai: https://github.com/labrat-akhona/semantix-ai