SentenceContextCompressor

class SentenceContextCompressor(maxSentences: Int = 3, includeSurrounding: Boolean = true) : ContextCompressor

Extracts context by finding sentences containing the entity.

Parameters

maxSentences

Maximum sentences to include

includeSurrounding

Include sentences before/after mention

Constructors

Link copied to clipboard
constructor(maxSentences: Int = 3, includeSurrounding: Boolean = true)

Functions

Link copied to clipboard
open override fun compress(sourceText: String?, entityName: String): String?

Compress source text to extract relevant context for entity resolution.

Link copied to clipboard
open fun compressForAll(sourceText: String?, entityNames: List<String>): String?

Compress source text for multiple entities at once. May be more efficient than calling compress repeatedly.