cloudmersive-nlp-api-client 2.0.7 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +16 -8
- data/cloudmersive-nlp-api-client.gemspec +3 -3
- data/docs/AnalyticsApi.md +113 -3
- data/docs/ExtractEntitiesApi.md +1 -1
- data/docs/HateSpeechAnalysisRequest.md +8 -0
- data/docs/HateSpeechAnalysisResponse.md +10 -0
- data/docs/LanguageDetectionApi.md +1 -1
- data/docs/LanguageTranslationApi.md +114 -4
- data/docs/ParseApi.md +1 -1
- data/docs/PosTaggerApi.md +6 -6
- data/docs/RephraseApi.md +1 -1
- data/docs/SegmentationApi.md +2 -2
- data/docs/SimilarityAnalysisRequest.md +9 -0
- data/docs/SimilarityAnalysisResponse.md +10 -0
- data/docs/SpellcheckApi.md +2 -2
- data/lib/cloudmersive-nlp-api-client.rb +5 -1
- data/lib/cloudmersive-nlp-api-client/api/analytics_api.rb +120 -15
- data/lib/cloudmersive-nlp-api-client/api/extract_entities_api.rb +6 -7
- data/lib/cloudmersive-nlp-api-client/api/language_detection_api.rb +6 -7
- data/lib/cloudmersive-nlp-api-client/api/language_translation_api.rb +124 -20
- data/lib/cloudmersive-nlp-api-client/api/parse_api.rb +6 -7
- data/lib/cloudmersive-nlp-api-client/api/pos_tagger_api.rb +26 -32
- data/lib/cloudmersive-nlp-api-client/api/rephrase_api.rb +6 -7
- data/lib/cloudmersive-nlp-api-client/api/segmentation_api.rb +10 -12
- data/lib/cloudmersive-nlp-api-client/api/spellcheck_api.rb +10 -12
- data/lib/cloudmersive-nlp-api-client/api_client.rb +11 -9
- data/lib/cloudmersive-nlp-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-nlp-api-client/configuration.rb +2 -2
- data/lib/cloudmersive-nlp-api-client/models/check_sentence_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/check_sentence_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/check_word_request.rb +7 -11
- data/lib/cloudmersive-nlp-api-client/models/check_word_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/correct_word_in_sentence.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/entity.rb +7 -11
- data/lib/cloudmersive-nlp-api-client/models/extract_entities_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/extract_entities_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/get_words_request.rb +7 -11
- data/lib/cloudmersive-nlp-api-client/models/get_words_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/language_detection_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/language_detection_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/language_translation_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/language_translation_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/parse_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/parse_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/pos_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/pos_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/pos_sentence.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/pos_tagged_word.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/rephrase_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/rephrase_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence_option.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_request.rb +7 -11
- data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_response.rb +7 -11
- data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_request.rb +196 -0
- data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_request.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_response.rb +7 -10
- data/lib/cloudmersive-nlp-api-client/models/word_position.rb +7 -11
- data/lib/cloudmersive-nlp-api-client/version.rb +2 -2
- data/spec/api/analytics_api_spec.rb +28 -4
- data/spec/api/extract_entities_api_spec.rb +2 -2
- data/spec/api/language_detection_api_spec.rb +2 -2
- data/spec/api/language_translation_api_spec.rb +29 -5
- data/spec/api/parse_api_spec.rb +2 -2
- data/spec/api/pos_tagger_api_spec.rb +7 -7
- data/spec/api/rephrase_api_spec.rb +2 -2
- data/spec/api/segmentation_api_spec.rb +3 -3
- data/spec/api/spellcheck_api_spec.rb +3 -3
- data/spec/api_client_spec.rb +52 -35
- data/spec/configuration_spec.rb +9 -9
- data/spec/models/check_sentence_request_spec.rb +2 -3
- data/spec/models/check_sentence_response_spec.rb +3 -4
- data/spec/models/check_word_request_spec.rb +2 -3
- data/spec/models/check_word_response_spec.rb +3 -4
- data/spec/models/correct_word_in_sentence_spec.rb +4 -5
- data/spec/models/entity_spec.rb +3 -4
- data/spec/models/extract_entities_request_spec.rb +2 -3
- data/spec/models/extract_entities_response_spec.rb +3 -4
- data/spec/models/get_words_request_spec.rb +2 -3
- data/spec/models/get_words_response_spec.rb +2 -3
- data/spec/models/hate_speech_analysis_request_spec.rb +41 -0
- data/spec/models/hate_speech_analysis_response_spec.rb +53 -0
- data/spec/models/language_detection_request_spec.rb +2 -3
- data/spec/models/language_detection_response_spec.rb +4 -5
- data/spec/models/language_translation_request_spec.rb +2 -3
- data/spec/models/language_translation_response_spec.rb +4 -5
- data/spec/models/parse_request_spec.rb +2 -3
- data/spec/models/parse_response_spec.rb +2 -3
- data/spec/models/pos_request_spec.rb +2 -3
- data/spec/models/pos_response_spec.rb +2 -3
- data/spec/models/pos_sentence_spec.rb +2 -3
- data/spec/models/pos_tagged_word_spec.rb +3 -4
- data/spec/models/profanity_analysis_request_spec.rb +2 -3
- data/spec/models/profanity_analysis_response_spec.rb +4 -5
- data/spec/models/rephrase_request_spec.rb +3 -4
- data/spec/models/rephrase_response_spec.rb +4 -5
- data/spec/models/rephrased_sentence_option_spec.rb +3 -4
- data/spec/models/rephrased_sentence_spec.rb +4 -5
- data/spec/models/sentence_segmentation_request_spec.rb +2 -3
- data/spec/models/sentence_segmentation_response_spec.rb +4 -5
- data/spec/models/sentiment_analysis_request_spec.rb +2 -3
- data/spec/models/sentiment_analysis_response_spec.rb +5 -6
- data/spec/models/similarity_analysis_request_spec.rb +47 -0
- data/spec/models/similarity_analysis_response_spec.rb +53 -0
- data/spec/models/subjectivity_analysis_request_spec.rb +2 -3
- data/spec/models/subjectivity_analysis_response_spec.rb +4 -5
- data/spec/models/word_position_spec.rb +5 -6
- data/spec/spec_helper.rb +1 -1
- metadata +14 -2
data/docs/ParseApi.md
CHANGED
@@ -57,7 +57,7 @@ Name | Type | Description | Notes
|
|
57
57
|
### HTTP request headers
|
58
58
|
|
59
59
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
60
|
-
- **Accept**: application/json
|
60
|
+
- **Accept**: application/json
|
61
61
|
|
62
62
|
|
63
63
|
|
data/docs/PosTaggerApi.md
CHANGED
@@ -62,7 +62,7 @@ Name | Type | Description | Notes
|
|
62
62
|
### HTTP request headers
|
63
63
|
|
64
64
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
65
|
-
- **Accept**: application/json
|
65
|
+
- **Accept**: application/json
|
66
66
|
|
67
67
|
|
68
68
|
|
@@ -116,7 +116,7 @@ Name | Type | Description | Notes
|
|
116
116
|
### HTTP request headers
|
117
117
|
|
118
118
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
119
|
-
- **Accept**: application/json
|
119
|
+
- **Accept**: application/json
|
120
120
|
|
121
121
|
|
122
122
|
|
@@ -170,7 +170,7 @@ Name | Type | Description | Notes
|
|
170
170
|
### HTTP request headers
|
171
171
|
|
172
172
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
173
|
-
- **Accept**: application/json
|
173
|
+
- **Accept**: application/json
|
174
174
|
|
175
175
|
|
176
176
|
|
@@ -224,7 +224,7 @@ Name | Type | Description | Notes
|
|
224
224
|
### HTTP request headers
|
225
225
|
|
226
226
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
227
|
-
- **Accept**: application/json
|
227
|
+
- **Accept**: application/json
|
228
228
|
|
229
229
|
|
230
230
|
|
@@ -278,7 +278,7 @@ Name | Type | Description | Notes
|
|
278
278
|
### HTTP request headers
|
279
279
|
|
280
280
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
281
|
-
- **Accept**: application/json
|
281
|
+
- **Accept**: application/json
|
282
282
|
|
283
283
|
|
284
284
|
|
@@ -332,7 +332,7 @@ Name | Type | Description | Notes
|
|
332
332
|
### HTTP request headers
|
333
333
|
|
334
334
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
335
|
-
- **Accept**: application/json
|
335
|
+
- **Accept**: application/json
|
336
336
|
|
337
337
|
|
338
338
|
|
data/docs/RephraseApi.md
CHANGED
@@ -57,7 +57,7 @@ Name | Type | Description | Notes
|
|
57
57
|
### HTTP request headers
|
58
58
|
|
59
59
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
60
|
-
- **Accept**: application/json
|
60
|
+
- **Accept**: application/json
|
61
61
|
|
62
62
|
|
63
63
|
|
data/docs/SegmentationApi.md
CHANGED
@@ -58,7 +58,7 @@ Name | Type | Description | Notes
|
|
58
58
|
### HTTP request headers
|
59
59
|
|
60
60
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
61
|
-
- **Accept**: application/json
|
61
|
+
- **Accept**: application/json
|
62
62
|
|
63
63
|
|
64
64
|
|
@@ -112,7 +112,7 @@ Name | Type | Description | Notes
|
|
112
112
|
### HTTP request headers
|
113
113
|
|
114
114
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
115
|
-
- **Accept**: application/json
|
115
|
+
- **Accept**: application/json
|
116
116
|
|
117
117
|
|
118
118
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveNlpApiClient::SimilarityAnalysisRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**text_to_analyze1** | **String** | First text to analyze | [optional]
|
7
|
+
**text_to_analyze2** | **String** | Second text to analyze | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# CloudmersiveNlpApiClient::SimilarityAnalysisResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**successful** | **BOOLEAN** | True if the similarity analysis operation was successful, false otherwise | [optional]
|
7
|
+
**similarity_score_result** | **Float** | Similarity score between 0.0 and 1.0 where scores closer to zero have a low probability of semantic similarity, while scores close to 1.0 have a high probability of semantic similarity. | [optional]
|
8
|
+
**sentence_count** | **Integer** | Number of sentences in input text | [optional]
|
9
|
+
|
10
|
+
|
data/docs/SpellcheckApi.md
CHANGED
@@ -58,7 +58,7 @@ Name | Type | Description | Notes
|
|
58
58
|
### HTTP request headers
|
59
59
|
|
60
60
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
61
|
-
- **Accept**: application/json
|
61
|
+
- **Accept**: application/json
|
62
62
|
|
63
63
|
|
64
64
|
|
@@ -112,7 +112,7 @@ Name | Type | Description | Notes
|
|
112
112
|
### HTTP request headers
|
113
113
|
|
114
114
|
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
115
|
-
- **Accept**: application/json
|
115
|
+
- **Accept**: application/json
|
116
116
|
|
117
117
|
|
118
118
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -27,6 +27,8 @@ require 'cloudmersive-nlp-api-client/models/extract_entities_request'
|
|
27
27
|
require 'cloudmersive-nlp-api-client/models/extract_entities_response'
|
28
28
|
require 'cloudmersive-nlp-api-client/models/get_words_request'
|
29
29
|
require 'cloudmersive-nlp-api-client/models/get_words_response'
|
30
|
+
require 'cloudmersive-nlp-api-client/models/hate_speech_analysis_request'
|
31
|
+
require 'cloudmersive-nlp-api-client/models/hate_speech_analysis_response'
|
30
32
|
require 'cloudmersive-nlp-api-client/models/language_detection_request'
|
31
33
|
require 'cloudmersive-nlp-api-client/models/language_detection_response'
|
32
34
|
require 'cloudmersive-nlp-api-client/models/language_translation_request'
|
@@ -47,6 +49,8 @@ require 'cloudmersive-nlp-api-client/models/sentence_segmentation_request'
|
|
47
49
|
require 'cloudmersive-nlp-api-client/models/sentence_segmentation_response'
|
48
50
|
require 'cloudmersive-nlp-api-client/models/sentiment_analysis_request'
|
49
51
|
require 'cloudmersive-nlp-api-client/models/sentiment_analysis_response'
|
52
|
+
require 'cloudmersive-nlp-api-client/models/similarity_analysis_request'
|
53
|
+
require 'cloudmersive-nlp-api-client/models/similarity_analysis_response'
|
50
54
|
require 'cloudmersive-nlp-api-client/models/subjectivity_analysis_request'
|
51
55
|
require 'cloudmersive-nlp-api-client/models/subjectivity_analysis_response'
|
52
56
|
require 'cloudmersive-nlp-api-client/models/word_position'
|
@@ -6,11 +6,11 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'uri'
|
14
14
|
|
15
15
|
module CloudmersiveNlpApiClient
|
16
16
|
class AnalyticsApi
|
@@ -19,7 +19,60 @@ module CloudmersiveNlpApiClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Perform Hate Speech Analysis and Detection on Text
|
23
|
+
# Analyze input text using advanced Hate Speech Analysis to determine if the input contains hate speech language. Supports English language input. Consumes 1-2 API calls per sentence.
|
24
|
+
# @param input Input hate speech analysis request
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [HateSpeechAnalysisResponse]
|
27
|
+
def analytics_hate_speech(input, opts = {})
|
28
|
+
data, _status_code, _headers = analytics_hate_speech_with_http_info(input, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Perform Hate Speech Analysis and Detection on Text
|
33
|
+
# Analyze input text using advanced Hate Speech Analysis to determine if the input contains hate speech language. Supports English language input. Consumes 1-2 API calls per sentence.
|
34
|
+
# @param input Input hate speech analysis request
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(HateSpeechAnalysisResponse, Fixnum, Hash)>] HateSpeechAnalysisResponse data, response status code and response headers
|
37
|
+
def analytics_hate_speech_with_http_info(input, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_hate_speech ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'input' is set
|
42
|
+
if @api_client.config.client_side_validation && input.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_hate_speech"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/nlp-v2/analytics/hate-speech'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
22
57
|
|
58
|
+
# form parameters
|
59
|
+
form_params = {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = @api_client.object_to_http_body(input)
|
63
|
+
auth_names = ['Apikey']
|
64
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
65
|
+
:header_params => header_params,
|
66
|
+
:query_params => query_params,
|
67
|
+
:form_params => form_params,
|
68
|
+
:body => post_body,
|
69
|
+
:auth_names => auth_names,
|
70
|
+
:return_type => 'HateSpeechAnalysisResponse')
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#analytics_hate_speech\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
23
76
|
# Perform Profanity and Obscene Language Analysis and Detection on Text
|
24
77
|
# Analyze input text using advanced Profanity and Obscene Language Analysis to determine if the input contains profane language. Supports English language input. Consumes 1-2 API calls per sentence.
|
25
78
|
# @param input Input profanity analysis request
|
@@ -27,7 +80,7 @@ module CloudmersiveNlpApiClient
|
|
27
80
|
# @return [ProfanityAnalysisResponse]
|
28
81
|
def analytics_profanity(input, opts = {})
|
29
82
|
data, _status_code, _headers = analytics_profanity_with_http_info(input, opts)
|
30
|
-
|
83
|
+
data
|
31
84
|
end
|
32
85
|
|
33
86
|
# Perform Profanity and Obscene Language Analysis and Detection on Text
|
@@ -37,14 +90,14 @@ module CloudmersiveNlpApiClient
|
|
37
90
|
# @return [Array<(ProfanityAnalysisResponse, Fixnum, Hash)>] ProfanityAnalysisResponse data, response status code and response headers
|
38
91
|
def analytics_profanity_with_http_info(input, opts = {})
|
39
92
|
if @api_client.config.debugging
|
40
|
-
@api_client.config.logger.debug
|
93
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_profanity ...'
|
41
94
|
end
|
42
95
|
# verify the required parameter 'input' is set
|
43
96
|
if @api_client.config.client_side_validation && input.nil?
|
44
97
|
fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_profanity"
|
45
98
|
end
|
46
99
|
# resource path
|
47
|
-
local_var_path =
|
100
|
+
local_var_path = '/nlp-v2/analytics/profanity'
|
48
101
|
|
49
102
|
# query parameters
|
50
103
|
query_params = {}
|
@@ -52,7 +105,7 @@ module CloudmersiveNlpApiClient
|
|
52
105
|
# header parameters
|
53
106
|
header_params = {}
|
54
107
|
# HTTP header 'Accept' (if needed)
|
55
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'
|
108
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
109
|
# HTTP header 'Content-Type'
|
57
110
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
58
111
|
|
@@ -74,7 +127,6 @@ module CloudmersiveNlpApiClient
|
|
74
127
|
end
|
75
128
|
return data, status_code, headers
|
76
129
|
end
|
77
|
-
|
78
130
|
# Perform Sentiment Analysis and Classification on Text
|
79
131
|
# Analyze input text using advanced Sentiment Analysis to determine if the input is positive, negative, or neutral. Supports English language input. Consumes 1-2 API calls per sentence.
|
80
132
|
# @param input Input sentiment analysis request
|
@@ -82,7 +134,7 @@ module CloudmersiveNlpApiClient
|
|
82
134
|
# @return [SentimentAnalysisResponse]
|
83
135
|
def analytics_sentiment(input, opts = {})
|
84
136
|
data, _status_code, _headers = analytics_sentiment_with_http_info(input, opts)
|
85
|
-
|
137
|
+
data
|
86
138
|
end
|
87
139
|
|
88
140
|
# Perform Sentiment Analysis and Classification on Text
|
@@ -92,14 +144,14 @@ module CloudmersiveNlpApiClient
|
|
92
144
|
# @return [Array<(SentimentAnalysisResponse, Fixnum, Hash)>] SentimentAnalysisResponse data, response status code and response headers
|
93
145
|
def analytics_sentiment_with_http_info(input, opts = {})
|
94
146
|
if @api_client.config.debugging
|
95
|
-
@api_client.config.logger.debug
|
147
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_sentiment ...'
|
96
148
|
end
|
97
149
|
# verify the required parameter 'input' is set
|
98
150
|
if @api_client.config.client_side_validation && input.nil?
|
99
151
|
fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_sentiment"
|
100
152
|
end
|
101
153
|
# resource path
|
102
|
-
local_var_path =
|
154
|
+
local_var_path = '/nlp-v2/analytics/sentiment'
|
103
155
|
|
104
156
|
# query parameters
|
105
157
|
query_params = {}
|
@@ -107,7 +159,7 @@ module CloudmersiveNlpApiClient
|
|
107
159
|
# header parameters
|
108
160
|
header_params = {}
|
109
161
|
# HTTP header 'Accept' (if needed)
|
110
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'
|
162
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
111
163
|
# HTTP header 'Content-Type'
|
112
164
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
113
165
|
|
@@ -129,7 +181,60 @@ module CloudmersiveNlpApiClient
|
|
129
181
|
end
|
130
182
|
return data, status_code, headers
|
131
183
|
end
|
184
|
+
# Perform Semantic Similarity Comparison of Two Strings
|
185
|
+
# Analyze two input text strings, typically sentences, and determine the semantic similarity of each. Semantic similarity refers to the degree to which two sentences mean the same thing semantically. Uses advanced Deep Learning to perform the semantic similarity comparison. Consumes 1-2 API calls per sentence.
|
186
|
+
# @param input Input similarity analysis request
|
187
|
+
# @param [Hash] opts the optional parameters
|
188
|
+
# @return [SimilarityAnalysisResponse]
|
189
|
+
def analytics_similarity(input, opts = {})
|
190
|
+
data, _status_code, _headers = analytics_similarity_with_http_info(input, opts)
|
191
|
+
data
|
192
|
+
end
|
193
|
+
|
194
|
+
# Perform Semantic Similarity Comparison of Two Strings
|
195
|
+
# Analyze two input text strings, typically sentences, and determine the semantic similarity of each. Semantic similarity refers to the degree to which two sentences mean the same thing semantically. Uses advanced Deep Learning to perform the semantic similarity comparison. Consumes 1-2 API calls per sentence.
|
196
|
+
# @param input Input similarity analysis request
|
197
|
+
# @param [Hash] opts the optional parameters
|
198
|
+
# @return [Array<(SimilarityAnalysisResponse, Fixnum, Hash)>] SimilarityAnalysisResponse data, response status code and response headers
|
199
|
+
def analytics_similarity_with_http_info(input, opts = {})
|
200
|
+
if @api_client.config.debugging
|
201
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_similarity ...'
|
202
|
+
end
|
203
|
+
# verify the required parameter 'input' is set
|
204
|
+
if @api_client.config.client_side_validation && input.nil?
|
205
|
+
fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_similarity"
|
206
|
+
end
|
207
|
+
# resource path
|
208
|
+
local_var_path = '/nlp-v2/analytics/similarity'
|
132
209
|
|
210
|
+
# query parameters
|
211
|
+
query_params = {}
|
212
|
+
|
213
|
+
# header parameters
|
214
|
+
header_params = {}
|
215
|
+
# HTTP header 'Accept' (if needed)
|
216
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
217
|
+
# HTTP header 'Content-Type'
|
218
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
219
|
+
|
220
|
+
# form parameters
|
221
|
+
form_params = {}
|
222
|
+
|
223
|
+
# http body (model)
|
224
|
+
post_body = @api_client.object_to_http_body(input)
|
225
|
+
auth_names = ['Apikey']
|
226
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
227
|
+
:header_params => header_params,
|
228
|
+
:query_params => query_params,
|
229
|
+
:form_params => form_params,
|
230
|
+
:body => post_body,
|
231
|
+
:auth_names => auth_names,
|
232
|
+
:return_type => 'SimilarityAnalysisResponse')
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug "API called: AnalyticsApi#analytics_similarity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
235
|
+
end
|
236
|
+
return data, status_code, headers
|
237
|
+
end
|
133
238
|
# Perform Subjectivity and Objectivity Analysis on Text
|
134
239
|
# Analyze input text using advanced Subjectivity and Objectivity Language Analysis to determine if the input text is objective or subjective, and how much. Supports English language input. Consumes 1-2 API calls per sentence.
|
135
240
|
# @param input Input subjectivity analysis request
|
@@ -137,7 +242,7 @@ module CloudmersiveNlpApiClient
|
|
137
242
|
# @return [SubjectivityAnalysisResponse]
|
138
243
|
def analytics_subjectivity(input, opts = {})
|
139
244
|
data, _status_code, _headers = analytics_subjectivity_with_http_info(input, opts)
|
140
|
-
|
245
|
+
data
|
141
246
|
end
|
142
247
|
|
143
248
|
# Perform Subjectivity and Objectivity Analysis on Text
|
@@ -147,14 +252,14 @@ module CloudmersiveNlpApiClient
|
|
147
252
|
# @return [Array<(SubjectivityAnalysisResponse, Fixnum, Hash)>] SubjectivityAnalysisResponse data, response status code and response headers
|
148
253
|
def analytics_subjectivity_with_http_info(input, opts = {})
|
149
254
|
if @api_client.config.debugging
|
150
|
-
@api_client.config.logger.debug
|
255
|
+
@api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_subjectivity ...'
|
151
256
|
end
|
152
257
|
# verify the required parameter 'input' is set
|
153
258
|
if @api_client.config.client_side_validation && input.nil?
|
154
259
|
fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_subjectivity"
|
155
260
|
end
|
156
261
|
# resource path
|
157
|
-
local_var_path =
|
262
|
+
local_var_path = '/nlp-v2/analytics/subjectivity'
|
158
263
|
|
159
264
|
# query parameters
|
160
265
|
query_params = {}
|
@@ -162,7 +267,7 @@ module CloudmersiveNlpApiClient
|
|
162
267
|
# header parameters
|
163
268
|
header_params = {}
|
164
269
|
# HTTP header 'Accept' (if needed)
|
165
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'
|
270
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
166
271
|
# HTTP header 'Content-Type'
|
167
272
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
168
273
|
|
@@ -6,11 +6,11 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'uri'
|
14
14
|
|
15
15
|
module CloudmersiveNlpApiClient
|
16
16
|
class ExtractEntitiesApi
|
@@ -19,7 +19,6 @@ module CloudmersiveNlpApiClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
|
23
22
|
# Extract entities from string
|
24
23
|
# Extract the named entitites from an input string.
|
25
24
|
# @param value Input string
|
@@ -27,7 +26,7 @@ module CloudmersiveNlpApiClient
|
|
27
26
|
# @return [ExtractEntitiesResponse]
|
28
27
|
def extract_entities_post(value, opts = {})
|
29
28
|
data, _status_code, _headers = extract_entities_post_with_http_info(value, opts)
|
30
|
-
|
29
|
+
data
|
31
30
|
end
|
32
31
|
|
33
32
|
# Extract entities from string
|
@@ -37,14 +36,14 @@ module CloudmersiveNlpApiClient
|
|
37
36
|
# @return [Array<(ExtractEntitiesResponse, Fixnum, Hash)>] ExtractEntitiesResponse data, response status code and response headers
|
38
37
|
def extract_entities_post_with_http_info(value, opts = {})
|
39
38
|
if @api_client.config.debugging
|
40
|
-
@api_client.config.logger.debug
|
39
|
+
@api_client.config.logger.debug 'Calling API: ExtractEntitiesApi.extract_entities_post ...'
|
41
40
|
end
|
42
41
|
# verify the required parameter 'value' is set
|
43
42
|
if @api_client.config.client_side_validation && value.nil?
|
44
43
|
fail ArgumentError, "Missing the required parameter 'value' when calling ExtractEntitiesApi.extract_entities_post"
|
45
44
|
end
|
46
45
|
# resource path
|
47
|
-
local_var_path =
|
46
|
+
local_var_path = '/nlp-v2/extract-entities'
|
48
47
|
|
49
48
|
# query parameters
|
50
49
|
query_params = {}
|
@@ -52,7 +51,7 @@ module CloudmersiveNlpApiClient
|
|
52
51
|
# header parameters
|
53
52
|
header_params = {}
|
54
53
|
# HTTP header 'Accept' (if needed)
|
55
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
55
|
# HTTP header 'Content-Type'
|
57
56
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
58
57
|
|