textanalytics

package
v12.2.0-beta+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package textanalytics implements the Azure ARM Textanalytics service API version v2.0.

The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview

Deprecated: Please instead use github.com/Azure/azure-sdk-for-go/services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type AzureRegions

type AzureRegions string

AzureRegions enumerates the values for azure regions.

const (
	// Eastus2 specifies the eastus 2 state for azure regions.
	Eastus2 AzureRegions = "eastus2"
	// Southeastasia specifies the southeastasia state for azure regions.
	Southeastasia AzureRegions = "southeastasia"
	// Westcentralus specifies the westcentralus state for azure regions.
	Westcentralus AzureRegions = "westcentralus"
	// Westeurope specifies the westeurope state for azure regions.
	Westeurope AzureRegions = "westeurope"
	// Westus specifies the westus state for azure regions.
	Westus AzureRegions = "westus"
)

type BatchInput

type BatchInput struct {
	Documents *[]Input `json:"documents,omitempty"`
}

BatchInput is

type DetectedLanguage

type DetectedLanguage struct {
	Name        *string  `json:"name,omitempty"`
	Iso6391Name *string  `json:"iso6391Name,omitempty"`
	Score       *float64 `json:"score,omitempty"`
}

DetectedLanguage is

type ErrorRecord

type ErrorRecord struct {
	ID      *string `json:"id,omitempty"`
	Message *string `json:"message,omitempty"`
}

ErrorRecord is

type ErrorResponse

type ErrorResponse struct {
	Code       *string        `json:"code,omitempty"`
	Message    *string        `json:"message,omitempty"`
	Target     *string        `json:"target,omitempty"`
	InnerError *InternalError `json:"innerError,omitempty"`
}

ErrorResponse is

type Input

type Input struct {
	ID   *string `json:"id,omitempty"`
	Text *string `json:"text,omitempty"`
}

Input is

type InternalError

type InternalError struct {
	Code       *string        `json:"code,omitempty"`
	Message    *string        `json:"message,omitempty"`
	InnerError *InternalError `json:"innerError,omitempty"`
}

InternalError is

type KeyPhraseBatchResult

type KeyPhraseBatchResult struct {
	autorest.Response `json:"-"`
	Documents         *[]KeyPhraseBatchResultItem `json:"documents,omitempty"`
	Errors            *[]ErrorRecord              `json:"errors,omitempty"`
}

KeyPhraseBatchResult is

type KeyPhraseBatchResultItem

type KeyPhraseBatchResultItem struct {
	KeyPhrases *[]string `json:"keyPhrases,omitempty"`
	ID         *string   `json:"id,omitempty"`
}

KeyPhraseBatchResultItem is

type LanguageBatchResult

type LanguageBatchResult struct {
	autorest.Response `json:"-"`
	Documents         *[]LanguageBatchResultItem `json:"documents,omitempty"`
	Errors            *[]ErrorRecord             `json:"errors,omitempty"`
}

LanguageBatchResult is

type LanguageBatchResultItem

type LanguageBatchResultItem struct {
	ID                *string             `json:"id,omitempty"`
	DetectedLanguages *[]DetectedLanguage `json:"detectedLanguages,omitempty"`
}

LanguageBatchResultItem is

type ManagementClient

type ManagementClient struct {
	autorest.Client
	SubscriptionKey string
	AzureRegion     AzureRegions
}

ManagementClient is the base client for Textanalytics.

func New

func New(subscriptionKey string, azureRegion AzureRegions) ManagementClient

New creates an instance of the ManagementClient client.

func NewWithoutDefaults

func NewWithoutDefaults(subscriptionKey string, azureRegion AzureRegions) ManagementClient

NewWithoutDefaults creates an instance of the ManagementClient client.

func (ManagementClient) DetectLanguage

func (client ManagementClient) DetectLanguage(input BatchInput, numberOfLanguagesToDetect *int32) (result LanguageBatchResult, err error)

DetectLanguage scores close to 1 indicate 100% certainty that the identified language is true. A total of 120 languages are supported.

input is collection of documents to analyze. numberOfLanguagesToDetect is (Optional. Deprecated) Number of languages to detect. Set to 1 by default. Irrespective of the value, the language with the highest score is returned.

