nlpcloud 1.0.16 → 1.0.19
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 +23 -6
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80404a1148f86e8a328ec28580186d619a963ffe569ea03fc82c3d45fb330783
|
|
4
|
+
data.tar.gz: bc04ed304e7c7d12dae401a5d0a7f28e2af8c4abd1fb733b51e2334a6a07aac9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 783b517b09f33721cfaad7cb7fa368b79249a7298ad2bf6338b3e6460c4bf089230b7d7fd95ceba1f05d1a54c5e701f8e4893c0930cbcd121f595f0f9be45608
|
|
7
|
+
data.tar.gz: 064b44c006a680d81c777c3dd057757d56da7f6a2d709bddbf893f3430819ff3d1a10b21520c62c2fa759295636e96dee05dd1b4823cc0780a6ff57d237d39bd
|
data/lib/nlpcloud.rb
CHANGED
|
@@ -27,15 +27,16 @@ module NLPCloud
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
def entities(text)
|
|
30
|
+
def entities(text, searched_entity: nil)
|
|
31
31
|
payload = {
|
|
32
|
-
'text' => text
|
|
32
|
+
'text' => text,
|
|
33
|
+
'searched_entity' => searched_entity
|
|
33
34
|
}
|
|
34
35
|
response = RestClient.post("#{@root_url}/entities", payload.to_json, @headers)
|
|
35
36
|
JSON.parse(response.body)
|
|
36
37
|
end
|
|
37
38
|
|
|
38
|
-
def classification(text, labels, multi_class: nil)
|
|
39
|
+
def classification(text, labels: nil, multi_class: nil)
|
|
39
40
|
payload = {
|
|
40
41
|
'text' => text,
|
|
41
42
|
'labels' => labels,
|
|
@@ -81,10 +82,10 @@ module NLPCloud
|
|
|
81
82
|
JSON.parse(response.body)
|
|
82
83
|
end
|
|
83
84
|
|
|
84
|
-
def question(
|
|
85
|
+
def question(question, context: nil)
|
|
85
86
|
payload = {
|
|
86
|
-
'
|
|
87
|
-
'
|
|
87
|
+
'question' => question,
|
|
88
|
+
'context' => context
|
|
88
89
|
}
|
|
89
90
|
response = RestClient.post("#{@root_url}/question", payload.to_json, @headers)
|
|
90
91
|
JSON.parse(response.body)
|
|
@@ -114,6 +115,14 @@ module NLPCloud
|
|
|
114
115
|
JSON.parse(response.body)
|
|
115
116
|
end
|
|
116
117
|
|
|
118
|
+
def semantic_similarity(sentences)
|
|
119
|
+
payload = {
|
|
120
|
+
'sentences' => sentences
|
|
121
|
+
}
|
|
122
|
+
response = RestClient.post("#{@root_url}/semantic_similarity", payload.to_json, @headers)
|
|
123
|
+
JSON.parse(response.body)
|
|
124
|
+
end
|
|
125
|
+
|
|
117
126
|
def tokens(text)
|
|
118
127
|
payload = {
|
|
119
128
|
'text' => text
|
|
@@ -138,6 +147,14 @@ module NLPCloud
|
|
|
138
147
|
JSON.parse(response.body)
|
|
139
148
|
end
|
|
140
149
|
|
|
150
|
+
def embeddings(sentences)
|
|
151
|
+
payload = {
|
|
152
|
+
'sentences' => sentences
|
|
153
|
+
}
|
|
154
|
+
response = RestClient.post("#{@root_url}/embeddings", payload.to_json, @headers)
|
|
155
|
+
JSON.parse(response.body)
|
|
156
|
+
end
|
|
157
|
+
|
|
141
158
|
def lib_versions
|
|
142
159
|
response = RestClient.get("#{@root_url}/versions", @headers)
|
|
143
160
|
JSON.parse(response.body)
|
metadata
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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.19
|
|
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-
|
|
11
|
+
date: 2022-03-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'NLP Cloud serves high performance pre-trained or custom models for NER,
|
|
14
14
|
sentiment-analysis, classification, summarization, text generation, question answering,
|
|
15
|
-
machine translation, language detection, tokenization, POS
|
|
16
|
-
parsing. It is ready for production, served
|
|
17
|
-
client for the API. More details here: https://nlpcloud.io.
|
|
15
|
+
machine translation, language detection, semantic similarity, tokenization, POS
|
|
16
|
+
tagging, embeddings, and dependency parsing. It is ready for production, served
|
|
17
|
+
through a REST API. This is the Ruby client for the API. More details here: https://nlpcloud.io.
|
|
18
|
+
Documentation: https://docs.nlpcloud.io.'
|
|
18
19
|
email: all@juliensalinas.com
|
|
19
20
|
executables: []
|
|
20
21
|
extensions: []
|