nlpcloud 1.0.18 → 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 +75 -26
- metadata +8 -6
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,11 +27,19 @@ module NLPCloud
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def ad_generation(keywords)
|
31
31
|
payload = {
|
32
|
-
'
|
32
|
+
'keywords' => keywords
|
33
33
|
}
|
34
|
-
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)
|
35
43
|
JSON.parse(response.body)
|
36
44
|
end
|
37
45
|
|
@@ -45,6 +53,31 @@ module NLPCloud
|
|
45
53
|
JSON.parse(response.body)
|
46
54
|
end
|
47
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
|
+
|
48
81
|
def generation(text, min_length: nil, max_length: nil, length_no_input: nil,
|
49
82
|
end_sequence: nil, remove_input: nil, do_sample: nil, num_beams: nil, early_stopping: nil,
|
50
83
|
no_repeat_ngram_size: nil, num_return_sequences: nil, top_k: nil, top_p: nil,
|
@@ -73,44 +106,57 @@ module NLPCloud
|
|
73
106
|
JSON.parse(response.body)
|
74
107
|
end
|
75
108
|
|
76
|
-
def
|
109
|
+
def gs_correction(text)
|
77
110
|
payload = {
|
78
111
|
'text' => text
|
79
112
|
}
|
80
|
-
response = RestClient.post("#{@root_url}/
|
113
|
+
response = RestClient.post("#{@root_url}/gs-correction", payload.to_json, @headers)
|
81
114
|
JSON.parse(response.body)
|
82
115
|
end
|
83
116
|
|
84
|
-
def
|
117
|
+
def intent_classification(text)
|
85
118
|
payload = {
|
86
|
-
'
|
87
|
-
'context' => context
|
119
|
+
'text' => text
|
88
120
|
}
|
89
|
-
response = RestClient.post("#{@root_url}/
|
121
|
+
response = RestClient.post("#{@root_url}/intent-classification", payload.to_json, @headers)
|
90
122
|
JSON.parse(response.body)
|
91
123
|
end
|
92
124
|
|
93
|
-
def
|
125
|
+
def kw_kp_extraction(text)
|
94
126
|
payload = {
|
95
127
|
'text' => text
|
96
128
|
}
|
97
|
-
response = RestClient.post("#{@root_url}/
|
129
|
+
response = RestClient.post("#{@root_url}/kw-kp-extraction", payload.to_json, @headers)
|
98
130
|
JSON.parse(response.body)
|
99
131
|
end
|
100
132
|
|
101
|
-
def
|
133
|
+
def langdetection(text)
|
102
134
|
payload = {
|
103
135
|
'text' => text
|
104
136
|
}
|
105
|
-
response = RestClient.post("#{@root_url}/
|
137
|
+
response = RestClient.post("#{@root_url}/langdetection", payload.to_json, @headers)
|
106
138
|
JSON.parse(response.body)
|
107
139
|
end
|
108
140
|
|
109
|
-
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)
|
110
147
|
payload = {
|
111
148
|
'text' => text
|
112
149
|
}
|
113
|
-
response = RestClient.post("#{@root_url}/
|
150
|
+
response = RestClient.post("#{@root_url}/paraphrasing", payload.to_json, @headers)
|
151
|
+
JSON.parse(response.body)
|
152
|
+
end
|
153
|
+
|
154
|
+
def question(question, context: nil)
|
155
|
+
payload = {
|
156
|
+
'question' => question,
|
157
|
+
'context' => context
|
158
|
+
}
|
159
|
+
response = RestClient.post("#{@root_url}/question", payload.to_json, @headers)
|
114
160
|
JSON.parse(response.body)
|
115
161
|
end
|
116
162
|
|
@@ -122,40 +168,43 @@ module NLPCloud
|
|
122
168
|
JSON.parse(response.body)
|
123
169
|
end
|
124
170
|
|
125
|
-
def
|
171
|
+
def sentence_dependencies(text)
|
126
172
|
payload = {
|
127
173
|
'text' => text
|
128
174
|
}
|
129
|
-
response = RestClient.post("#{@root_url}/
|
175
|
+
response = RestClient.post("#{@root_url}/sentence-dependencies", payload.to_json, @headers)
|
130
176
|
JSON.parse(response.body)
|
131
177
|
end
|
132
178
|
|
133
|
-
def
|
179
|
+
def sentiment(text)
|
134
180
|
payload = {
|
135
181
|
'text' => text
|
136
182
|
}
|
137
|
-
response = RestClient.post("#{@root_url}/
|
183
|
+
response = RestClient.post("#{@root_url}/sentiment", payload.to_json, @headers)
|
138
184
|
JSON.parse(response.body)
|
139
185
|
end
|
140
186
|
|
141
|
-
def
|
187
|
+
def summarization(text)
|
142
188
|
payload = {
|
143
189
|
'text' => text
|
144
190
|
}
|
145
|
-
response = RestClient.post("#{@root_url}/
|
191
|
+
response = RestClient.post("#{@root_url}/summarization", payload.to_json, @headers)
|
146
192
|
JSON.parse(response.body)
|
147
193
|
end
|
148
194
|
|
149
|
-
def
|
195
|
+
def tokens(text)
|
150
196
|
payload = {
|
151
|
-
'
|
197
|
+
'text' => text
|
152
198
|
}
|
153
|
-
response = RestClient.post("#{@root_url}/
|
199
|
+
response = RestClient.post("#{@root_url}/tokens", payload.to_json, @headers)
|
154
200
|
JSON.parse(response.body)
|
155
201
|
end
|
156
202
|
|
157
|
-
def
|
158
|
-
|
203
|
+
def translation(text)
|
204
|
+
payload = {
|
205
|
+
'text' => text
|
206
|
+
}
|
207
|
+
response = RestClient.post("#{@root_url}/translation", payload.to_json, @headers)
|
159
208
|
JSON.parse(response.body)
|
160
209
|
end
|
161
210
|
end
|
metadata
CHANGED
@@ -1,20 +1,22 @@
|
|
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,
|
15
|
-
|
16
|
-
|
17
|
-
|
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.
|
18
20
|
Documentation: https://docs.nlpcloud.io.'
|
19
21
|
email: all@juliensalinas.com
|
20
22
|
executables: []
|