Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as mod from "https://googleapis.deno.dev/v1/language:v2.ts";

§Classes

GoogleAuth
Language

Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.

§Variables

auth

§Interfaces

AnalyzeEntitiesRequest

The entity analysis request message.

AnalyzeEntitiesResponse

The entity analysis response message.

AnalyzeSentimentRequest

The sentiment analysis request message.

AnalyzeSentimentResponse

The sentiment analysis response message.

AnnotateTextRequest

The request message for the text annotation API, which can perform multiple analysis types in one call.

AnnotateTextRequestFeatures

All available features. Setting each one to true will enable that specific analysis for the input.

AnnotateTextResponse

The text annotations response message.

ClassificationCategory

Represents a category returned from the text classifier.

ClassifyTextRequest

The document classification request message.

ClassifyTextResponse

The document classification response message.

Color

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of java.awt.Color in Java; it can also be trivially provided to UIColor's +colorWithRed:green:blue:alpha method in iOS; and, with just a little work, it can be easily formatted into a CSS rgba() string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...

CpuMetric

Metric for billing reports.

CredentialsClient

Defines the root interface for all clients that generate credentials for calling Google APIs. All clients should implement this interface.

DiskMetric
Document

Represents the input to API methods.

Entity

Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as probability and mentions, with entities.

EntityMention

Represents a mention for an entity in the text. Currently, proper noun mentions are supported.

GpuMetric
InfraUsage

Infra Usage of billing metrics. Next ID: 6

ModerateTextRequest

The document moderation request message.

ModerateTextResponse

The document moderation response message.

RamMetric
Sentence

Represents a sentence in the input document.

Sentiment

Represents the feeling associated with the entire text or entities in the text.

Status

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.

TextSpan

Represents a text span in the input document.

TpuMetric
XPSArrayStats

The data statistics of a series of ARRAY values.

XPSBatchPredictResponse
XPSBoundingBoxMetricsEntry

Bounding box matching model metrics for a single intersection-over-union threshold and multiple label match confidence thresholds.

XPSBoundingBoxMetricsEntryConfidenceMetricsEntry

Metrics for a single confidence threshold.

XPSCategoryStats

The data statistics of a series of CATEGORY values.

XPSCategoryStatsSingleCategoryStats

The statistics of a single CATEGORY value.

XPSClassificationEvaluationMetrics

Model evaluation metrics for classification problems. It can be used for image and video classification. Next tag: 9.

XPSColorMap

Map from color to display name. Will only be used by Image Segmentation for uCAIP.

XPSColorMapIntColor

RGB color and each channel is represented by an integer.

XPSColumnSpec
XPSColumnSpecCorrelatedColumn

Identifies a table's column, and its correlation with the column this ColumnSpec describes.

XPSColumnSpecForecastingMetadata

===========================================================================

The fields below are used exclusively for Forecasting.

XPSCommonStats

Common statistics for a column with a specified data type.

XPSConfidenceMetricsEntry

ConfidenceMetricsEntry includes generic precision, recall, f1 score etc. Next tag: 16.

XPSConfusionMatrix

Confusion matrix of the model running the classification.

XPSConfusionMatrixRow

A row in the confusion matrix.

XPSCoreMlFormat

A model format used for iOS mobile devices.

XPSCorrelationStats

A correlation statistics between two series of DataType values. The series may have differing DataType-s, but within a single series the DataType must be the same.

XPSDataErrors

Different types of errors and the stats associatesd with each error.

XPSDataStats

The data statistics of a series of values that share the same DataType.

XPSDataType

Indicated the type of data that can be stored in a structured data entity (e.g. a table).

XPSDockerFormat

A model format used for Docker containers. Use the params field to customize the container. The container is verified to work correctly on ubuntu 16.04 operating system.

XPSEdgeTpuTfLiteFormat

A model format used for Edge TPU devices.

XPSEvaluationMetrics

Contains xPS-specific model evaluation metrics either for a single annotation spec (label), or for the model overall. Next tag: 18.

XPSEvaluationMetricsSet

Specifies location of model evaluation metrics.

XPSExampleSet

Set of examples or input sources.

XPSExportModelOutputConfig
XPSFileSpec

Spec of input and output files, on external file systems (CNS, GCS, etc).

XPSFloat64Stats

The data statistics of a series of FLOAT64 values.

XPSFloat64StatsHistogramBucket

A bucket of a histogram.

XPSImageClassificationTrainResponse
XPSImageExportModelSpec

Information of downloadable models that are pre-generated as part of training flow and will be persisted in AutoMl backend. Upon receiving ExportModel request from user, AutoMl backend can serve the pre-generated models to user if exists (by copying the files from internal path to user provided location), otherwise, AutoMl backend will call xPS ExportModel API to generate the model on the fly with the requesting format.

XPSImageModelArtifactSpec

Stores the locations and related metadata of the model artifacts. Populated for uCAIP requests only.

XPSImageModelServingSpec

Serving specification for image models.

XPSImageModelServingSpecModelThroughputEstimation
XPSImageObjectDetectionEvaluationMetrics

Model evaluation metrics for image object detection problems. Evaluates prediction quality of labeled bounding boxes.

XPSImageObjectDetectionModelSpec
XPSImageSegmentationEvaluationMetrics

Model evaluation metrics for image segmentation problems. Next tag: 4.

XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry

Metrics for a single confidence threshold.

