Skip to content

Commit 6738628

Browse files
committed
Release v0.3.0 with default claimify extraction
1 parent 021c16d commit 6738628

13 files changed

Lines changed: 3036 additions & 37 deletions

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,53 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.0] - 2026-04-27
9+
10+
### Added
11+
12+
- **Deterministic `extractor="claimify"`** - Claimify-inspired claim
13+
extraction for the default local extraction path.
14+
- **Internal detailed extraction records** - `ClaimExtractor.extract_detailed()`
15+
returns per-claim text, source sentence, extraction method, and flags while
16+
`extract()` remains backwards-compatible as `list[str]`.
17+
- **Deterministic factual-claim selection** - drops clear opinion, directive,
18+
and meta/filler sentences before provenance matching.
19+
- **Claimify ambiguity flags** - detailed claimify records mark unresolved
20+
pronoun-led factual claims with `ambiguous_reference`.
21+
- **Conservative compound-claim decomposition** - splits simple shared-subject
22+
verb lists into smaller claim units when the split is unambiguous.
23+
- **Safer decomposition and list handling** - claimify now handles shared
24+
subject predicate lists, conservative support/include object lists,
25+
independently valid semicolon clauses, and simple lead-in bullet/numbered
26+
lists.
27+
- **Order-preserving claimify deduplication** - duplicate claims are removed
28+
after quality gates while preserving the first extracted spelling/casing.
29+
- **Claim extraction benchmark harness** - `python
30+
benchmarks/run_claim_extraction.py` compares current extractors against the
31+
public `microsoft/claimify-dataset` factual-claim selection labels.
32+
- **No LLM/API/model dependency** - the `claimify` extractor is local,
33+
rule-based, and adds no mandatory runtime dependencies.
34+
35+
### Changed
36+
37+
- **Default extractor changed to `claimify`** - zero-config audits now use the
38+
deterministic Claimify-inspired extractor by default while preserving
39+
`extractor="regex"` for the legacy sentence splitter. Users who want the
40+
previous sentence-splitting behavior can set `Config(extractor="regex")`.
41+
- **Hardened claimify selection** - the default extractor now requires
42+
non-trivial predicates, preserves useful product/configuration claims, and
43+
drops more generic advice, meta text, opinion, and vague pronoun claims.
44+
- **Benchmark-guided claimify tuning** - selection rules now recover more
45+
short, passive, modal, copula, and pronoun-led factual claims while filtering
46+
more assistant filler, broad setup text, and list headers.
47+
- **Claimify default-readiness hardening** - improved
48+
definitional/classification claim retention, short bullet fact handling, and
49+
filler/header/citation-fragment filtering before the default flip, without
50+
adding runtime dependencies.
51+
- **Refreshed claimify selection benchmark results** - the development
52+
benchmark summary now reports `claimify` at 0.742 precision, 0.881 recall,
53+
and 0.805 F1 on the public factual-claim selection labels.
54+
855
## [0.1.3]
956

1057
### Added
@@ -268,5 +315,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
268315
internals with `unittest.mock` have been migrated to `pytest`'s `monkeypatch`
269316
fixture for consistency with the rest of the test suite.
270317

318+
[0.3.0]: https://github.com/Vbj1808/dokis/releases/tag/v0.3.0
319+
[0.2.0]: https://github.com/Vbj1808/dokis/releases/tag/v0.2.0
320+
[0.1.3]: https://github.com/Vbj1808/dokis/releases/tag/v0.1.3
321+
[0.1.2]: https://github.com/Vbj1808/dokis/releases/tag/v0.1.2
271322
[0.1.1]: https://github.com/Vbj1808/dokis/releases/tag/v0.1.1
272323
[0.1.0]: https://github.com/Vbj1808/dokis/releases/tag/v0.1.0

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Dokis does three trust checks in one deterministic runtime pass:
3939

4040
**1. Pre-retrieval enforcement.** Strip chunks whose source URL is not on your allowlist before they enter the prompt.
4141

