Represents a natural language processing library connector.

interface INLPLibraryConnector {
    getEntities(text: string, types: INLPEntityTypes): Promise<string[]>;
    getSentences(text: string): Promise<string[]>;
    getSimilarity(text1: string, text2: string): Promise<number>;
}

Methods

  • Extracts the entities from the text.

    Parameters

    • text: string

      The text to extract from.

    • types: INLPEntityTypes

      The types of entities to extract.

    Returns Promise<string[]>

    A promise that resolves with the entities.

  • Splits the text into sentences.

    Parameters

    • text: string

      The text to split.

    Returns Promise<string[]>

    A promise that resolves with the sentences.

  • Extracts the similarity between two texts.

    Parameters

    • text1: string

      The first text.

    • text2: string

      The second text.

    Returns Promise<number>

    A promise that resolves with the similarity between the texts. The value is between 0 and 1.