Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 977 Bytes

README.md

File metadata and controls

50 lines (35 loc) · 977 Bytes

entitizer.entities-extractor

Extract entities from a context. Entities are Named-entities, stored/learned by Entitizer.

Usage

var extractor = require('entitizer.entities-extractor');
var context = { text: 'Some long text... London.', lang: 'ro', country: 'md' };
extractor.extract(context)
  .then(data => {

  });

API

extract(context: Context, repository: Repository, formatKey: formatKeyFunc): Promise

Extracts entities from a context and a repository.

Input data:

type Context = {
  text: string
  lang: string
  country?: string
}

export interface Repository<T extends Entity> {
    entitiesByIds(ids: string[]): Promise<T[]>
    entityIdsByKeys(keys: string[]): Promise<PlainObject<string[]>>
}

interface formatKeyFunc {
    (name: string, lang: string): string
}

Output data:

type ExtractData = {

}

LICENSE

Private: Entitizer, Dumitru Cantea.