42-
**2. Post-generation support auditing.** Split the response into atomic claim sentences. Match each claim to the best supporting chunk using BM25 lexical scoring by default. Build a `claim → chunk → URL` provenance map. Compute a compliance rate.
42+
**2. Post-generation support auditing.** Extract verifiable factual claims from the response using the default deterministic Claimify-inspired extractor. Match each claim to the best supporting chunk using BM25 lexical scoring by default. Build a `claim → chunk → URL` provenance map. Compute a compliance rate.
4343

4444
**3. Temporal trust evaluation.** If freshness policy is configured, derive source age from chunk metadata and distinguish `supported_fresh`, `supported_stale`, and `unsupported`. Return stale-source details, freshness-aware claim verdicts, policy issues, and a final trust verdict.
4545

@@ -200,7 +200,7 @@ dokis.Config(
200200
allowed_domains = [],
201201
min_citation_rate = 0.80,
202202
claim_threshold = 0.35,
203-
extractor = "regex", # "regex" | "nltk" | "llm"
203+
extractor = "claimify", # "claimify" | "regex" | "nltk" | "llm"
204204
matcher = "bm25", # "bm25" | "semantic"
205205
model = "all-MiniLM-L6-v2",
206206
enforcement_mode = "guardrail", # "audit" | "guardrail" | "enforce"
@@ -215,6 +215,44 @@ dokis.Config(
215215
`enforcement_mode="enforce"`, but `enforcement_mode` is the recommended
216216
interface for new configs and examples.
217217

218+
`extractor="claimify"` is the default deterministic extractor. It is
219+
English-oriented and Claimify-inspired, with verifiable-claim selection,
220+
conservative decomposition, and simple bullet/list handling for RAG-style
221+
answers. It does not reproduce Claimify, does not perform citation
222+
faithfulness checks or full decontextualization, and does not add an LLM, API,
223+
model, or mandatory dependency. The legacy splitter remains available with
224+
`extractor="regex"` for users who want the old sentence-boundary behavior.
225+
226+
### Claim extraction benchmark
227+
228+
Dokis now uses `extractor="claimify"` by default. The goal is better
229+
factual-claim selection before provenance matching, without adding an LLM call,
230+
model download, runtime network call, or mandatory dependency.
231+
232+
On the public `microsoft/claimify-dataset` factual-claim selection benchmark:
233+
234+
| Extractor | Precision | Recall | F1 |
235+
|---|---:|---:|---:|
236+
| `regex` | 0.645 | 0.975 | 0.776 |
237+
| `nltk` | 0.645 | 0.976 | 0.776 |
238+
| `claimify` default | **0.742** | 0.881 | **0.805** |
239+
240+
This benchmark measures Selection-stage factual-claim detection only. It does
241+
not measure full Claimify reproduction, element-level coverage, citation
242+
faithfulness, answer correctness, or hallucination prevention.
243+
244+
For development feedback, the claim selection benchmark can be run from the
245+
repo root:
246+
247+
```bash
248+
python benchmarks/run_claim_extraction.py
249+
```
250+
251+
It downloads the public `microsoft/claimify-dataset` CSV at benchmark runtime
252+
and compares extractor selection against the dataset's
253+
`contains_factual_claim` labels. This benchmark is not part of the runtime
254+
package contract and adds no mandatory dependency.
255+
218256
**`claim_threshold` by matcher:**
219257
- `matcher="bm25"`: normalised per-query BM25 score. Recommended: `0.3–0.5`.
220258
- `matcher="semantic"`: cosine similarity. Recommended: `0.65–0.85`.
@@ -326,7 +364,7 @@ BM25 is **23× faster** per audit call. The BM25 index is cached per chunk set -
326364
| `bm25` (default) | 5/5 | 4/4 ✦ |
327365
| `semantic` | 5/5 | 4/4 ✦ |
328366

329-
One claim was 7 words - below the 8-word minimum - and filtered before matching. Effective ungrounded rejection rate is 100% for both matchers.
367+
In this tiny hand-written benchmark, both matchers rejected all ungrounded claims that reached the matcher, for an effective ungrounded rejection rate of 100%.
330368

331369
---
332370

benchmarks/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Benchmark helpers for Dokis development."""

0 commit comments

Comments
 (0)