XPSImageSegmentationTrainResponse
XPSIntegratedGradientsAttribution

An attribution method that computes the Aumann-Shapley value taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1703.01365

XPSMetricEntry
XPSMetricEntryLabel
XPSModelArtifactItem

A single model artifact item.

XPSPreprocessResponse

Next ID: 8

XPSRegressionEvaluationMetrics

Model evaluation metrics for regression problems. It can be used for Tables.

XPSRegressionMetricsEntry

A pair of actual & observed values for the model being evaluated.

XPSReportingMetrics
XPSResponseExplanationMetadata
XPSResponseExplanationMetadataInputMetadata

Metadata of the input of a feature.

XPSResponseExplanationMetadataOutputMetadata

Metadata of the prediction output to be explained.

XPSResponseExplanationParameters
XPSResponseExplanationSpec

Specification of Model explanation. Feature-based XAI in AutoML Vision ICN is deprecated, see b/288407203 for context.

XPSRow
XPSSpeechEvaluationMetrics
XPSSpeechEvaluationMetricsSubModelEvaluationMetric
XPSSpeechModelSpec
XPSSpeechModelSpecSubModelSpec
XPSSpeechPreprocessResponse
XPSSpeechPreprocessStats
XPSStringStats

The data statistics of a series of STRING values.

XPSStringStatsUnigramStats

The statistics of a unigram.

XPSStructStats

The data statistics of a series of STRUCT values.

XPSStructType

StructType defines the DataType-s of a STRUCT type.

XPSTablesClassificationMetrics

Metrics for Tables classification problems.

XPSTablesClassificationMetricsCurveMetrics

Metrics curve data point for a single value.

XPSTablesConfidenceMetricsEntry

Metrics for a single confidence threshold.

XPSTablesDatasetMetadata

Metadata for a dataset used for AutoML Tables. Next ID: 6

XPSTablesEvaluationMetrics
XPSTablesModelColumnInfo

An information specific to given column and Tables Model, in context of the Model and the predictions created by it.

XPSTablesModelStructure

A description of Tables model structure.

XPSTablesModelStructureModelParameters

Model hyper-parameters for a model.

XPSTablesModelStructureModelParametersParameter
XPSTableSpec
XPSTablesPreprocessResponse
XPSTablesRegressionMetrics

Metrics for Tables regression problems.

XPSTablesTrainingOperationMetadata
XPSTablesTrainResponse
XPSTextComponentModel

Component model. Next ID: 10

XPSTextExtractionEvaluationMetrics
XPSTextSentimentEvaluationMetrics

Model evaluation metrics for text sentiment problems.

XPSTextToSpeechTrainResponse

TextToSpeech train response

XPSTextTrainResponse
XPSTfJsFormat

A TensorFlow.js model that can be used in the browser and in Node.js using JavaScript.

XPSTfLiteFormat

LINT.IfChange A model format used for mobile and IoT devices. See https://www.tensorflow.org/lite.

XPSTfSavedModelFormat

A tensorflow model format in SavedModel format.

XPSTimestampStats

The data statistics of a series of TIMESTAMP values.

XPSTimestampStatsGranularStats

Stats split by a defined in context granularity.

XPSTrackMetricsEntry

Track matching model metrics for a single track match threshold and multiple label match confidence thresholds. Next tag: 6.

XPSTrackMetricsEntryConfidenceMetricsEntry

Metrics for a single confidence threshold. Next tag: 6.

XPSTrainingObjectivePoint
XPSTrainResponse

Next ID: 18

XPSTranslationEvaluationMetrics

Evaluation metrics for the dataset.

XPSTranslationPreprocessResponse

Translation preprocess response.

XPSTranslationTrainResponse

Train response for translation.

XPSTuningTrial

Metrics for a tuning job generated, will get forwarded to Stackdriver as model tuning logs. Setting this as a standalone message out of CreateModelMetadata to avoid confusion as we expose this message only to users.

XPSVideoActionMetricsEntry

The Evaluation metrics entry given a specific precision_window_length.

XPSVideoActionMetricsEntryConfidenceMetricsEntry

Metrics for a single confidence threshold.

XPSVideoActionRecognitionEvaluationMetrics

Model evaluation metrics for video action recognition.

XPSVideoActionRecognitionTrainResponse
XPSVideoBatchPredictOperationMetadata
XPSVideoClassificationTrainResponse
XPSVideoExportModelSpec

Information of downloadable models that are pre-generated as part of training flow and will be persisted in AutoMl backend. Upon receiving ExportModel request from user, AutoMl backend can serve the pre-generated models to user if exists (by copying the files from internal path to user provided location), otherwise, AutoMl backend will call xPS ExportModel API to generate the model on the fly with the requesting format.

XPSVideoModelArtifactSpec
XPSVideoObjectTrackingEvaluationMetrics

Model evaluation metrics for ObjectTracking problems. Next tag: 10.

XPSVideoObjectTrackingTrainResponse
XPSVideoTrainingOperationMetadata
XPSVisionErrorAnalysisConfig

The vision model error analysis configuration. Next tag: 3

XPSVisionTrainingOperationMetadata
XPSVisualization

Visualization configurations for image explanation.

XPSXpsOperationMetadata
XPSXraiAttribution

An explanation method that redistributes Integrated Gradients attributions to segmented regions, taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1906.02825 Only supports image Models (modality is IMAGE).