app.backend.claim_splitter

Atomic claim decomposition for /api/analyse.

Primary path: prompt the HF generation model to break its response into atomic, self-contained factual claims. This mirrors the decomposition step of fact-checking pipelines such as FActScore (Min et al. 2023).

Fallback: NLTK sentence segmentation when the LLM path fails (missing token, API error, or unparseable output). Sentences are a coarser unit but keep the endpoint functional instead of returning nothing.

Functions

decompose_into_claims(text)

Split an LLM response into atomic, self-contained claims.

app.backend.claim_splitter.decompose_into_claims(text: str) list[str][source]

Split an LLM response into atomic, self-contained claims.

Tries LLM-based atomic decomposition first; on failure, falls back to NLTK sentence segmentation.