azure_cognitiveservices_textanalytics 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f341f103dec2eebc55f252e138e7b0d0016fa602
4
- data.tar.gz: 03dcb7704cf0049aa71b6c010ef15ef5e5b6ec32
3
+ metadata.gz: 1fb44cd82e6723dfd0a8ce5fd2339688accda3e2
4
+ data.tar.gz: f63f79be920d9b1baa2166f577e6bf4c5f237bc1
5
5
  SHA512:
6
- metadata.gz: 3f6575a4527069599ec6e810ab6be8adeee10af1c190373b3ccbf08ca4f92885ed05a1edb21b186bf2b1f0df3b483107fd20c55ee9e8b490d45391c62f20acfc
7
- data.tar.gz: 1d4275f9c30ea4669e1d357b0d46fd836aeee27c90659f6b8ee0bc10e4a1c511b39a1b8b219ba0fc3cac3be2f83518de56b00872d2cb4478a62304de7f59f5a3
6
+ metadata.gz: 32173b1a53265a118dba5980633cb89796f88eeb1ea17f3fffad9632b5ca04106966f93ec354dc77f553bd45659799618b5d480b7d7eaf462f41d25d611e4ef3
7
+ data.tar.gz: 55c663a15b8150203acbaf7a479677389f348b5aaaad48e725faf5df0fe947d435eb5482c7508375db8900830d33c33e8982a5d34b1879712328955d864c69ea
@@ -7,21 +7,24 @@ require 'azure_cognitiveservices_textanalytics'
7
7
  module Azure::TextAnalytics::Profiles::Latest
8
8
 
9
9
  module Models
10
- Input = Azure::CognitiveServices::TextAnalytics::V2_0::Models::Input
11
- MultiLanguageInput = Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageInput
12
- BatchInput = Azure::CognitiveServices::TextAnalytics::V2_0::Models::BatchInput
13
- KeyPhraseBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_0::Models::KeyPhraseBatchResultItem
14
10
  DetectedLanguage = Azure::CognitiveServices::TextAnalytics::V2_0::Models::DetectedLanguage
15
- KeyPhraseBatchResult = Azure::CognitiveServices::TextAnalytics::V2_0::Models::KeyPhraseBatchResult
11
+ MultiLanguageInput = Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageInput
16
12
  LanguageBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_0::Models::LanguageBatchResultItem
17
- ErrorResponse = Azure::CognitiveServices::TextAnalytics::V2_0::Models::ErrorResponse
13
+ KeyPhraseBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_0::Models::KeyPhraseBatchResultItem
18
14
  LanguageBatchResult = Azure::CognitiveServices::TextAnalytics::V2_0::Models::LanguageBatchResult
19
- ErrorRecord = Azure::CognitiveServices::TextAnalytics::V2_0::Models::ErrorRecord
15
+ KeyPhraseBatchResult = Azure::CognitiveServices::TextAnalytics::V2_0::Models::KeyPhraseBatchResult
20
16
  SentimentBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_0::Models::SentimentBatchResultItem
21
- MultiLanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageBatchInput
17
+ ErrorResponse = Azure::CognitiveServices::TextAnalytics::V2_0::Models::ErrorResponse
22
18
  SentimentBatchResult = Azure::CognitiveServices::TextAnalytics::V2_0::Models::SentimentBatchResult
19
+ BatchInput = Azure::CognitiveServices::TextAnalytics::V2_0::Models::BatchInput
20
+ MatchRecord = Azure::CognitiveServices::TextAnalytics::V2_0::Models::MatchRecord
21
+ ErrorRecord = Azure::CognitiveServices::TextAnalytics::V2_0::Models::ErrorRecord
22
+ EntityRecord = Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntityRecord
23
+ Input = Azure::CognitiveServices::TextAnalytics::V2_0::Models::Input
24
+ EntitiesBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntitiesBatchResultItem
23
25
  InternalError = Azure::CognitiveServices::TextAnalytics::V2_0::Models::InternalError
24
- AzureRegions = Azure::CognitiveServices::TextAnalytics::V2_0::Models::AzureRegions
26
+ EntitiesBatchResult = Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntitiesBatchResult
27
+ MultiLanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageBatchInput
25
28
  end
