UNPKG

geneea-nlp-client

Version:

The TypeScript Client for Geneea Interpretor G3 API.

70 lines (69 loc) 3.27 kB
import { HasId } from "../../common/id"; import { GkbProperty, HasGkbProperties } from "./gkb-propert"; import { Sentence } from "./sentence"; import { HasSentiment, Sentiment } from "./sentiment"; import { TokenSupport, Token } from "./token"; import { HasVectors, Vector } from "./vector"; declare class Tag implements HasId, HasSentiment, HasVectors, HasGkbProperties { readonly id: string; gkbId: string | null; stdForm: string; type: string; relevance: number; mentions: TagMention[]; feats: Map<string, string>; sentiment: Sentiment | null; vectors: Vector[] | null; gkbProperties: GkbProperty[]; /** Type of the tag with the main topic of the document */ static readonly TYPE_TOPIC: string; /** Type of the tags with the topic distribution of the document */ static readonly TYPE_TOPIC_DISTRIBUTION = "topic.distribution"; /** * * @param id ID of the tag used to refer to it from other objects. * @param gkbId Unique identifier of this tag in Geneea knowledge-base. null if not found. * @param stdForm Standard form of the tag, abstracting from its alternative names. * @param type Domain-specific type (e.g. content, theme, iAB, department). * @param relevance Relevance of the tag relative to the content of the document. * @param mentions Text segments related to this tag. Empty if not appropriate/requested/supported. * @param feats Custom features. * @param sentiment Sentiment of this tag. Not supported yet. * @param vectors Optional vectors for this tag. * @param gkbProperties GKB properties. Since 3.3.0. */ private constructor(); /** Tag factory method, public constructor. */ static of(id: string, gkbId: string | null, stdForm: string, type: string, relevance: number, mentions?: TagMention[] | null, feats?: Map<string, string> | null, sentiment?: Sentiment | null, vectors?: Vector[] | null, gkbProperties?: GkbProperty[] | null): Tag; toString(): string; } /** A single occurence of a tag in the text. */ declare class TagMention implements HasSentiment, HasVectors { readonly id: string; tokens: TokenSupport; feats: Map<string, string>; sentiment: Sentiment | null; vectors: Vector[] | null; /** Tag this mention belongs to. Set from outsied. */ mentionOf: Tag; /** * * @param id ID of the mention used to refer to it from other objects. * @param tokens Tokens of this tag mention. * @param feats Custom features/properties. * @param sentiment Sentiment of this mention. Not supported yet. * @param vectors Optional vectors for this tag mention. */ private constructor(); /** TagMention factory method, public constructor. */ static of(id: string, tokens: Token[], feats?: Map<string, string> | null, sentiment?: Sentiment | null, vectors?: Vector[] | null): TagMention; /** * Sentence containing this tag mention. * Tag mention belongs to maximally one sentence; artificial mentions without tokens belong to no sentence. */ sentence(): Sentence; /** Checks whether the tag mention is continuous (most are). */ isContinuous(): boolean; toString(): string; } export { Tag, TagMention };