Interface CitationVerifierConfig

Configuration for CitationVerifier.

interface CitationVerifierConfig {
    embedFn: ((texts) => Promise<number[][]>);
    supportThreshold?: number;
    unverifiableThreshold?: number;
    nliFn?: ((premise, hypothesis) => Promise<{
        label: "neutral" | "entailment" | "contradiction";
        score: number;
    }>);
    extractClaims?: ((text) => Promise<string[]>);
}

Properties

embedFn: ((texts) => Promise<number[][]>)

Batch embedding function: texts → embedding vectors.

Type declaration

    • (texts): Promise<number[][]>
    • Parameters

      • texts: string[]

      Returns Promise<number[][]>

supportThreshold?: number

Cosine similarity threshold for "supported". Default: 0.6

unverifiableThreshold?: number

Below this threshold, claim is "unverifiable". Default: 0.3

nliFn?: ((premise, hypothesis) => Promise<{
    label: "neutral" | "entailment" | "contradiction";
    score: number;
}>)

Optional NLI function for contradiction detection.

Type declaration

    • (premise, hypothesis): Promise<{
          label: "neutral" | "entailment" | "contradiction";
          score: number;
      }>
    • Parameters

      • premise: string
      • hypothesis: string

      Returns Promise<{
          label: "neutral" | "entailment" | "contradiction";
          score: number;
      }>

extractClaims?: ((text) => Promise<string[]>)

Optional claim extractor. Falls back to sentence splitting.

Type declaration

    • (text): Promise<string[]>
    • Parameters

      • text: string

      Returns Promise<string[]>