Skip to content

calculateGroundingScore

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-11-verification/grounding-checker.ts

Calculate grounding score for entity mentions against known entities.

For each mention, checks if it fuzzy-matches (Jaccard >= 0.5) any known entity.

  • score = matchedCount / totalMentions
  • Returns 0.5 (neutral) if totalMentions === 0

Signature

ts
function calculateGroundingScore(mentions: string[], knownEntities: string[]): GroundingScoreResult

Parameters

NameType
mentionsstring[]
knownEntitiesstring[]

Returns: GroundingScoreResult

Was this page helpful?

Download as PDF