26
29
 
27
30
  #
@@ -68,50 +71,59 @@ module Azure::TextAnalytics::Profiles::Latest
68
71
  end
69
72
 
70
73
  class ModelClasses
71
- def input
72
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::Input
74
+ def detected_language
75
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::DetectedLanguage
73
76
  end
74
77
  def multi_language_input
75
78
  Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageInput
76
79
  end
77
- def batch_input
78
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::BatchInput
80
+ def language_batch_result_item
81
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::LanguageBatchResultItem
79
82
  end
80
83
  def key_phrase_batch_result_item
81
84
  Azure::CognitiveServices::TextAnalytics::V2_0::Models::KeyPhraseBatchResultItem
82
85
  end
83
- def detected_language
84
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::DetectedLanguage
86
+ def language_batch_result
87
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::LanguageBatchResult
85
88
  end
86
89
  def key_phrase_batch_result
87
90
  Azure::CognitiveServices::TextAnalytics::V2_0::Models::KeyPhraseBatchResult
88
91
  end
89
- def language_batch_result_item
90
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::LanguageBatchResultItem
92
+ def sentiment_batch_result_item
93
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::SentimentBatchResultItem
91
94
  end
92
95
  def error_response
93
96
  Azure::CognitiveServices::TextAnalytics::V2_0::Models::ErrorResponse
94
97
  end
95
- def language_batch_result
96
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::LanguageBatchResult
98
+ def sentiment_batch_result
99
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::SentimentBatchResult
100
+ end
101
+ def batch_input
102
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::BatchInput
103
+ end
104
+ def match_record
105
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::MatchRecord
97
106
  end
98
107
  def error_record
99
108
  Azure::CognitiveServices::TextAnalytics::V2_0::Models::ErrorRecord
100
109
  end
101
- def sentiment_batch_result_item
102
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::SentimentBatchResultItem
110
+ def entity_record
111
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntityRecord
103
112
  end
104
- def multi_language_batch_input
105
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageBatchInput
113
+ def input
114
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::Input
106
115
  end
107
- def sentiment_batch_result
108
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::SentimentBatchResult
116
+ def entities_batch_result_item
117
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntitiesBatchResultItem
109
118
  end
110
119
  def internal_error
111
120
  Azure::CognitiveServices::TextAnalytics::V2_0::Models::InternalError
112
121
  end
113
- def azure_regions
114
- Azure::CognitiveServices::TextAnalytics::V2_0::Models::AzureRegions
122
+ def entities_batch_result
123
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntitiesBatchResult
124
+ end
125
+ def multi_language_batch_input
126
+ Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageBatchInput
115
127
  end
116
128
  end
117
129
  end
@@ -23,20 +23,23 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
23
23
  autoload :TextAnalyticsClient, 'v2.0/generated/azure_cognitiveservices_textanalytics/text_analytics_client.rb'
24
24
 
25
25
  module Models
26
- autoload :Input, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/input.rb'
27
- autoload :MultiLanguageInput, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/multi_language_input.rb'
28
- autoload :BatchInput, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/batch_input.rb'
29
- autoload :KeyPhraseBatchResultItem, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result_item.rb'
30
26
  autoload :DetectedLanguage, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/detected_language.rb'
31
- autoload :KeyPhraseBatchResult, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result.rb'
27
+ autoload :MultiLanguageInput, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/multi_language_input.rb'
32
28
  autoload :LanguageBatchResultItem, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/language_batch_result_item.rb'
33
- autoload :ErrorResponse, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/error_response.rb'
29
+ autoload :KeyPhraseBatchResultItem, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result_item.rb'
34
30
  autoload :LanguageBatchResult, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/language_batch_result.rb'
35
- autoload :ErrorRecord, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/error_record.rb'
31
+ autoload :KeyPhraseBatchResult, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result.rb'
36
32
  autoload :SentimentBatchResultItem, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/sentiment_batch_result_item.rb'
37
- autoload :MultiLanguageBatchInput, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/multi_language_batch_input.rb'
33
+ autoload :ErrorResponse, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/error_response.rb'
38
34
  autoload :SentimentBatchResult, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/sentiment_batch_result.rb'