func (ManagementClient) DetectLanguagePreparer

func (client ManagementClient) DetectLanguagePreparer(input BatchInput, numberOfLanguagesToDetect *int32) (*http.Request, error)

DetectLanguagePreparer prepares the DetectLanguage request.

func (ManagementClient) DetectLanguageResponder

func (client ManagementClient) DetectLanguageResponder(resp *http.Response) (result LanguageBatchResult, err error)

DetectLanguageResponder handles the response to the DetectLanguage request. The method always closes the http.Response Body.

func (ManagementClient) DetectLanguageSender

func (client ManagementClient) DetectLanguageSender(req *http.Request) (*http.Response, error)

DetectLanguageSender sends the DetectLanguage request. The method will close the http.Response Body if it receives an error.

func (ManagementClient) KeyPhrases

func (client ManagementClient) KeyPhrases(input MultiLanguageBatchInput) (result KeyPhraseBatchResult, err error)

KeyPhrases we employ techniques from Microsoft Office's sophisticated Natural Language Processing toolkit. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text Analytics Documentation</a> for details about the languages that are supported by key phrase extraction.

input is collection of documents to analyze. Documents can now contain a language field to indicate the text language

func (ManagementClient) KeyPhrasesPreparer

func (client ManagementClient) KeyPhrasesPreparer(input MultiLanguageBatchInput) (*http.Request, error)

KeyPhrasesPreparer prepares the KeyPhrases request.

func (ManagementClient) KeyPhrasesResponder

func (client ManagementClient) KeyPhrasesResponder(resp *http.Response) (result KeyPhraseBatchResult, err error)

KeyPhrasesResponder handles the response to the KeyPhrases request. The method always closes the http.Response Body.

func (ManagementClient) KeyPhrasesSender

func (client ManagementClient) KeyPhrasesSender(req *http.Request) (*http.Response, error)

KeyPhrasesSender sends the KeyPhrases request. The method will close the http.Response Body if it receives an error.

func (ManagementClient) Sentiment

func (client ManagementClient) Sentiment(input MultiLanguageBatchInput) (result SentimentBatchResult, err error)

Sentiment scores close to 1 indicate positive sentiment, while scores close to 0 indicate negative sentiment. Sentiment score is generated using classification techniques. The input features to the classifier include n-grams, features generated from part-of-speech tags, and word embeddings. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text Analytics Documentation</a> for details about the languages that are supported by sentiment analysis.

input is collection of documents to analyze.

func (ManagementClient) SentimentPreparer

func (client ManagementClient) SentimentPreparer(input MultiLanguageBatchInput) (*http.Request, error)

SentimentPreparer prepares the Sentiment request.

func (ManagementClient) SentimentResponder

func (client ManagementClient) SentimentResponder(resp *http.Response) (result SentimentBatchResult, err error)

SentimentResponder handles the response to the Sentiment request. The method always closes the http.Response Body.

func (ManagementClient) SentimentSender

func (client ManagementClient) SentimentSender(req *http.Request) (*http.Response, error)

SentimentSender sends the Sentiment request. The method will close the http.Response Body if it receives an error.

type MultiLanguageBatchInput

type MultiLanguageBatchInput struct {
	Documents *[]MultiLanguageInput `json:"documents,omitempty"`
}

MultiLanguageBatchInput is

type MultiLanguageInput

type MultiLanguageInput struct {
	Language *string `json:"language,omitempty"`
	ID       *string `json:"id,omitempty"`
	Text     *string `json:"text,omitempty"`
}

MultiLanguageInput is

type SentimentBatchResult

type SentimentBatchResult struct {
	autorest.Response `json:"-"`
	Documents         *[]SentimentBatchResultItem `json:"documents,omitempty"`
	Errors            *[]ErrorRecord              `json:"errors,omitempty"`
}

SentimentBatchResult is

type SentimentBatchResultItem

type SentimentBatchResultItem struct {
	Score *float64 `json:"score,omitempty"`
	ID    *string  `json:"id,omitempty"`
}

SentimentBatchResultItem is

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL