Interface IEntityLinker<T>

Namespace
NOpenNLP.Tools.Entitylinker
Assembly
NOpenNLP.Tools.dll

EntityLinkers establish connections to external data to enrich extracted entities. For instance, for Location entities a linker can be developed to lookup each found location in a geonames gazateer. Another example may be to find peoples' names and look them up in a database or active directory. Intended to return n best matches for any give search, but can also be implemented as deterministic.

public interface IEntityLinker<T> : IEntityLinker where T : Span

Type Parameters

T

A type that extends Span. LinkedSpan<T> and BaseLink are provided to provide this signature: IEntityLinker<LinkedSpan<BaseLink>> as a default.

Inherited Members

Methods

Find(string, Span[], Span[][], Span[][])

Links an entire document of named entities to an external source.

IList<T> Find(string doctext, Span[] sentences, Span[][] tokensBySentence, Span[][] namesBySentence)

Parameters

doctext string

The full text of the document.

sentences Span[]

The sentence spans of the document.

tokensBySentence Span[][]

A list of tokens spans that correspond to each sentence. The outer array refers to the sentence, the inner array is the tokens for the outer sentence.

namesBySentence Span[][]

A list of name spans that correspond to each sentence. The outer array refers to the sentence, the inner array refers to the tokens that for the same sentence.

Returns

IList<T>

Find(string, Span[], Span[][], Span[][], int)

Links the names that correspond to the tokens[] spans. The sentence index can be used to get the sentence text and tokens from the text based on the sentence and token spans. The text is available for additional context.

IList<T> Find(string doctext, Span[] sentences, Span[][] tokensBySentence, Span[][] namesBySentence, int sentenceIndex)

Parameters

doctext string

The full text of the document.

sentences Span[]

The sentence spans of the document.

tokensBySentence Span[][]

A list of tokens spans that correspond to each sentence. The outer array refers to the sentence, the inner array is the tokens for the outer sentence.

namesBySentence Span[][]

A list of name spans that correspond to each sentence. The outer array refers to the sentence, the inner array refers to the tokens that for the same sentence.

sentenceIndex int

The index to the sentence span that the tokens[] Span[] corresponds to.

Returns

IList<T>