azure-sdk-for-go: github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/textanalytics Index | Files | Directories

package textanalytics

import "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/textanalytics"

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

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

Index

Package Files

client.go models.go version.go

func UserAgent Uses

func UserAgent() string

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

func Version Uses

func Version() string

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

type BaseClient Uses

type BaseClient struct {
    autorest.Client
    Endpoint string
}

BaseClient is the base client for Textanalytics.

func New Uses

func New(endpoint string) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults Uses

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

func (BaseClient) DetectLanguage Uses

func (client BaseClient) DetectLanguage(ctx context.Context, showStats *bool, languageBatchInput *LanguageBatchInput) (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. Parameters: showStats - (optional) if set to true, response will contain input and document level statistics. languageBatchInput - collection of documents to analyze.

func (BaseClient) DetectLanguagePreparer Uses

func (client BaseClient) DetectLanguagePreparer(ctx context.Context, showStats *bool, languageBatchInput *LanguageBatchInput) (*http.Request, error)

DetectLanguagePreparer prepares the DetectLanguage request.

func (BaseClient) DetectLanguageResponder Uses

func (client BaseClient) 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 (BaseClient) DetectLanguageSender Uses

func (client BaseClient) 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 (BaseClient) Entities Uses

func (client BaseClient) Entities(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (result EntitiesBatchResult, err error)

Entities to get even more information on each recognized entity we recommend using the Bing Entity Search API by querying for the recognized entities names. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. Parameters: showStats - (optional) if set to true, response will contain input and document level statistics. multiLanguageBatchInput - collection of documents to analyze.

func (BaseClient) EntitiesPreparer Uses

func (client BaseClient) EntitiesPreparer(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (*http.Request, error)

EntitiesPreparer prepares the Entities request.

func (BaseClient) EntitiesResponder Uses

func (client BaseClient) EntitiesResponder(resp *http.Response) (result EntitiesBatchResult, err error)

EntitiesResponder handles the response to the Entities request. The method always closes the http.Response Body.

func (BaseClient) EntitiesSender Uses

func (client BaseClient) EntitiesSender(req *http.Request) (*http.Response, error)

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

func (BaseClient) KeyPhrases Uses

func (client BaseClient) KeyPhrases(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (result KeyPhraseBatchResult, err error)

KeyPhrases 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. Parameters: showStats - (optional) if set to true, response will contain input and document level statistics. multiLanguageBatchInput - collection of documents to analyze. Documents can now contain a language field to indicate the text language

func (BaseClient) KeyPhrasesPreparer Uses

func (client BaseClient) KeyPhrasesPreparer(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (*http.Request, error)

KeyPhrasesPreparer prepares the KeyPhrases request.

func (BaseClient) KeyPhrasesResponder Uses

func (client BaseClient) 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 (BaseClient) KeyPhrasesSender Uses

func (client BaseClient) 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 (BaseClient) Sentiment Uses

func (client BaseClient) Sentiment(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (result SetObject, err error)

Sentiment scores close to 1 indicate positive sentiment, while scores close to 0 indicate negative sentiment. A score of 0.5 indicates the lack of sentiment (e.g. a factoid statement). 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. Parameters: showStats - (optional) if set to true, response will contain input and document level statistics. multiLanguageBatchInput - collection of documents to analyze.

func (BaseClient) SentimentPreparer Uses

func (client BaseClient) SentimentPreparer(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (*http.Request, error)

SentimentPreparer prepares the Sentiment request.

func (BaseClient) SentimentResponder Uses

func (client BaseClient) SentimentResponder(resp *http.Response) (result SetObject, err error)

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

func (BaseClient) SentimentSender Uses

func (client BaseClient) 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 DetectedLanguage Uses

type DetectedLanguage struct {
    // Name - Long name of a detected language (e.g. English, French).
    Name *string `json:"name,omitempty"`
    // Iso6391Name - A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).
    Iso6391Name *string `json:"iso6391Name,omitempty"`
    // Score - A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.
    Score *float64 `json:"score,omitempty"`
}

DetectedLanguage ...

type DocumentStatistics Uses

type DocumentStatistics struct {
    // CharactersCount - Number of text elements recognized in the document.
    CharactersCount *int32 `json:"charactersCount,omitempty"`
    // TransactionsCount - Number of transactions for the document.
    TransactionsCount *int32 `json:"transactionsCount,omitempty"`
}

DocumentStatistics ...

type EntitiesBatchResult Uses

type EntitiesBatchResult struct {
    autorest.Response `json:"-"`
    // Documents - READ-ONLY; Response by document
    Documents *[]EntitiesBatchResultItem `json:"documents,omitempty"`
    // Errors - READ-ONLY; Errors and Warnings by document
    Errors *[]ErrorRecord `json:"errors,omitempty"`
    // Statistics - READ-ONLY; (Optional) if showStats=true was specified in the request this field will contain information about the request payload.
    Statistics *RequestStatistics `json:"statistics,omitempty"`
}

EntitiesBatchResult ...

type EntitiesBatchResultItem Uses

type EntitiesBatchResultItem struct {
    // ID - Unique, non-empty document identifier.
    ID  *string `json:"id,omitempty"`
    // Entities - READ-ONLY; Recognized entities in the document.
    Entities *[]EntityRecord `json:"entities,omitempty"`
    // Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
    Statistics *DocumentStatistics `json:"statistics,omitempty"`
}

EntitiesBatchResultItem ...

type EntityRecord Uses

type EntityRecord struct {
    // Name - Entity formal name.
    Name *string `json:"name,omitempty"`
    // Matches - List of instances this entity appears in the text.
    Matches *[]MatchRecord `json:"matches,omitempty"`
    // WikipediaLanguage - Wikipedia language for which the WikipediaId and WikipediaUrl refers to.
    WikipediaLanguage *string `json:"wikipediaLanguage,omitempty"`
    // WikipediaID - Wikipedia unique identifier of the recognized entity.
    WikipediaID *string `json:"wikipediaId,omitempty"`
    // WikipediaURL - READ-ONLY; URL for the entity's Wikipedia page.
    WikipediaURL *string `json:"wikipediaUrl,omitempty"`
    // BingID - Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information.
    BingID *string `json:"bingId,omitempty"`
    // Type - Entity type from Named Entity Recognition model
    Type *string `json:"type,omitempty"`
    // SubType - Entity sub type from Named Entity Recognition model
    SubType *string `json:"subType,omitempty"`
}

EntityRecord ...

type ErrorRecord Uses

type ErrorRecord struct {
    // ID - Input document unique identifier the error refers to.
    ID  *string `json:"id,omitempty"`
    // Message - Error message.
    Message *string `json:"message,omitempty"`
}

ErrorRecord ...

type ErrorResponse Uses

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

ErrorResponse ...

type InternalError Uses

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

InternalError ...

type KeyPhraseBatchResult Uses

type KeyPhraseBatchResult struct {
    autorest.Response `json:"-"`
    // Documents - READ-ONLY; Response by document
    Documents *[]KeyPhraseBatchResultItem `json:"documents,omitempty"`
    // Errors - READ-ONLY; Errors and Warnings by document
    Errors *[]ErrorRecord `json:"errors,omitempty"`
    // Statistics - READ-ONLY; =(Optional) if showStats=true was specified in the request this field will contain information about the request payload.
    Statistics *RequestStatistics `json:"statistics,omitempty"`
}

KeyPhraseBatchResult ...

type KeyPhraseBatchResultItem Uses

type KeyPhraseBatchResultItem struct {
    // ID - Unique, non-empty document identifier.
    ID  *string `json:"id,omitempty"`
    // KeyPhrases - READ-ONLY; A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.
    KeyPhrases *[]string `json:"keyPhrases,omitempty"`
    // Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
    Statistics *DocumentStatistics `json:"statistics,omitempty"`
}

KeyPhraseBatchResultItem ...

type LanguageBatchInput Uses

type LanguageBatchInput struct {
    Documents *[]LanguageInput `json:"documents,omitempty"`
}

LanguageBatchInput ...

type LanguageBatchResult Uses

type LanguageBatchResult struct {
    autorest.Response `json:"-"`
    // Documents - READ-ONLY; Response by document
    Documents *[]LanguageBatchResultItem `json:"documents,omitempty"`
    // Errors - READ-ONLY; Errors and Warnings by document
    Errors *[]ErrorRecord `json:"errors,omitempty"`
    // Statistics - READ-ONLY; (Optional) if showStats=true was specified in the request this field will contain information about the request payload.
    Statistics *RequestStatistics `json:"statistics,omitempty"`
}

LanguageBatchResult ...

type LanguageBatchResultItem Uses

type LanguageBatchResultItem struct {
    // ID - Unique, non-empty document identifier.
    ID  *string `json:"id,omitempty"`
    // DetectedLanguages - A list of extracted languages.
    DetectedLanguages *[]DetectedLanguage `json:"detectedLanguages,omitempty"`
    // Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
    Statistics *DocumentStatistics `json:"statistics,omitempty"`
}

LanguageBatchResultItem ...

type LanguageInput Uses

type LanguageInput struct {
    CountryHint *string `json:"countryHint,omitempty"`
    // ID - Unique, non-empty document identifier.
    ID   *string `json:"id,omitempty"`
    Text *string `json:"text,omitempty"`
}

LanguageInput ...

type MatchRecord Uses

type MatchRecord struct {
    // WikipediaScore - (optional) If a well-known item with Wikipedia link is recognized, a decimal number denoting the confidence level of the Wikipedia info will be returned.
    WikipediaScore *float64 `json:"wikipediaScore,omitempty"`
    // EntityTypeScore - (optional) If an entity type is recognized, a decimal number denoting the confidence level of the entity type will be returned.
    EntityTypeScore *float64 `json:"entityTypeScore,omitempty"`
    // Text - Entity text as appears in the request.
    Text *string `json:"text,omitempty"`
    // Offset - Start position (in Unicode characters) for the entity match text.
    Offset *int32 `json:"offset,omitempty"`
    // Length - Length (in Unicode characters) for the entity match text.
    Length *int32 `json:"length,omitempty"`
}

MatchRecord ...

type MultiLanguageBatchInput Uses

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

MultiLanguageBatchInput ...

type MultiLanguageInput Uses

type MultiLanguageInput struct {
    // Language - This is the 2 letter ISO 639-1 representation of a language. For example, use "en" for English; "es" for Spanish etc.,
    Language *string `json:"language,omitempty"`
    // ID - Unique, non-empty document identifier.
    ID   *string `json:"id,omitempty"`
    Text *string `json:"text,omitempty"`
}

MultiLanguageInput ...

type RequestStatistics Uses

type RequestStatistics struct {
    // DocumentsCount - Number of documents submitted in the request.
    DocumentsCount *int32 `json:"documentsCount,omitempty"`
    // ValidDocumentsCount - Number of valid documents. This excludes empty, over-size limit or non-supported languages documents.
    ValidDocumentsCount *int32 `json:"validDocumentsCount,omitempty"`
    // ErroneousDocumentsCount - Number of invalid documents. This includes empty, over-size limit or non-supported languages documents.
    ErroneousDocumentsCount *int32 `json:"erroneousDocumentsCount,omitempty"`
    // TransactionsCount - Number of transactions for the request.
    TransactionsCount *int64 `json:"transactionsCount,omitempty"`
}

RequestStatistics ...

type SentimentBatchResult Uses

type SentimentBatchResult struct {
    // Documents - READ-ONLY; Response by document
    Documents *[]SentimentBatchResultItem `json:"documents,omitempty"`
    // Errors - READ-ONLY; Errors and Warnings by document
    Errors *[]ErrorRecord `json:"errors,omitempty"`
    // Statistics - READ-ONLY; (Optional) if showStats=true was specified in the request this field will contain information about the request payload.
    Statistics *RequestStatistics `json:"statistics,omitempty"`
}

SentimentBatchResult ...

type SentimentBatchResultItem Uses

type SentimentBatchResultItem struct {
    // ID - Unique, non-empty document identifier.
    ID  *string `json:"id,omitempty"`
    // Score - A decimal number between 0 and 1 denoting the sentiment of the document. A score above 0.7 usually refers to a positive document while a score below 0.3 normally has a negative connotation. Mid values refer to neutral text.
    Score *float64 `json:"score,omitempty"`
    // Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
    Statistics *DocumentStatistics `json:"statistics,omitempty"`
}

SentimentBatchResultItem ...

type SetObject Uses

type SetObject struct {
    autorest.Response `json:"-"`
    Value             interface{} `json:"value,omitempty"`
}

SetObject ...

Directories

PathSynopsis
textanalyticsapi

Package textanalytics imports 6 packages (graph) and is imported by 5 packages. Updated 2019-07-31. Refresh now. Tools for package owners.