1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
|
package textanalytics
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/textanalytics"
// DetectedLanguage ...
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"`
}
// DocumentStatistics ...
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"`
}
// EntitiesBatchResult ...
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"`
}
// MarshalJSON is the custom marshaler for EntitiesBatchResult.
func (ebr EntitiesBatchResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// EntitiesBatchResultItem ...
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"`
}
// MarshalJSON is the custom marshaler for EntitiesBatchResultItem.
func (ebri EntitiesBatchResultItem) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ebri.ID != nil {
objectMap["id"] = ebri.ID
}
if ebri.Statistics != nil {
objectMap["statistics"] = ebri.Statistics
}
return json.Marshal(objectMap)
}
// EntityRecord ...
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"`
}
// MarshalJSON is the custom marshaler for EntityRecord.
func (er EntityRecord) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if er.Name != nil {
objectMap["name"] = er.Name
}
if er.Matches != nil {
objectMap["matches"] = er.Matches
}
if er.WikipediaLanguage != nil {
objectMap["wikipediaLanguage"] = er.WikipediaLanguage
}
if er.WikipediaID != nil {
objectMap["wikipediaId"] = er.WikipediaID
}
if er.BingID != nil {
objectMap["bingId"] = er.BingID
}
if er.Type != nil {
objectMap["type"] = er.Type
}
if er.SubType != nil {
objectMap["subType"] = er.SubType
}
return json.Marshal(objectMap)
}
// ErrorRecord ...
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"`
}
// ErrorResponse ...
type ErrorResponse struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
InnerError *InternalError `json:"innerError,omitempty"`
}
// InternalError ...
type InternalError struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
InnerError *InternalError `json:"innerError,omitempty"`
}
// KeyPhraseBatchResult ...
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"`
}
// MarshalJSON is the custom marshaler for KeyPhraseBatchResult.
func (kpbr KeyPhraseBatchResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// KeyPhraseBatchResultItem ...
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"`
}
// MarshalJSON is the custom marshaler for KeyPhraseBatchResultItem.
func (kpbri KeyPhraseBatchResultItem) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if kpbri.ID != nil {
objectMap["id"] = kpbri.ID
}
if kpbri.Statistics != nil {
objectMap["statistics"] = kpbri.Statistics
}
return json.Marshal(objectMap)
}
// LanguageBatchInput ...
type LanguageBatchInput struct {
Documents *[]LanguageInput `json:"documents,omitempty"`
}
// LanguageBatchResult ...
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"`
}
// MarshalJSON is the custom marshaler for LanguageBatchResult.
func (lbr LanguageBatchResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// LanguageBatchResultItem ...
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"`
}
// LanguageInput ...
type LanguageInput struct {
CountryHint *string `json:"countryHint,omitempty"`
// ID - Unique, non-empty document identifier.
ID *string `json:"id,omitempty"`
Text *string `json:"text,omitempty"`
}
// MatchRecord ...
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"`
}
// MultiLanguageBatchInput ...
type MultiLanguageBatchInput struct {
Documents *[]MultiLanguageInput `json:"documents,omitempty"`
}
// MultiLanguageInput ...
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"`
}
// RequestStatistics ...
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"`
}
// SentimentBatchResult ...
type SentimentBatchResult struct {
autorest.Response `json:"-"`
// 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"`
}
// MarshalJSON is the custom marshaler for SentimentBatchResult.
func (sbr SentimentBatchResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// SentimentBatchResultItem ...
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"`
}
|