nlpcloud 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nlpcloud.rb +70 -30
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daea21690d482c9ee35fad3cb642d9ee5ac7664382cc967ab72c0c028d7a97ec
|
4
|
+
data.tar.gz: 7e219ff198f0000cd94e8c56cae5ba72f0c8be5c74463fde980a9264f40f1a9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa67c69f359eef5084f305e417670bd39735774c9c13a9c220488495ced061d298a4d31ad0f22f1e234d4405cd2ac9361610174e93f895af9b14723cf5b1909
|
7
|
+
data.tar.gz: d7d8b654c74b05b3abf2f5eb50e423c98f6c474fb896a2359125734c5f30d2b11311922fd682cdf46db8257016f9b826d0003e2f13452f8ec99ac6f65519b2c0
|
data/lib/nlpcloud.rb
CHANGED
@@ -27,12 +27,19 @@ module NLPCloud
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def ad_generation(keywords)
|
31
31
|
payload = {
|
32
|
-
'
|
33
|
-
'searched_entity' => searched_entity
|
32
|
+
'keywords' => keywords
|
34
33
|
}
|
35
|
-
response = RestClient.post("#{@root_url}/
|
34
|
+
response = RestClient.post("#{@root_url}/ad-generation", payload.to_json, @headers)
|
35
|
+
JSON.parse(response.body)
|
36
|
+
end
|
37
|
+
|
38
|
+
def chatbot(_text, history: nil)
|
39
|
+
payload = {
|
40
|
+
'text' => history
|
41
|
+
}
|
42
|
+
response = RestClient.post("#{@root_url}/chatbot", payload.to_json, @headers)
|
36
43
|
JSON.parse(response.body)
|
37
44
|
end
|
38
45
|
|
@@ -46,6 +53,31 @@ module NLPCloud
|
|
46
53
|
JSON.parse(response.body)
|
47
54
|
end
|
48
55
|
|
56
|
+
def dependencies(text)
|
57
|
+
payload = {
|
58
|
+
'text' => text
|
59
|
+
}
|
60
|
+
response = RestClient.post("#{@root_url}/dependencies", payload.to_json, @headers)
|
61
|
+
JSON.parse(response.body)
|
62
|
+
end
|
63
|
+
|
64
|
+
def embeddings(sentences)
|
65
|
+
payload = {
|
66
|
+
'sentences' => sentences
|
67
|
+
}
|
68
|
+
response = RestClient.post("#{@root_url}/embeddings", payload.to_json, @headers)
|
69
|
+
JSON.parse(response.body)
|
70
|
+
end
|
71
|
+
|
72
|
+
def entities(text, searched_entity: nil)
|
73
|
+
payload = {
|
74
|
+
'text' => text,
|
75
|
+
'searched_entity' => searched_entity
|
76
|
+
}
|
77
|
+
response = RestClient.post("#{@root_url}/entities", payload.to_json, @headers)
|
78
|
+
JSON.parse(response.body)
|
79
|
+
end
|
80
|
+
|
49
81
|
def generation(text, min_length: nil, max_length: nil, length_no_input: nil,
|
50
82
|
end_sequence: nil, remove_input: nil, do_sample: nil, num_beams: nil, early_stopping: nil,
|
51
83
|
no_repeat_ngram_size: nil, num_return_sequences: nil, top_k: nil, top_p: nil,
|
@@ -74,52 +106,57 @@ module NLPCloud
|
|
74
106
|
JSON.parse(response.body)
|
75
107
|
end
|
76
108
|
|
77
|
-
def
|
109
|
+
def gs_correction(text)
|
78
110
|
payload = {
|
79
111
|
'text' => text
|
80
112
|
}
|
81
|
-
response = RestClient.post("#{@root_url}/
|
113
|
+
response = RestClient.post("#{@root_url}/gs-correction", payload.to_json, @headers)
|
82
114
|
JSON.parse(response.body)
|
83
115
|
end
|
84
116
|
|
85
|
-
def
|
117
|
+
def intent_classification(text)
|
86
118
|
payload = {
|
87
|
-
'
|
88
|
-
'context' => context
|
119
|
+
'text' => text
|
89
120
|
}
|
90
|
-
response = RestClient.post("#{@root_url}/
|
121
|
+
response = RestClient.post("#{@root_url}/intent-classification", payload.to_json, @headers)
|
91
122
|
JSON.parse(response.body)
|
92
123
|
end
|
93
124
|
|
94
|
-
def
|
125
|
+
def kw_kp_extraction(text)
|
95
126
|
payload = {
|
96
127
|
'text' => text
|
97
128
|
}
|
98
|
-
response = RestClient.post("#{@root_url}/
|
129
|
+
response = RestClient.post("#{@root_url}/kw-kp-extraction", payload.to_json, @headers)
|
99
130
|
JSON.parse(response.body)
|
100
131
|
end
|
101
132
|
|
102
|
-
def
|
133
|
+
def langdetection(text)
|
103
134
|
payload = {
|
104
135
|
'text' => text
|
105
136
|
}
|
106
|
-
response = RestClient.post("#{@root_url}/
|
137
|
+
response = RestClient.post("#{@root_url}/langdetection", payload.to_json, @headers)
|
107
138
|
JSON.parse(response.body)
|
108
139
|
end
|
109
140
|
|
110
|
-
def
|
141
|
+
def lib_versions
|
142
|
+
response = RestClient.get("#{@root_url}/versions", @headers)
|
143
|
+
JSON.parse(response.body)
|
144
|
+
end
|
145
|
+
|
146
|
+
def paraphrasing(text)
|
111
147
|
payload = {
|
112
148
|
'text' => text
|
113
149
|
}
|
114
|
-
response = RestClient.post("#{@root_url}/
|
150
|
+
response = RestClient.post("#{@root_url}/paraphrasing", payload.to_json, @headers)
|
115
151
|
JSON.parse(response.body)
|
116
152
|
end
|
117
153
|
|
118
|
-
def
|
154
|
+
def question(question, context: nil)
|
119
155
|
payload = {
|
120
|
-
'
|
156
|
+
'question' => question,
|
157
|
+
'context' => context
|
121
158
|
}
|
122
|
-
response = RestClient.post("#{@root_url}/
|
159
|
+
response = RestClient.post("#{@root_url}/question", payload.to_json, @headers)
|
123
160
|
JSON.parse(response.body)
|
124
161
|
end
|
125
162
|
|
@@ -131,40 +168,43 @@ module NLPCloud
|
|
131
168
|
JSON.parse(response.body)
|
132
169
|
end
|
133
170
|
|
134
|
-
def
|
171
|
+
def sentence_dependencies(text)
|
135
172
|
payload = {
|
136
173
|
'text' => text
|
137
174
|
}
|
138
|
-
response = RestClient.post("#{@root_url}/
|
175
|
+
response = RestClient.post("#{@root_url}/sentence-dependencies", payload.to_json, @headers)
|
139
176
|
JSON.parse(response.body)
|
140
177
|
end
|
141
178
|
|
142
|
-
def
|
179
|
+
def sentiment(text)
|
143
180
|
payload = {
|
144
181
|
'text' => text
|
145
182
|
}
|
146
|
-
response = RestClient.post("#{@root_url}/
|
183
|
+
response = RestClient.post("#{@root_url}/sentiment", payload.to_json, @headers)
|
147
184
|
JSON.parse(response.body)
|
148
185
|
end
|
149
186
|
|
150
|
-
def
|
187
|
+
def summarization(text)
|
151
188
|
payload = {
|
152
189
|
'text' => text
|
153
190
|
}
|
154
|
-
response = RestClient.post("#{@root_url}/
|
191
|
+
response = RestClient.post("#{@root_url}/summarization", payload.to_json, @headers)
|
155
192
|
JSON.parse(response.body)
|
156
193
|
end
|
157
194
|
|
158
|
-
def
|
195
|
+
def tokens(text)
|
159
196
|
payload = {
|
160
|
-
'
|
197
|
+
'text' => text
|
161
198
|
}
|
162
|
-
response = RestClient.post("#{@root_url}/
|
199
|
+
response = RestClient.post("#{@root_url}/tokens", payload.to_json, @headers)
|
163
200
|
JSON.parse(response.body)
|
164
201
|
end
|
165
202
|
|
166
|
-
def
|
167
|
-
|
203
|
+
def translation(text)
|
204
|
+
payload = {
|
205
|
+
'text' => text
|
206
|
+
}
|
207
|
+
response = RestClient.post("#{@root_url}/translation", payload.to_json, @headers)
|
168
208
|
JSON.parse(response.body)
|
169
209
|
end
|
170
210
|
end
|
metadata
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nlpcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Salinas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'NLP Cloud serves high performance pre-trained or custom models for NER,
|
14
|
-
sentiment-analysis, classification, summarization, paraphrasing,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
sentiment-analysis, classification, summarization, paraphrasing, grammar and spelling
|
15
|
+
correction, keywords and keyphrases extraction, chatbot, product description and
|
16
|
+
ad generation, intent classification, text generation, question answering, machine
|
17
|
+
translation, language detection, semantic similarity, tokenization, POS tagging,
|
18
|
+
embeddings, and dependency parsing. It is ready for production, served through a
|
19
|
+
REST API. This is the Ruby client for the API. More details here: https://nlpcloud.io.
|
20
|
+
Documentation: https://docs.nlpcloud.io.'
|
19
21
|
email: all@juliensalinas.com
|
20
22
|
executables: []
|
21
23
|
extensions: []
|