An object encapsulating the results of NLP analysis.

Implements

Constructors

  • Creates an Analysis object.

    Parameters

    • docId: null | string = null

      Document id.

    • language: Language

      Language of the document and analysis.

    • paragraphs: Paragraph[]

      The paragraphs within the document. For F2, these are segments.

    • docSentiment: null | Sentiment = null

      Sentiment of the document.

    • entities: Entity[]

      The entities in the document.

    • tags: Tag[]

      The tags of the document.

    • relations: Relation[]

      The relations in the document.

    • docVectors: null | Vector[] = null

      Optional vectors for the whole document.

    • usedChars: null | number = null

      Characters billed for the analysis.

    • metadata: null | Map<string, unknown> = null

      The extra non-NLP type of information related to analysis.

    • debugInfo: unknown = null

      Debugging information, if any.

    Returns Analysis

Properties

debugInfo: unknown = null

Debugging information, if any.

docId: null | string = null

Document id.

docSentiment: null | Sentiment = null

Sentiment of the document.

docVectors: null | Vector[] = null

Optional vectors for the whole document.

entities: Entity[]

The entities in the document.

language: Language

Language of the document and analysis.

metadata: null | Map<string, unknown> = null

The extra non-NLP type of information related to analysis.

paragraphs: Paragraph[]

The paragraphs within the document. For F2, these are segments.

relations: Relation[]

The relations in the document.

tags: Tag[]

The tags of the document.

usedChars: null | number = null

Characters billed for the analysis.

Accessors

Methods

  • Returns a paragraph with the specified type. Throws IllegalArgumentException if there are more than one such paragraphs, and return null if there are none. This is intended for legacy paragraphs corresponding to title/lead/text segments.

    For standard types, use these predefined constants: [Paragraph.TYPE_TITLE], [Paragraph.TYPE_ABSTRACT], [Paragraph.TYPE_BODY], [Paragraph.TYPE_SECTION_HEADING], or dedicated methods: [title], [lead], [body].

    Parameters

    • paraType: string

    Returns null | Paragraph

  • Returns the top [n] tags sorted by relevance in descending order.

    Parameters

    • n: number = -1

    Returns Tag[]