35
+ autoload :BatchInput, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/batch_input.rb'
36
+ autoload :MatchRecord, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/match_record.rb'
37
+ autoload :ErrorRecord, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/error_record.rb'
38
+ autoload :EntityRecord, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/entity_record.rb'
39
+ autoload :Input, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/input.rb'
40
+ autoload :EntitiesBatchResultItem, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/entities_batch_result_item.rb'
39
41
  autoload :InternalError, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/internal_error.rb'
40
- autoload :AzureRegions, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/azure_regions.rb'
42
+ autoload :EntitiesBatchResult, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/entities_batch_result.rb'
43
+ autoload :MultiLanguageBatchInput, 'v2.0/generated/azure_cognitiveservices_textanalytics/models/multi_language_batch_input.rb'
41
44
  end
42
45
  end
@@ -0,0 +1,78 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::TextAnalytics::V2_0
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class EntitiesBatchResult
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Array<EntitiesBatchResultItem>]
17
+ attr_accessor :documents
18
+
19
+ # @return [Array<ErrorRecord>]
20
+ attr_accessor :errors
21
+
22
+
23
+ #
24
+ # Mapper for EntitiesBatchResult class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'EntitiesBatchResult',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'EntitiesBatchResult',
35
+ model_properties: {
36
+ documents: {
37
+ client_side_validation: true,
38
+ required: false,
39
+ read_only: true,
40
+ serialized_name: 'documents',
41
+ type: {
42
+ name: 'Sequence',
43
+ element: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'EntitiesBatchResultItemElementType',
47
+ type: {
48
+ name: 'Composite',
49
+ class_name: 'EntitiesBatchResultItem'
50
+ }
51
+ }
52
+ }
53
+ },
54
+ errors: {
55
+ client_side_validation: true,
56
+ required: false,
57
+ read_only: true,
58
+ serialized_name: 'errors',
59
+ type: {
60
+ name: 'Sequence',
61
+ element: {
62
+ client_side_validation: true,
63
+ required: false,
64
+ serialized_name: 'ErrorRecordElementType',
65
+ type: {
66
+ name: 'Composite',
67
+ class_name: 'ErrorRecord'
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,69 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::TextAnalytics::V2_0
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class EntitiesBatchResultItem
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Unique document identifier.
17
+ attr_accessor :id
18
+
19
+ # @return [Array<EntityRecord>] Recognized entities in the document.
20
+ attr_accessor :entities
21
+
22
+
23
+ #
24
+ # Mapper for EntitiesBatchResultItem class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'EntitiesBatchResultItem',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'EntitiesBatchResultItem',
35
+ model_properties: {
36
+ id: {
37
+ client_side_validation: true,
38
+ required: false,
39
+ read_only: true,
40
+ serialized_name: 'id',
41
+ type: {
42
+ name: 'String'
43
+ }
44
+ },
45
+ entities: {
46
+ client_side_validation: true,
47
+ required: false,
48
+ read_only: true,
49
+ serialized_name: 'entities',
50
+ type: {
51
+ name: 'Sequence',
52
+ element: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'EntityRecordElementType',
56
+ type: {
57
+ name: 'Composite',
58
+ class_name: 'EntityRecord'
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,117 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::TextAnalytics::V2_0
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class EntityRecord
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Entity formal name.
17
+ attr_accessor :name
18
+
19
+ # @return [Array<MatchRecord>] List of instances this entity appears in
20
+ # the text.
21
+ attr_accessor :matches
22
+
23
+ # @return [String] Wikipedia language for which the WikipediaId and
24
+ # WikipediaUrl refers to.
25
+ attr_accessor :wikipedia_language
26
+
27
+ # @return [String] Wikipedia unique identifier of the recognized entity.
28
+ attr_accessor :wikipedia_id
29
+
30
+ # @return [String] URL for the entity's English Wikipedia page.
31
+ attr_accessor :wikipedia_url
32
+
33
+ # @return [String] Bing unique identifier of the recognized entity. Use
34
+ # in conjunction with the Bing Entity Search API to fetch additional
35
+ # relevant information.
36
+ attr_accessor :bing_id
37
+
38
+
39
+ #
40
+ # Mapper for EntityRecord class as Ruby Hash.
41
+ # This will be used for serialization/deserialization.
42
+ #
43
+ def self.mapper()
44
+ {
45
+ client_side_validation: true,
46
+ required: false,
47
+ serialized_name: 'EntityRecord',
48
+ type: {
49
+ name: 'Composite',
50
+ class_name: 'EntityRecord',
51
+ model_properties: {
52
+ name: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'name',
56
+ type: {
57
+ name: 'String'
58
+ }
59
+ },
60
+ matches: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ read_only: true,
64
+ serialized_name: 'matches',
65
+ type: {
66
+ name: 'Sequence',
67
+ element: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'MatchRecordElementType',
71
+ type: {
72
+ name: 'Composite',
73
+ class_name: 'MatchRecord'
74
+ }
75
+ }
76
+ }
77
+ },
78
+ wikipedia_language: {
79
+ client_side_validation: true,
80
+ required: false,
81
+ serialized_name: 'wikipediaLanguage',
82
+ type: {
83
+ name: 'String'
84
+ }
85
+ },
86
+ wikipedia_id: {
87
+ client_side_validation: true,
88
+ required: false,
89
+ serialized_name: 'wikipediaId',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ },
94
+ wikipedia_url: {
95
+ client_side_validation: true,
96
+ required: false,
97
+ read_only: true,
98
+ serialized_name: 'wikipediaUrl',
99
+ type: {
100
+ name: 'String'
101
+ }
102
+ },
103
+ bing_id: {
104
+ client_side_validation: true,
105
+ required: false,
106
+ serialized_name: 'bingId',
107
+ type: {
108
+ name: 'String'
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ end
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::TextAnalytics::V2_0
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class MatchRecord
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Entity text as appears in the request.
17
+ attr_accessor :text
18
+
19
+ # @return [Integer] Start position (in Unicode characters) for the entity
20
+ # match text.
21
+ attr_accessor :offset
22
+
23
+ # @return [Integer] Length (in Unicode characters) for the entity match
24
+ # text.
25
+ attr_accessor :length
26
+
27
+
28
+ #
29
+ # Mapper for MatchRecord class as Ruby Hash.
30
+ # This will be used for serialization/deserialization.
31
+ #
32
+ def self.mapper()
33
+ {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'MatchRecord',
37
+ type: {
38
+ name: 'Composite',
39
+ class_name: 'MatchRecord',
40
+ model_properties: {
41
+ text: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ serialized_name: 'text',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ },
49
+ offset: {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'offset',
53
+ type: {
54
+ name: 'Number'
55
+ }
56
+ },
57
+ length: {
58
+ client_side_validation: true,
59
+ required: false,
60
+ serialized_name: 'length',
61
+ type: {
62
+ name: 'Number'
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ end
69
+ end
70
+ end
71
+ end
@@ -12,41 +12,36 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
12
12
  include MsRestAzure::Serialization
13
13
 
14
14
  # @return [String] the base URI of the service.
15
- attr_reader :base_url
15
+ attr_accessor :base_url
16
16
 
17
17
  # @return Credentials needed for the client to connect to Azure.
18
18
  attr_reader :credentials1
19
19
 
20
- # @return [AzureRegions] Supported Azure regions for Cognitive Services
21
- # endpoints. Possible values include: 'westus', 'westeurope',
22
- # 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus',
23
- # 'southcentralus', 'northeurope', 'eastasia', 'australiaeast',
24
- # 'brazilsouth'
25
- attr_accessor :azure_region
26
-
27
20
  # @return Subscription credentials which uniquely identify client
28
21
  # subscription.
29
22
  attr_accessor :credentials
30
23
 
31
- # @return [String] Gets or sets the preferred language for the response.
24
+ # @return [String] The preferred language for the response.
32
25
  attr_accessor :accept_language
33
26
 
34
- # @return [Integer] Gets or sets the retry timeout in seconds for Long
35
- # Running Operations. Default value is 30.
27
+ # @return [Integer] The retry timeout in seconds for Long Running
28
+ # Operations. Default value is 30.
36
29
  attr_accessor :long_running_operation_retry_timeout
37
30
 
38
- # @return [Boolean] When set to true a unique x-ms-client-request-id value
39
- # is generated and included in each request. Default is true.
31
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
32
+ # generated. When set to true a unique x-ms-client-request-id value is
33
+ # generated and included in each request. Default is true.
40
34
  attr_accessor :generate_client_request_id
41
35
 
42
36
  #
43
37
  # Creates initializes a new instance of the TextAnalyticsClient class.
44
38
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
39
+ # @param base_url [String] the base URI of the service.
45
40
  # @param options [Array] filters to be applied to the HTTP requests.
46
41
  #
47
- def initialize(credentials = nil, options = nil)
42
+ def initialize(credentials = nil, base_url = nil, options = nil)
48
43
  super(credentials, options)
49
- @base_url = 'https://{AzureRegion}.api.cognitive.microsoft.com/text/analytics'
44
+ @base_url = base_url || 'https://api.cognitive.microsoft.com/text/analytics/v2.0'
50
45
 
51
46
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
52
47
  @credentials = credentials
@@ -119,8 +114,7 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
119
114
  # The API returns a list of strings denoting the key talking points in the
120
115
  # input text.
121
116
  #
122
- # We employ techniques from Microsoft Office's sophisticated Natural Language
123
- # Processing toolkit. See the <a
117
+ # See the <a
124
118
  # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
125
119
  # Analytics Documentation</a> for details about the languages that are
126
120
  # supported by key phrase extraction.
@@ -141,8 +135,7 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
141
135
  # The API returns a list of strings denoting the key talking points in the
142
136
  # input text.
143
137
  #
144
- # We employ techniques from Microsoft Office's sophisticated Natural Language
145
- # Processing toolkit. See the <a
138
+ # See the <a
146
139
  # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
147
140
  # Analytics Documentation</a> for details about the languages that are
148
141
  # supported by key phrase extraction.
@@ -162,8 +155,7 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
162
155
  # The API returns a list of strings denoting the key talking points in the
163
156
  # input text.
164
157
  #
165
- # We employ techniques from Microsoft Office's sophisticated Natural Language
166
- # Processing toolkit. See the <a
158
+ # See the <a
167
159
  # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
168
160
  # Analytics Documentation</a> for details about the languages that are
169
161
  # supported by key phrase extraction.
@@ -176,7 +168,6 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
176
168
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
177
169
  #
178
170
  def key_phrases_async(input, custom_headers:nil)
179
- fail ArgumentError, 'azure_region is nil' if azure_region.nil?
180
171
  fail ArgumentError, 'input is nil' if input.nil?
181
172
 
182
173
 
@@ -192,10 +183,9 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
192
183
  request_content = self.serialize(request_mapper, input)
193
184
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
194
185
 
195
- path_template = 'v2.0/keyPhrases'
186
+ path_template = 'keyPhrases'
196
187
 
197
188
  request_url = @base_url || self.base_url
198
- request_url = request_url.gsub('{AzureRegion}', azure_region)
199
189
 
200
190
  options = {
201
191
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -278,7 +268,6 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
278
268
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
279
269
  #
280
270
  def detect_language_async(input, custom_headers:nil)
281
- fail ArgumentError, 'azure_region is nil' if azure_region.nil?
282
271
  fail ArgumentError, 'input is nil' if input.nil?
283
272
 
284
273
 
@@ -294,10 +283,9 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
294
283
  request_content = self.serialize(request_mapper, input)
295
284
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
296
285
 
297
- path_template = 'v2.0/languages'
286
+ path_template = 'languages'
298
287
 
299
288
  request_url = @base_url || self.base_url
300
- request_url = request_url.gsub('{AzureRegion}', azure_region)
301
289
 
302
290
  options = {
303
291
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -338,10 +326,8 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
338
326
  # The API returns a numeric score between 0 and 1.
339
327
  #
340
328
  # Scores close to 1 indicate positive sentiment, while scores close to 0
341
- # indicate negative sentiment. Sentiment score is generated using
342
- # classification techniques. The input features to the classifier include
343
- # n-grams, features generated from part-of-speech tags, and word embeddings.
344
- # See the <a
329
+ # indicate negative sentiment. A score of 0.5 indicates the lack of sentiment
330
+ # (e.g. a factoid statement). See the <a
345
331
  # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
346
332
  # Analytics Documentation</a> for details about the languages that are
347
333
  # supported by sentiment analysis.
@@ -361,10 +347,8 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
361
347
  # The API returns a numeric score between 0 and 1.
362
348
  #
363
349
  # Scores close to 1 indicate positive sentiment, while scores close to 0
364
- # indicate negative sentiment. Sentiment score is generated using
365
- # classification techniques. The input features to the classifier include
366
- # n-grams, features generated from part-of-speech tags, and word embeddings.
367
- # See the <a
350
+ # indicate negative sentiment. A score of 0.5 indicates the lack of sentiment
351
+ # (e.g. a factoid statement). See the <a
368
352
  # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
369
353
  # Analytics Documentation</a> for details about the languages that are
370
354
  # supported by sentiment analysis.
@@ -383,10 +367,8 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
383
367
  # The API returns a numeric score between 0 and 1.
384
368
  #
385
369
  # Scores close to 1 indicate positive sentiment, while scores close to 0
386
- # indicate negative sentiment. Sentiment score is generated using
387
- # classification techniques. The input features to the classifier include
388
- # n-grams, features generated from part-of-speech tags, and word embeddings.
389
- # See the <a
370
+ # indicate negative sentiment. A score of 0.5 indicates the lack of sentiment
371
+ # (e.g. a factoid statement). See the <a
390
372
  # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
391
373
  # Analytics Documentation</a> for details about the languages that are
392
374
  # supported by sentiment analysis.
@@ -398,7 +380,6 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
398
380
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
399
381
  #
400
382
  def sentiment_async(input, custom_headers:nil)
401
- fail ArgumentError, 'azure_region is nil' if azure_region.nil?
402
383
  fail ArgumentError, 'input is nil' if input.nil?
403
384
 
404
385
 
@@ -414,10 +395,9 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
414
395
  request_content = self.serialize(request_mapper, input)
415
396
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
416
397
 
417
- path_template = 'v2.0/sentiment'
398
+ path_template = 'sentiment'
418
399
 
419
400
  request_url = @base_url || self.base_url
420
- request_url = request_url.gsub('{AzureRegion}', azure_region)
421
401
 
422
402
  options = {
423
403
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -454,6 +434,115 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
454
434
  promise.execute
455
435
  end
456
436
 
437
+ #
438
+ # The API returns a list of recognized entities in a given document.
439
+ #
440
+ # To get even more information on each recognized entity we recommend using the
441
+ # Bing Entity Search API by querying for the recognized entities names. See the
442
+ # <a
443
+ # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
444
+ # languages in Text Analytics API</a> for the list of enabled languages.
445
+ #
446
+ # @param input [MultiLanguageBatchInput] Collection of documents to analyze.
447
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
448
+ # will be added to the HTTP request.
449
+ #
450
+ # @return [EntitiesBatchResult] operation results.
451
+ #
452
+ def entities(input, custom_headers:nil)
453
+ response = entities_async(input, custom_headers:custom_headers).value!
454
+ response.body unless response.nil?
455
+ end
456
+
457
+ #
458
+ # The API returns a list of recognized entities in a given document.
459
+ #
460
+ # To get even more information on each recognized entity we recommend using the
461
+ # Bing Entity Search API by querying for the recognized entities names. See the
462
+ # <a
463
+ # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
464
+ # languages in Text Analytics API</a> for the list of enabled languages.
465
+ #
466
+ # @param input [MultiLanguageBatchInput] Collection of documents to analyze.
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
471
+ #
472
+ def entities_with_http_info(input, custom_headers:nil)
473
+ entities_async(input, custom_headers:custom_headers).value!
474
+ end
475
+
476
+ #
477
+ # The API returns a list of recognized entities in a given document.
478
+ #
479
+ # To get even more information on each recognized entity we recommend using the
480
+ # Bing Entity Search API by querying for the recognized entities names. See the
481
+ # <a
482
+ # href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
483
+ # languages in Text Analytics API</a> for the list of enabled languages.
484
+ #
485
+ # @param input [MultiLanguageBatchInput] Collection of documents to analyze.
486
+ # @param [Hash{String => String}] A hash of custom headers that will be added
487
+ # to the HTTP request.
488
+ #
489
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
490
+ #
491
+ def entities_async(input, custom_headers:nil)
492
+ fail ArgumentError, 'input is nil' if input.nil?
493
+
494
+
495
+ request_headers = {}
496
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
497
+
498
+ # Set Headers
499
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
500
+ request_headers['accept-language'] = accept_language unless accept_language.nil?
501
+
502
+ # Serialize Request
503
+ request_mapper = Azure::CognitiveServices::TextAnalytics::V2_0::Models::MultiLanguageBatchInput.mapper()
504
+ request_content = self.serialize(request_mapper, input)
505
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
506
+
507
+ path_template = 'entities'
508
+
509
+ request_url = @base_url || self.base_url
510
+
511
+ options = {
512
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
513
+ body: request_content,
514
+ headers: request_headers.merge(custom_headers || {}),
515
+ base_url: request_url
516
+ }
517
+ promise = self.make_request_async(:post, path_template, options)
518
+
519
+ promise = promise.then do |result|
520
+ http_response = result.response
521
+ status_code = http_response.status
522
+ response_content = http_response.body
523
+ unless status_code == 200
524
+ error_model = JSON.load(response_content)
525
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
526
+ end
527
+
528
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
529
+ # Deserialize Response
530
+ if status_code == 200
531
+ begin
532
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
533
+ result_mapper = Azure::CognitiveServices::TextAnalytics::V2_0::Models::EntitiesBatchResult.mapper()
534
+ result.body = self.deserialize(result_mapper, parsed_response)
535
+ rescue Exception => e
536
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
537
+ end
538
+ end
539
+
540
+ result
541
+ end
542
+
543
+ promise.execute
544
+ end
545
+
457
546
 
458
547
  private
459
548
  #
@@ -461,7 +550,7 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
461
550
  #
462
551
  def add_telemetry
463
552
  sdk_information = 'azure_cognitiveservices_textanalytics'
464
- sdk_information = "#{sdk_information}/0.16.0"
553
+ sdk_information = "#{sdk_information}/0.17.0"
465
554
  add_user_agent_information(sdk_information)
466
555
  end
467
556
  end
data/lib/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::CognitiveServices::TextAnalytics
6
- VERSION = '0.16.0'
6
+ VERSION = '0.17.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_cognitiveservices_textanalytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-12 00:00:00.000000000 Z
11
+ date: 2018-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.10.0
75
+ version: 0.11.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.10.0
82
+ version: 0.11.0
83
83
  description: Microsoft Azure Cognitive Services Text Analytics Client Library for
84
84
  Ruby
85
85
  email: azrubyteam@microsoft.com
@@ -94,9 +94,11 @@ files:
94
94
  - lib/profiles/latest/textanalytics_latest_profile_client.rb
95
95
  - lib/profiles/latest/textanalytics_module_definition.rb
96
96
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics.rb
97
- - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/azure_regions.rb
98
97
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/batch_input.rb
99
98
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/detected_language.rb
99
+ - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/entities_batch_result.rb
100
+ - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/entities_batch_result_item.rb
101
+ - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/entity_record.rb
100
102
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/error_record.rb
101
103
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/error_response.rb
102
104
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/input.rb
@@ -105,6 +107,7 @@ files:
105
107
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result_item.rb
106
108
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/language_batch_result.rb
107
109
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/language_batch_result_item.rb
110
+ - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/match_record.rb
108
111
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/multi_language_batch_input.rb
109
112
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/multi_language_input.rb
110
113
  - lib/v2.0/generated/azure_cognitiveservices_textanalytics/models/sentiment_batch_result.rb
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator.
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::CognitiveServices::TextAnalytics::V2_0
7
- module Models
8
- #
9
- # Defines values for AzureRegions
10
- #
11
- module AzureRegions
12
- Westus = "westus"
13
- Westeurope = "westeurope"
14
- Southeastasia = "southeastasia"
15
- Eastus2 = "eastus2"
16
- Westcentralus = "westcentralus"
17
- Westus2 = "westus2"
18
- Eastus = "eastus"
19
- Southcentralus = "southcentralus"
20
- Northeurope = "northeurope"
21
- Eastasia = "eastasia"
22
- Australiaeast = "australiaeast"
23
- Brazilsouth = "brazilsouth"
24
- end
25
- end
26
- end