Table of Contents

Class EntityLinking<T>

Namespace
AiDotNet.Postprocessing.Document
Assembly
AiDotNet.dll

EntityLinking - Entity extraction and linking for document text.

public class EntityLinking<T> : PostprocessorBase<T, string, IList<Entity>>, IPostprocessor<T, string, IList<Entity>>, IDisposable

Type Parameters

T

The numeric type for calculations.

Inheritance
EntityLinking<T>
Implements
Inherited Members

Remarks

EntityLinking identifies named entities in document text and links them to canonical representations or external knowledge bases.

For Beginners: Documents contain references to people, places, organizations, and other entities. This tool identifies them:

  • Extract named entities (people, places, organizations)
  • Link entities to canonical forms
  • Resolve entity references
  • Build entity relationships

Key features:

  • Named entity recognition
  • Entity disambiguation
  • Reference resolution
  • Relationship extraction

Example usage:

var linker = new EntityLinking<float>();
var entities = linker.Process(documentText);

Constructors

EntityLinking()

Creates a new EntityLinking instance.

public EntityLinking()

Properties

SupportsInverse

Entity linking does not support inverse transformation.

public override bool SupportsInverse { get; }

Property Value

bool

Methods

AddAlias(string, string)

Adds an alias for an existing entity.

public void AddAlias(string canonicalName, string alias)

Parameters

canonicalName string
alias string

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases resources used by the entity linker.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

ExtractDates(string)

Extracts dates from text.

public IList<Entity> ExtractDates(string text)

Parameters

text string

Returns

IList<Entity>

ExtractEmails(string)

Extracts email addresses from text.

public IList<Entity> ExtractEmails(string text)

Parameters

text string

Returns

IList<Entity>

ExtractMoneyAmounts(string)

Extracts money amounts from text.

public IList<Entity> ExtractMoneyAmounts(string text)

Parameters

text string

Returns

IList<Entity>

ExtractOrganizations(string)

Extracts organization names from text.

public IList<Entity> ExtractOrganizations(string text)

Parameters

text string

Returns

IList<Entity>

ExtractPersons(string)

Extracts person names from text.

public IList<Entity> ExtractPersons(string text)

Parameters

text string

Returns

IList<Entity>

ExtractPhoneNumbers(string)

Extracts phone numbers from text.

public IList<Entity> ExtractPhoneNumbers(string text)

Parameters

text string

Returns

IList<Entity>

ExtractUrls(string)

Extracts URLs from text.

public IList<Entity> ExtractUrls(string text)

Parameters

text string

Returns

IList<Entity>

LinkEntity(Entity)

Links an entity to its canonical form.

public Entity? LinkEntity(Entity entity)

Parameters

entity Entity

Returns

Entity

ProcessCore(string)

Extracts all entities from the text.

protected override IList<Entity> ProcessCore(string input)

Parameters

input string

The text to analyze.

Returns

IList<Entity>

List of extracted entities.

RegisterEntity(Entity, IEnumerable<string>?)

Registers a known entity with optional aliases.

public void RegisterEntity(Entity entity, IEnumerable<string>? aliases = null)

Parameters

entity Entity
aliases IEnumerable<string>

ValidateInput(string)

Validates the input text.

protected override void ValidateInput(string input)

Parameters

input string