MentionFilter

interface MentionFilter

Filter for validating entity mentions during proposition extraction.

Filters can reject low-quality mentions (vague references, overly long spans, generic descriptions) before they create entities in the knowledge graph.

Example usage:

// Schema-driven validation (recommended)
val filter = SchemaValidatedMentionFilter(dataDictionary)

// Or context-aware filtering
val contextFilter = CompositeMentionFilter(listOf(
SchemaValidatedMentionFilter(dataDictionary),
PropositionDuplicateFilter()
))

if (filter.isValid(mention, propositionText)) {
// Create entity from mention
}

Inheritors

Functions

Link copied to clipboard
abstract fun isValid(mention: SuggestedMention, propositionText: String): Boolean

Validates whether an entity mention should be included in entity resolution.

Link copied to clipboard

Optional: Provides reason for rejection (useful for debugging/logging).