UNPKG

arg-services

Version:

Protobuf and gRPC definitions for microservice-based argumentation machines

1,118 lines (986 loc) 33.4 kB
// @generated by protoc-gen-es v2.5.0 with parameter "target=js+dts,import_extension=js,json_types=true" // @generated from file arg_services/nlp/v1/nlp.proto (package arg_services.nlp.v1, syntax proto3) /* eslint-disable */ // Service for offloading computationally complex NLP tasks. import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import type { JsonObject, Message } from "@bufbuild/protobuf"; import type { StructJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file arg_services/nlp/v1/nlp.proto. */ export declare const file_arg_services_nlp_v1_nlp: GenFile; /** * Common message for configuring spacy. * * @generated from message arg_services.nlp.v1.NlpConfig */ export declare type NlpConfig = Message<"arg_services.nlp.v1.NlpConfig"> & { /** * Any language supported by spacy (e.g., `en`). * [Reference](https://spacy.io/usage/models#languages). * * @generated from field: string language = 1; */ language: string; /** * Name of the trained spacy pipeline (e.g., `en_core_web_lg`). * If empty, a blank spacy model will be used (e.g., if you only need embeddings and provide custom `embedding_models`. * [Example: English models](https://spacy.io/models/en). * * @generated from field: string spacy_model = 2; */ spacyModel: string; /** * List of embeddings to use for computing word/sentence vectors. * If given, these embeddings will **override** the embeddings of the specified `spacy_model`. * Multiple models are concatenated to each other, increasing the length of the resulting vector. * * @generated from field: repeated arg_services.nlp.v1.EmbeddingModel embedding_models = 3; */ embeddingModels: EmbeddingModel[]; /** * Mathematical function to determine a similarity score given two strings. * * @generated from field: arg_services.nlp.v1.SimilarityMethod similarity_method = 4; */ similarityMethod: SimilarityMethod; }; /** * Common message for configuring spacy. * * @generated from message arg_services.nlp.v1.NlpConfig */ export declare type NlpConfigJson = { /** * Any language supported by spacy (e.g., `en`). * [Reference](https://spacy.io/usage/models#languages). * * @generated from field: string language = 1; */ language?: string; /** * Name of the trained spacy pipeline (e.g., `en_core_web_lg`). * If empty, a blank spacy model will be used (e.g., if you only need embeddings and provide custom `embedding_models`. * [Example: English models](https://spacy.io/models/en). * * @generated from field: string spacy_model = 2; */ spacyModel?: string; /** * List of embeddings to use for computing word/sentence vectors. * If given, these embeddings will **override** the embeddings of the specified `spacy_model`. * Multiple models are concatenated to each other, increasing the length of the resulting vector. * * @generated from field: repeated arg_services.nlp.v1.EmbeddingModel embedding_models = 3; */ embeddingModels?: EmbeddingModelJson[]; /** * Mathematical function to determine a similarity score given two strings. * * @generated from field: arg_services.nlp.v1.SimilarityMethod similarity_method = 4; */ similarityMethod?: SimilarityMethodJson; }; /** * Describes the message arg_services.nlp.v1.NlpConfig. * Use `create(NlpConfigSchema)` to create a new message. */ export declare const NlpConfigSchema: GenMessage<NlpConfig, {jsonType: NlpConfigJson}>; /** * @generated from message arg_services.nlp.v1.SimilaritiesRequest */ export declare type SimilaritiesRequest = Message<"arg_services.nlp.v1.SimilaritiesRequest"> & { /** * Spacy config. * * @generated from field: arg_services.nlp.v1.NlpConfig config = 1; */ config?: NlpConfig; /** * List of string pairs to compare. * * @generated from field: repeated arg_services.nlp.v1.TextTuple text_tuples = 2; */ textTuples: TextTuple[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * @generated from message arg_services.nlp.v1.SimilaritiesRequest */ export declare type SimilaritiesRequestJson = { /** * Spacy config. * * @generated from field: arg_services.nlp.v1.NlpConfig config = 1; */ config?: NlpConfigJson; /** * List of string pairs to compare. * * @generated from field: repeated arg_services.nlp.v1.TextTuple text_tuples = 2; */ textTuples?: TextTupleJson[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.SimilaritiesRequest. * Use `create(SimilaritiesRequestSchema)` to create a new message. */ export declare const SimilaritiesRequestSchema: GenMessage<SimilaritiesRequest, {jsonType: SimilaritiesRequestJson}>; /** * @generated from message arg_services.nlp.v1.SimilaritiesResponse */ export declare type SimilaritiesResponse = Message<"arg_services.nlp.v1.SimilaritiesResponse"> & { /** * List of similarities ordered just like the original `text_tuples`. * * @generated from field: repeated double similarities = 1; */ similarities: number[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * @generated from message arg_services.nlp.v1.SimilaritiesResponse */ export declare type SimilaritiesResponseJson = { /** * List of similarities ordered just like the original `text_tuples`. * * @generated from field: repeated double similarities = 1; */ similarities?: (number | "NaN" | "Infinity" | "-Infinity")[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.SimilaritiesResponse. * Use `create(SimilaritiesResponseSchema)` to create a new message. */ export declare const SimilaritiesResponseSchema: GenMessage<SimilaritiesResponse, {jsonType: SimilaritiesResponseJson}>; /** * Store a pair of strings. * * @generated from message arg_services.nlp.v1.TextTuple */ export declare type TextTuple = Message<"arg_services.nlp.v1.TextTuple"> & { /** * @generated from field: string text1 = 1; */ text1: string; /** * @generated from field: string text2 = 2; */ text2: string; }; /** * Store a pair of strings. * * @generated from message arg_services.nlp.v1.TextTuple */ export declare type TextTupleJson = { /** * @generated from field: string text1 = 1; */ text1?: string; /** * @generated from field: string text2 = 2; */ text2?: string; }; /** * Describes the message arg_services.nlp.v1.TextTuple. * Use `create(TextTupleSchema)` to create a new message. */ export declare const TextTupleSchema: GenMessage<TextTuple, {jsonType: TextTupleJson}>; /** * Wrapper message to encode a list of strings that can also be `null`. * * @generated from message arg_services.nlp.v1.Strings */ export declare type Strings = Message<"arg_services.nlp.v1.Strings"> & { /** * @generated from field: repeated string values = 1; */ values: string[]; }; /** * Wrapper message to encode a list of strings that can also be `null`. * * @generated from message arg_services.nlp.v1.Strings */ export declare type StringsJson = { /** * @generated from field: repeated string values = 1; */ values?: string[]; }; /** * Describes the message arg_services.nlp.v1.Strings. * Use `create(StringsSchema)` to create a new message. */ export declare const StringsSchema: GenMessage<Strings, {jsonType: StringsJson}>; /** * @generated from message arg_services.nlp.v1.DocBinRequest */ export declare type DocBinRequest = Message<"arg_services.nlp.v1.DocBinRequest"> & { /** * Spacy config. * * @generated from field: arg_services.nlp.v1.NlpConfig config = 1; */ config?: NlpConfig; /** * List of strings to be processed. * * @generated from field: repeated string texts = 2; */ texts: string[]; /** * Attributes that shall be included in the DocBin object. * Defaults to `("ORTH", "TAG", "HEAD", "DEP", "ENT_IOB", "ENT_TYPE", "ENT_KB_ID", "LEMMA", "MORPH", "POS")`. * Possible values: `("IS_ALPHA", "IS_ASCII", "IS_DIGIT", "IS_LOWER", "IS_PUNCT", "IS_SPACE", "IS_TITLE", "IS_UPPER", "LIKE_URL", "LIKE_NUM", "LIKE_EMAIL", "IS_STOP", "IS_OOV_DEPRECATED", "IS_BRACKET", "IS_QUOTE", "IS_LEFT_PUNCT", "IS_RIGHT_PUNCT", "IS_CURRENCY", "ID", "ORTH", "LOWER", "NORM", "SHAPE", "PREFIX", "SUFFIX", "LENGTH", "CLUSTER", "LEMMA", "POS", "TAG", "DEP", "ENT_IOB", "ENT_TYPE", "ENT_ID", "ENT_KB_ID", "HEAD", "SENT_START", "SENT_END", "SPACY", "PROB", "LANG", "MORPH", "IDX")`. * [Documentation](https://spacy.io/api/token#attributes). * * @generated from field: optional arg_services.nlp.v1.Strings attributes = 3; */ attributes?: Strings; /** * List of pipeline components that shall be enabled/disabled when processing documents. * If only certain attributed (e.g. POS tags) are relevant, one can enhance the performance by selecting components. * **Important**: There may be custom spacy components that are required for some of the functionality of the NLP service. * In the reference implementation, this applies to the components `embedding_models` and `similarity_method`. * * @generated from oneof arg_services.nlp.v1.DocBinRequest.pipes */ pipes: { /** * @generated from field: arg_services.nlp.v1.Strings enabled_pipes = 4; */ value: Strings; case: "enabledPipes"; } | { /** * @generated from field: arg_services.nlp.v1.Strings disabled_pipes = 5; */ value: Strings; case: "disabledPipes"; } | { case: undefined; value?: undefined }; /** * List of vectors that shall be saved in the `DocBin` object. * The computation is time-consuming, so you should only specify the embeddings you actually use! * * @generated from field: repeated arg_services.nlp.v1.EmbeddingLevel embedding_levels = 6; */ embeddingLevels: EmbeddingLevel[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * @generated from message arg_services.nlp.v1.DocBinRequest */ export declare type DocBinRequestJson = { /** * Spacy config. * * @generated from field: arg_services.nlp.v1.NlpConfig config = 1; */ config?: NlpConfigJson; /** * List of strings to be processed. * * @generated from field: repeated string texts = 2; */ texts?: string[]; /** * Attributes that shall be included in the DocBin object. * Defaults to `("ORTH", "TAG", "HEAD", "DEP", "ENT_IOB", "ENT_TYPE", "ENT_KB_ID", "LEMMA", "MORPH", "POS")`. * Possible values: `("IS_ALPHA", "IS_ASCII", "IS_DIGIT", "IS_LOWER", "IS_PUNCT", "IS_SPACE", "IS_TITLE", "IS_UPPER", "LIKE_URL", "LIKE_NUM", "LIKE_EMAIL", "IS_STOP", "IS_OOV_DEPRECATED", "IS_BRACKET", "IS_QUOTE", "IS_LEFT_PUNCT", "IS_RIGHT_PUNCT", "IS_CURRENCY", "ID", "ORTH", "LOWER", "NORM", "SHAPE", "PREFIX", "SUFFIX", "LENGTH", "CLUSTER", "LEMMA", "POS", "TAG", "DEP", "ENT_IOB", "ENT_TYPE", "ENT_ID", "ENT_KB_ID", "HEAD", "SENT_START", "SENT_END", "SPACY", "PROB", "LANG", "MORPH", "IDX")`. * [Documentation](https://spacy.io/api/token#attributes). * * @generated from field: optional arg_services.nlp.v1.Strings attributes = 3; */ attributes?: StringsJson; /** * @generated from field: arg_services.nlp.v1.Strings enabled_pipes = 4; */ enabledPipes?: StringsJson; /** * @generated from field: arg_services.nlp.v1.Strings disabled_pipes = 5; */ disabledPipes?: StringsJson; /** * List of vectors that shall be saved in the `DocBin` object. * The computation is time-consuming, so you should only specify the embeddings you actually use! * * @generated from field: repeated arg_services.nlp.v1.EmbeddingLevel embedding_levels = 6; */ embeddingLevels?: EmbeddingLevelJson[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.DocBinRequest. * Use `create(DocBinRequestSchema)` to create a new message. */ export declare const DocBinRequestSchema: GenMessage<DocBinRequest, {jsonType: DocBinRequestJson}>; /** * @generated from message arg_services.nlp.v1.DocBinResponse */ export declare type DocBinResponse = Message<"arg_services.nlp.v1.DocBinResponse"> & { /** * Serialized [`DocBin`](https://spacy.io/api/docbin) object * * @generated from field: bytes docbin = 1; */ docbin: Uint8Array; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * @generated from message arg_services.nlp.v1.DocBinResponse */ export declare type DocBinResponseJson = { /** * Serialized [`DocBin`](https://spacy.io/api/docbin) object * * @generated from field: bytes docbin = 1; */ docbin?: string; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.DocBinResponse. * Use `create(DocBinResponseSchema)` to create a new message. */ export declare const DocBinResponseSchema: GenMessage<DocBinResponse, {jsonType: DocBinResponseJson}>; /** * @generated from message arg_services.nlp.v1.VectorsRequest */ export declare type VectorsRequest = Message<"arg_services.nlp.v1.VectorsRequest"> & { /** * Spacy config. * * @generated from field: arg_services.nlp.v1.NlpConfig config = 1; */ config?: NlpConfig; /** * List of strings that shall be embedded (i.e., converted to vectors). * * @generated from field: repeated string texts = 2; */ texts: string[]; /** * List of vectors that shall be returned. * The computation is time-consuming, so you should only specify the embeddings you actually use! * * @generated from field: repeated arg_services.nlp.v1.EmbeddingLevel embedding_levels = 3; */ embeddingLevels: EmbeddingLevel[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * @generated from message arg_services.nlp.v1.VectorsRequest */ export declare type VectorsRequestJson = { /** * Spacy config. * * @generated from field: arg_services.nlp.v1.NlpConfig config = 1; */ config?: NlpConfigJson; /** * List of strings that shall be embedded (i.e., converted to vectors). * * @generated from field: repeated string texts = 2; */ texts?: string[]; /** * List of vectors that shall be returned. * The computation is time-consuming, so you should only specify the embeddings you actually use! * * @generated from field: repeated arg_services.nlp.v1.EmbeddingLevel embedding_levels = 3; */ embeddingLevels?: EmbeddingLevelJson[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.VectorsRequest. * Use `create(VectorsRequestSchema)` to create a new message. */ export declare const VectorsRequestSchema: GenMessage<VectorsRequest, {jsonType: VectorsRequestJson}>; /** * @generated from message arg_services.nlp.v1.VectorsResponse */ export declare type VectorsResponse = Message<"arg_services.nlp.v1.VectorsResponse"> & { /** * List of vectors whose order corresponds to the one of `texts`. * * @generated from field: repeated arg_services.nlp.v1.VectorResponse vectors = 1; */ vectors: VectorResponse[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * @generated from message arg_services.nlp.v1.VectorsResponse */ export declare type VectorsResponseJson = { /** * List of vectors whose order corresponds to the one of `texts`. * * @generated from field: repeated arg_services.nlp.v1.VectorResponse vectors = 1; */ vectors?: VectorResponseJson[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.VectorsResponse. * Use `create(VectorsResponseSchema)` to create a new message. */ export declare const VectorsResponseSchema: GenMessage<VectorsResponse, {jsonType: VectorsResponseJson}>; /** * Container object that includes vectors for all levels specified in `embedding_levels`. * * @generated from message arg_services.nlp.v1.VectorResponse */ export declare type VectorResponse = Message<"arg_services.nlp.v1.VectorResponse"> & { /** * One vector for the whole string. * * @generated from field: arg_services.nlp.v1.Vector document = 1; */ document?: Vector; /** * Vectors for all tokens in the string. * * @generated from field: repeated arg_services.nlp.v1.Vector tokens = 2; */ tokens: Vector[]; /** * Vectors for all sentences found in the string. * * @generated from field: repeated arg_services.nlp.v1.Vector sentences = 3; */ sentences: Vector[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: JsonObject; }; /** * Container object that includes vectors for all levels specified in `embedding_levels`. * * @generated from message arg_services.nlp.v1.VectorResponse */ export declare type VectorResponseJson = { /** * One vector for the whole string. * * @generated from field: arg_services.nlp.v1.Vector document = 1; */ document?: VectorJson; /** * Vectors for all tokens in the string. * * @generated from field: repeated arg_services.nlp.v1.Vector tokens = 2; */ tokens?: VectorJson[]; /** * Vectors for all sentences found in the string. * * @generated from field: repeated arg_services.nlp.v1.Vector sentences = 3; */ sentences?: VectorJson[]; /** * Implementation-specific information can be encoded here * * @generated from field: google.protobuf.Struct extras = 15; */ extras?: StructJson; }; /** * Describes the message arg_services.nlp.v1.VectorResponse. * Use `create(VectorResponseSchema)` to create a new message. */ export declare const VectorResponseSchema: GenMessage<VectorResponse, {jsonType: VectorResponseJson}>; /** * Container for storing a vector as a list of floats. * * @generated from message arg_services.nlp.v1.Vector */ export declare type Vector = Message<"arg_services.nlp.v1.Vector"> & { /** * @generated from field: repeated double vector = 1; */ vector: number[]; }; /** * Container for storing a vector as a list of floats. * * @generated from message arg_services.nlp.v1.Vector */ export declare type VectorJson = { /** * @generated from field: repeated double vector = 1; */ vector?: (number | "NaN" | "Infinity" | "-Infinity")[]; }; /** * Describes the message arg_services.nlp.v1.Vector. * Use `create(VectorSchema)` to create a new message. */ export declare const VectorSchema: GenMessage<Vector, {jsonType: VectorJson}>; /** * Specification of one model that is used to generate embeddings for strings. * * @generated from message arg_services.nlp.v1.EmbeddingModel */ export declare type EmbeddingModel = Message<"arg_services.nlp.v1.EmbeddingModel"> & { /** * Each embedding has to be implemented, thus this enum is used to select the correct one. * * @generated from field: arg_services.nlp.v1.EmbeddingType model_type = 1; */ modelType: EmbeddingType; /** * You have to specify the name of the model that should be used by the selected impelemtation (i.e., `model_type`). * We provide links to exemplary models for each implementation in the documentation of `EmbeddingType`. * * @generated from field: string model_name = 2; */ modelName: string; /** * In case the selected model is not capable of directly creating sentence embeddings, you have to select a pooling strategy. * You can either use a standard function (`pooling_type`) or compute the power mean (`pmean`). * * @generated from oneof arg_services.nlp.v1.EmbeddingModel.pooling */ pooling: { /** * Standard pooling functions like mean, min, max. * * @generated from field: arg_services.nlp.v1.Pooling pooling_type = 3; */ value: Pooling; case: "poolingType"; } | { /** * Power mean (or generalized mean). * This method allows you to alter the computation of the mean representation. * Special cases include arithmetic mean (p = 1), geometric mean (p = 0), harmonic mean (p = -1), minimum (p = -∞), maximum (p = ∞). * [Wikipedia](https://en.wikipedia.org/wiki/Generalized_mean). * [Paper](https://arxiv.org/abs/1803.01400). * * @generated from field: double pmean = 4; */ value: number; case: "pmean"; } | { case: undefined; value?: undefined }; }; /** * Specification of one model that is used to generate embeddings for strings. * * @generated from message arg_services.nlp.v1.EmbeddingModel */ export declare type EmbeddingModelJson = { /** * Each embedding has to be implemented, thus this enum is used to select the correct one. * * @generated from field: arg_services.nlp.v1.EmbeddingType model_type = 1; */ modelType?: EmbeddingTypeJson; /** * You have to specify the name of the model that should be used by the selected impelemtation (i.e., `model_type`). * We provide links to exemplary models for each implementation in the documentation of `EmbeddingType`. * * @generated from field: string model_name = 2; */ modelName?: string; /** * Standard pooling functions like mean, min, max. * * @generated from field: arg_services.nlp.v1.Pooling pooling_type = 3; */ poolingType?: PoolingJson; /** * Power mean (or generalized mean). * This method allows you to alter the computation of the mean representation. * Special cases include arithmetic mean (p = 1), geometric mean (p = 0), harmonic mean (p = -1), minimum (p = -∞), maximum (p = ∞). * [Wikipedia](https://en.wikipedia.org/wiki/Generalized_mean). * [Paper](https://arxiv.org/abs/1803.01400). * * @generated from field: double pmean = 4; */ pmean?: number | "NaN" | "Infinity" | "-Infinity"; }; /** * Describes the message arg_services.nlp.v1.EmbeddingModel. * Use `create(EmbeddingModelSchema)` to create a new message. */ export declare const EmbeddingModelSchema: GenMessage<EmbeddingModel, {jsonType: EmbeddingModelJson}>; /** * Possible methods to compute the similarity between two vectors. * * @generated from enum arg_services.nlp.v1.SimilarityMethod */ export enum SimilarityMethod { /** * If not given, the implementation defaults to cosine similarity. * * @generated from enum value: SIMILARITY_METHOD_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Cosine similarity. [Wikipedia](https://en.wikipedia.org/wiki/Cosine_similarity). * * @generated from enum value: SIMILARITY_METHOD_COSINE = 1; */ COSINE = 1, /** * DynaMax Jaccard. [Paper](https://arxiv.org/abs/1904.13264), [Code](https://github.com/babylonhealth/fuzzymax/blob/master/similarity/fuzzy.py). * * @generated from enum value: SIMILARITY_METHOD_DYNAMAX_JACCARD = 2; */ DYNAMAX_JACCARD = 2, /** * MaxPool Jaccard. [Paper](https://arxiv.org/abs/1904.13264), [Code](https://github.com/babylonhealth/fuzzymax/blob/master/similarity/fuzzy.py). * * @generated from enum value: SIMILARITY_METHOD_MAXPOOL_JACCARD = 3; */ MAXPOOL_JACCARD = 3, /** * DynaMax Dice. [Paper](https://arxiv.org/abs/1904.13264), [Code](https://github.com/babylonhealth/fuzzymax/blob/master/similarity/fuzzy.py). * * @generated from enum value: SIMILARITY_METHOD_DYNAMAX_DICE = 4; */ DYNAMAX_DICE = 4, /** * DynaMax Otsuka. [Paper](https://arxiv.org/abs/1904.13264), [Code](https://github.com/babylonhealth/fuzzymax/blob/master/similarity/fuzzy.py). * * @generated from enum value: SIMILARITY_METHOD_DYNAMAX_OTSUKA = 5; */ DYNAMAX_OTSUKA = 5, /** * Word Mover's Distance [Gensim Tutorial](https://radimrehurek.com/gensim/auto_examples/tutorials/run_wmd.html). * * @generated from enum value: SIMILARITY_METHOD_WMD = 6; */ WMD = 6, /** * Levenshtein distance. [Wikipedia](https://en.wikipedia.org/wiki/Levenshtein_distance). * * @generated from enum value: SIMILARITY_METHOD_EDIT = 7; */ EDIT = 7, /** * Jaccard similarity. [Wikipedia](https://en.wikipedia.org/wiki/Jaccard_index). * * @generated from enum value: SIMILARITY_METHOD_JACCARD = 8; */ JACCARD = 8, /** * Angular distance. [Wikipedia](https://en.wikipedia.org/wiki/Angular_distance). * * @generated from enum value: SIMILARITY_METHOD_ANGULAR = 9; */ ANGULAR = 9, /** * Manhattan distance. [Wikipedia](https://en.wikipedia.org/wiki/Taxicab_geometry). * * @generated from enum value: SIMILARITY_METHOD_MANHATTAN = 10; */ MANHATTAN = 10, /** * Euclidean distance. [Wikipedia](https://en.wikipedia.org/wiki/Euclidean_distance). * * @generated from enum value: SIMILARITY_METHOD_EUCLIDEAN = 11; */ EUCLIDEAN = 11, /** * Dot product. [Wikipedia](https://en.wikipedia.org/wiki/Dot_product). * * @generated from enum value: SIMILARITY_METHOD_DOT = 12; */ DOT = 12, } /** * Possible methods to compute the similarity between two vectors. * * @generated from enum arg_services.nlp.v1.SimilarityMethod */ export declare type SimilarityMethodJson = "SIMILARITY_METHOD_UNSPECIFIED" | "SIMILARITY_METHOD_COSINE" | "SIMILARITY_METHOD_DYNAMAX_JACCARD" | "SIMILARITY_METHOD_MAXPOOL_JACCARD" | "SIMILARITY_METHOD_DYNAMAX_DICE" | "SIMILARITY_METHOD_DYNAMAX_OTSUKA" | "SIMILARITY_METHOD_WMD" | "SIMILARITY_METHOD_EDIT" | "SIMILARITY_METHOD_JACCARD" | "SIMILARITY_METHOD_ANGULAR" | "SIMILARITY_METHOD_MANHATTAN" | "SIMILARITY_METHOD_EUCLIDEAN" | "SIMILARITY_METHOD_DOT"; /** * Describes the enum arg_services.nlp.v1.SimilarityMethod. */ export declare const SimilarityMethodSchema: GenEnum<SimilarityMethod, SimilarityMethodJson>; /** * @generated from enum arg_services.nlp.v1.EmbeddingLevel */ export enum EmbeddingLevel { /** * In the default case, no vector is computed. * * @generated from enum value: EMBEDDING_LEVEL_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Compute one vector for the whole string. * * @generated from enum value: EMBEDDING_LEVEL_DOCUMENT = 1; */ DOCUMENT = 1, /** * Compute vectors for all tokens in the string. * * @generated from enum value: EMBEDDING_LEVEL_TOKENS = 2; */ TOKENS = 2, /** * Compute vectors for all sentences found in the string. * * @generated from enum value: EMBEDDING_LEVEL_SENTENCES = 3; */ SENTENCES = 3, } /** * @generated from enum arg_services.nlp.v1.EmbeddingLevel */ export declare type EmbeddingLevelJson = "EMBEDDING_LEVEL_UNSPECIFIED" | "EMBEDDING_LEVEL_DOCUMENT" | "EMBEDDING_LEVEL_TOKENS" | "EMBEDDING_LEVEL_SENTENCES"; /** * Describes the enum arg_services.nlp.v1.EmbeddingLevel. */ export declare const EmbeddingLevelSchema: GenEnum<EmbeddingLevel, EmbeddingLevelJson>; /** * @generated from enum arg_services.nlp.v1.Pooling */ export enum Pooling { /** * IN the default case, the arithmetic mean should be used. * * @generated from enum value: POOLING_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Arithmetic mean of all elements. [Wikipedia](https://en.wikipedia.org/wiki/Arithmetic_mean). * * @generated from enum value: POOLING_MEAN = 1; */ MEAN = 1, /** * Maximum element of vector. [Wikipedia](https://en.wikipedia.org/wiki/Maximum). * * @generated from enum value: POOLING_MAX = 2; */ MAX = 2, /** * Minimum element of vector. [Wikipedia](https://en.wikipedia.org/wiki/Minimum). * * @generated from enum value: POOLING_MIN = 3; */ MIN = 3, /** * Sum of all elements. * * @generated from enum value: POOLING_SUM = 4; */ SUM = 4, /** * First element of vector. * * @generated from enum value: POOLING_FIRST = 5; */ FIRST = 5, /** * Last element of vector. * * @generated from enum value: POOLING_LAST = 6; */ LAST = 6, /** * Median element of vector. [Wikipedia](https://en.wikipedia.org/wiki/Median). * * @generated from enum value: POOLING_MEDIAN = 7; */ MEDIAN = 7, /** * Geometirc mean of all elements. [Wikipedia](https://en.wikipedia.org/wiki/Geometric_mean). * * @generated from enum value: POOLING_GMEAN = 8; */ GMEAN = 8, /** * Harmonic mean of all elements. [Wikipedia](https://en.wikipedia.org/wiki/Harmonic_mean). * * @generated from enum value: POOLING_HMEAN = 9; */ HMEAN = 9, } /** * @generated from enum arg_services.nlp.v1.Pooling */ export declare type PoolingJson = "POOLING_UNSPECIFIED" | "POOLING_MEAN" | "POOLING_MAX" | "POOLING_MIN" | "POOLING_SUM" | "POOLING_FIRST" | "POOLING_LAST" | "POOLING_MEDIAN" | "POOLING_GMEAN" | "POOLING_HMEAN"; /** * Describes the enum arg_services.nlp.v1.Pooling. */ export declare const PoolingSchema: GenEnum<Pooling, PoolingJson>; /** * @generated from enum arg_services.nlp.v1.EmbeddingType */ export enum EmbeddingType { /** * In the default case, no embedding is computed. * * @generated from enum value: EMBEDDING_TYPE_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * [Spacy](https://spacy.io/models). * * @generated from enum value: EMBEDDING_TYPE_SPACY = 1; */ SPACY = 1, /** * [HuggingFace Transformers](https://huggingface.co/models). * * @generated from enum value: EMBEDDING_TYPE_TRANSFORMERS = 2; */ TRANSFORMERS = 2, /** * [UKPLab Sentence Transformers](https://www.sbert.net/docs/pretrained_models.html) * * @generated from enum value: EMBEDDING_TYPE_SENTENCE_TRANSFORMERS = 3; */ SENTENCE_TRANSFORMERS = 3, /** * Tensorflow Hub. Example: [Universal Sentence Encoder](https://tfhub.dev/google/universal-sentence-encoder/4). * * @generated from enum value: EMBEDDING_TYPE_TENSORFLOW_HUB = 4; */ TENSORFLOW_HUB = 4, /** * [OpenAI](https://platform.openai.com/docs/models/embeddings). * * @generated from enum value: EMBEDDING_TYPE_OPENAI = 5; */ OPENAI = 5, /** * [Ollama](https://ollama.com/blog/embedding-models) * * @generated from enum value: EMBEDDING_TYPE_OLLAMA = 6; */ OLLAMA = 6, /** * [Cohere](https://docs.cohere.com/reference/embed) * * @generated from enum value: EMBEDDING_TYPE_COHERE = 7; */ COHERE = 7, /** * [VoyageAI](https://docs.voyageai.com/docs/embeddings) * * @generated from enum value: EMBEDDING_TYPE_VOYAGEAI = 8; */ VOYAGEAI = 8, } /** * @generated from enum arg_services.nlp.v1.EmbeddingType */ export declare type EmbeddingTypeJson = "EMBEDDING_TYPE_UNSPECIFIED" | "EMBEDDING_TYPE_SPACY" | "EMBEDDING_TYPE_TRANSFORMERS" | "EMBEDDING_TYPE_SENTENCE_TRANSFORMERS" | "EMBEDDING_TYPE_TENSORFLOW_HUB" | "EMBEDDING_TYPE_OPENAI" | "EMBEDDING_TYPE_OLLAMA" | "EMBEDDING_TYPE_COHERE" | "EMBEDDING_TYPE_VOYAGEAI"; /** * Describes the enum arg_services.nlp.v1.EmbeddingType. */ export declare const EmbeddingTypeSchema: GenEnum<EmbeddingType, EmbeddingTypeJson>; /** * @generated from service arg_services.nlp.v1.NlpService */ export declare const NlpService: GenService<{ /** * Compute embeddings (i.e., vectors) for strings. * * @generated from rpc arg_services.nlp.v1.NlpService.Vectors */ vectors: { methodKind: "unary"; input: typeof VectorsRequestSchema; output: typeof VectorsResponseSchema; }, /** * Compute the similarity score between two strings. * * @generated from rpc arg_services.nlp.v1.NlpService.Similarities */ similarities: { methodKind: "unary"; input: typeof SimilaritiesRequestSchema; output: typeof SimilaritiesResponseSchema; }, /** * Process strings by spacy and return them as [binary data](https://spacy.io/api/docbin). * Locally, spacy can restore this data **without** loading the underlying NLP models into the main memory. * Allows one to retrieve all computed attributes (e.g., POS tags, sentences), but can only be used by Python programs. * * @generated from rpc arg_services.nlp.v1.NlpService.DocBin */ docBin: { methodKind: "unary"; input: typeof DocBinRequestSchema; output: typeof DocBinResponseSchema; }, }>;