...

Source file src/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/textanalytics/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/textanalytics

     1  package textanalytics
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"encoding/json"
    11  	"github.com/Azure/go-autorest/autorest"
    12  )
    13  
    14  // The package's fully qualified name.
    15  const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/textanalytics"
    16  
    17  // DetectedLanguage ...
    18  type DetectedLanguage struct {
    19  	// Name - Long name of a detected language (e.g. English, French).
    20  	Name *string `json:"name,omitempty"`
    21  	// Iso6391Name - A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).
    22  	Iso6391Name *string `json:"iso6391Name,omitempty"`
    23  	// Score - A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.
    24  	Score *float64 `json:"score,omitempty"`
    25  }
    26  
    27  // DocumentStatistics ...
    28  type DocumentStatistics struct {
    29  	// CharactersCount - Number of text elements recognized in the document.
    30  	CharactersCount *int32 `json:"charactersCount,omitempty"`
    31  	// TransactionsCount - Number of transactions for the document.
    32  	TransactionsCount *int32 `json:"transactionsCount,omitempty"`
    33  }
    34  
    35  // EntitiesBatchResult ...
    36  type EntitiesBatchResult struct {
    37  	autorest.Response `json:"-"`
    38  	// Documents - READ-ONLY; Response by document
    39  	Documents *[]EntitiesBatchResultItem `json:"documents,omitempty"`
    40  	// Errors - READ-ONLY; Errors and Warnings by document
    41  	Errors *[]ErrorRecord `json:"errors,omitempty"`
    42  	// Statistics - READ-ONLY; (Optional) if showStats=true was specified in the request this field will contain information about the request payload.
    43  	Statistics *RequestStatistics `json:"statistics,omitempty"`
    44  }
    45  
    46  // MarshalJSON is the custom marshaler for EntitiesBatchResult.
    47  func (ebr EntitiesBatchResult) MarshalJSON() ([]byte, error) {
    48  	objectMap := make(map[string]interface{})
    49  	return json.Marshal(objectMap)
    50  }
    51  
    52  // EntitiesBatchResultItem ...
    53  type EntitiesBatchResultItem struct {
    54  	// ID - Unique, non-empty document identifier.
    55  	ID *string `json:"id,omitempty"`
    56  	// Entities - READ-ONLY; Recognized entities in the document.
    57  	Entities *[]EntityRecord `json:"entities,omitempty"`
    58  	// Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
    59  	Statistics *DocumentStatistics `json:"statistics,omitempty"`
    60  }
    61  
    62  // MarshalJSON is the custom marshaler for EntitiesBatchResultItem.
    63  func (ebri EntitiesBatchResultItem) MarshalJSON() ([]byte, error) {
    64  	objectMap := make(map[string]interface{})
    65  	if ebri.ID != nil {
    66  		objectMap["id"] = ebri.ID
    67  	}
    68  	if ebri.Statistics != nil {
    69  		objectMap["statistics"] = ebri.Statistics
    70  	}
    71  	return json.Marshal(objectMap)
    72  }
    73  
    74  // EntityRecord ...
    75  type EntityRecord struct {
    76  	// Name - Entity formal name.
    77  	Name *string `json:"name,omitempty"`
    78  	// Matches - List of instances this entity appears in the text.
    79  	Matches *[]MatchRecord `json:"matches,omitempty"`
    80  	// WikipediaLanguage - Wikipedia language for which the WikipediaId and WikipediaUrl refers to.
    81  	WikipediaLanguage *string `json:"wikipediaLanguage,omitempty"`
    82  	// WikipediaID - Wikipedia unique identifier of the recognized entity.
    83  	WikipediaID *string `json:"wikipediaId,omitempty"`
    84  	// WikipediaURL - READ-ONLY; URL for the entity's Wikipedia page.
    85  	WikipediaURL *string `json:"wikipediaUrl,omitempty"`
    86  	// BingID - Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information.
    87  	BingID *string `json:"bingId,omitempty"`
    88  	// Type - Entity type from Named Entity Recognition model
    89  	Type *string `json:"type,omitempty"`
    90  	// SubType - Entity sub type from Named Entity Recognition model
    91  	SubType *string `json:"subType,omitempty"`
    92  }
    93  
    94  // MarshalJSON is the custom marshaler for EntityRecord.
    95  func (er EntityRecord) MarshalJSON() ([]byte, error) {
    96  	objectMap := make(map[string]interface{})
    97  	if er.Name != nil {
    98  		objectMap["name"] = er.Name
    99  	}
   100  	if er.Matches != nil {
   101  		objectMap["matches"] = er.Matches
   102  	}
   103  	if er.WikipediaLanguage != nil {
   104  		objectMap["wikipediaLanguage"] = er.WikipediaLanguage
   105  	}
   106  	if er.WikipediaID != nil {
   107  		objectMap["wikipediaId"] = er.WikipediaID
   108  	}
   109  	if er.BingID != nil {
   110  		objectMap["bingId"] = er.BingID
   111  	}
   112  	if er.Type != nil {
   113  		objectMap["type"] = er.Type
   114  	}
   115  	if er.SubType != nil {
   116  		objectMap["subType"] = er.SubType
   117  	}
   118  	return json.Marshal(objectMap)
   119  }
   120  
   121  // ErrorRecord ...
   122  type ErrorRecord struct {
   123  	// ID - Input document unique identifier the error refers to.
   124  	ID *string `json:"id,omitempty"`
   125  	// Message - Error message.
   126  	Message *string `json:"message,omitempty"`
   127  }
   128  
   129  // ErrorResponse ...
   130  type ErrorResponse struct {
   131  	Code       *string        `json:"code,omitempty"`
   132  	Message    *string        `json:"message,omitempty"`
   133  	Target     *string        `json:"target,omitempty"`
   134  	InnerError *InternalError `json:"innerError,omitempty"`
   135  }
   136  
   137  // InternalError ...
   138  type InternalError struct {
   139  	Code       *string        `json:"code,omitempty"`
   140  	Message    *string        `json:"message,omitempty"`
   141  	InnerError *InternalError `json:"innerError,omitempty"`
   142  }
   143  
   144  // KeyPhraseBatchResult ...
   145  type KeyPhraseBatchResult struct {
   146  	autorest.Response `json:"-"`
   147  	// Documents - READ-ONLY; Response by document
   148  	Documents *[]KeyPhraseBatchResultItem `json:"documents,omitempty"`
   149  	// Errors - READ-ONLY; Errors and Warnings by document
   150  	Errors *[]ErrorRecord `json:"errors,omitempty"`
   151  	// Statistics - READ-ONLY; =(Optional) if showStats=true was specified in the request this field will contain information about the request payload.
   152  	Statistics *RequestStatistics `json:"statistics,omitempty"`
   153  }
   154  
   155  // MarshalJSON is the custom marshaler for KeyPhraseBatchResult.
   156  func (kpbr KeyPhraseBatchResult) MarshalJSON() ([]byte, error) {
   157  	objectMap := make(map[string]interface{})
   158  	return json.Marshal(objectMap)
   159  }
   160  
   161  // KeyPhraseBatchResultItem ...
   162  type KeyPhraseBatchResultItem struct {
   163  	// ID - Unique, non-empty document identifier.
   164  	ID *string `json:"id,omitempty"`
   165  	// 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.
   166  	KeyPhrases *[]string `json:"keyPhrases,omitempty"`
   167  	// Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
   168  	Statistics *DocumentStatistics `json:"statistics,omitempty"`
   169  }
   170  
   171  // MarshalJSON is the custom marshaler for KeyPhraseBatchResultItem.
   172  func (kpbri KeyPhraseBatchResultItem) MarshalJSON() ([]byte, error) {
   173  	objectMap := make(map[string]interface{})
   174  	if kpbri.ID != nil {
   175  		objectMap["id"] = kpbri.ID
   176  	}
   177  	if kpbri.Statistics != nil {
   178  		objectMap["statistics"] = kpbri.Statistics
   179  	}
   180  	return json.Marshal(objectMap)
   181  }
   182  
   183  // LanguageBatchInput ...
   184  type LanguageBatchInput struct {
   185  	Documents *[]LanguageInput `json:"documents,omitempty"`
   186  }
   187  
   188  // LanguageBatchResult ...
   189  type LanguageBatchResult struct {
   190  	autorest.Response `json:"-"`
   191  	// Documents - READ-ONLY; Response by document
   192  	Documents *[]LanguageBatchResultItem `json:"documents,omitempty"`
   193  	// Errors - READ-ONLY; Errors and Warnings by document
   194  	Errors *[]ErrorRecord `json:"errors,omitempty"`
   195  	// Statistics - READ-ONLY; (Optional) if showStats=true was specified in the request this field will contain information about the request payload.
   196  	Statistics *RequestStatistics `json:"statistics,omitempty"`
   197  }
   198  
   199  // MarshalJSON is the custom marshaler for LanguageBatchResult.
   200  func (lbr LanguageBatchResult) MarshalJSON() ([]byte, error) {
   201  	objectMap := make(map[string]interface{})
   202  	return json.Marshal(objectMap)
   203  }
   204  
   205  // LanguageBatchResultItem ...
   206  type LanguageBatchResultItem struct {
   207  	// ID - Unique, non-empty document identifier.
   208  	ID *string `json:"id,omitempty"`
   209  	// DetectedLanguages - A list of extracted languages.
   210  	DetectedLanguages *[]DetectedLanguage `json:"detectedLanguages,omitempty"`
   211  	// Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
   212  	Statistics *DocumentStatistics `json:"statistics,omitempty"`
   213  }
   214  
   215  // LanguageInput ...
   216  type LanguageInput struct {
   217  	CountryHint *string `json:"countryHint,omitempty"`
   218  	// ID - Unique, non-empty document identifier.
   219  	ID   *string `json:"id,omitempty"`
   220  	Text *string `json:"text,omitempty"`
   221  }
   222  
   223  // MatchRecord ...
   224  type MatchRecord struct {
   225  	// 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.
   226  	WikipediaScore *float64 `json:"wikipediaScore,omitempty"`
   227  	// EntityTypeScore - (optional) If an entity type is recognized, a decimal number denoting the confidence level of the entity type will be returned.
   228  	EntityTypeScore *float64 `json:"entityTypeScore,omitempty"`
   229  	// Text - Entity text as appears in the request.
   230  	Text *string `json:"text,omitempty"`
   231  	// Offset - Start position (in Unicode characters) for the entity match text.
   232  	Offset *int32 `json:"offset,omitempty"`
   233  	// Length - Length (in Unicode characters) for the entity match text.
   234  	Length *int32 `json:"length,omitempty"`
   235  }
   236  
   237  // MultiLanguageBatchInput ...
   238  type MultiLanguageBatchInput struct {
   239  	Documents *[]MultiLanguageInput `json:"documents,omitempty"`
   240  }
   241  
   242  // MultiLanguageInput ...
   243  type MultiLanguageInput struct {
   244  	// Language - This is the 2 letter ISO 639-1 representation of a language. For example, use "en" for English; "es" for Spanish etc.,
   245  	Language *string `json:"language,omitempty"`
   246  	// ID - Unique, non-empty document identifier.
   247  	ID   *string `json:"id,omitempty"`
   248  	Text *string `json:"text,omitempty"`
   249  }
   250  
   251  // RequestStatistics ...
   252  type RequestStatistics struct {
   253  	// DocumentsCount - Number of documents submitted in the request.
   254  	DocumentsCount *int32 `json:"documentsCount,omitempty"`
   255  	// ValidDocumentsCount - Number of valid documents. This excludes empty, over-size limit or non-supported languages documents.
   256  	ValidDocumentsCount *int32 `json:"validDocumentsCount,omitempty"`
   257  	// ErroneousDocumentsCount - Number of invalid documents. This includes empty, over-size limit or non-supported languages documents.
   258  	ErroneousDocumentsCount *int32 `json:"erroneousDocumentsCount,omitempty"`
   259  	// TransactionsCount - Number of transactions for the request.
   260  	TransactionsCount *int64 `json:"transactionsCount,omitempty"`
   261  }
   262  
   263  // SentimentBatchResult ...
   264  type SentimentBatchResult struct {
   265  	autorest.Response `json:"-"`
   266  	// Documents - READ-ONLY; Response by document
   267  	Documents *[]SentimentBatchResultItem `json:"documents,omitempty"`
   268  	// Errors - READ-ONLY; Errors and Warnings by document
   269  	Errors *[]ErrorRecord `json:"errors,omitempty"`
   270  	// Statistics - READ-ONLY; (Optional) if showStats=true was specified in the request this field will contain information about the request payload.
   271  	Statistics *RequestStatistics `json:"statistics,omitempty"`
   272  }
   273  
   274  // MarshalJSON is the custom marshaler for SentimentBatchResult.
   275  func (sbr SentimentBatchResult) MarshalJSON() ([]byte, error) {
   276  	objectMap := make(map[string]interface{})
   277  	return json.Marshal(objectMap)
   278  }
   279  
   280  // SentimentBatchResultItem ...
   281  type SentimentBatchResultItem struct {
   282  	// ID - Unique, non-empty document identifier.
   283  	ID *string `json:"id,omitempty"`
   284  	// 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.
   285  	Score *float64 `json:"score,omitempty"`
   286  	// Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload.
   287  	Statistics *DocumentStatistics `json:"statistics,omitempty"`
   288  }
   289  

View as plain text