nlpcloud 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nlpcloud.rb +47 -14
- 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: c8a08233de83602a883f76f24b1be58b8d6fa909b9194b3b1deeb2d9018d4987
|
4
|
+
data.tar.gz: 73830d3e197ff7727371d66f24f24b6829322ec04dafae682fcb3a03750716a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffb8e5c89f39e339c1163679b3596b3567018c52e51b626351e186162a13d5bf7ac0258387dba2190d856faa9139788a3871a2fe07efbb76b8ca26d09db2a8af
|
7
|
+
data.tar.gz: 3216fbd124155653a20ea661a8fae938ddd8305b43bd08495b360b91cb57eb1d81a55b6aa774be2e36722f0cd1edbc644bcf6a1abb482eefb352500e1d151bd1
|
data/lib/nlpcloud.rb
CHANGED
@@ -16,34 +16,67 @@ module NLPCloud
|
|
16
16
|
@root_url = "#{BASE_URL}/#{API_VERSION}/#{model}"
|
17
17
|
end
|
18
18
|
|
19
|
-
def entities(
|
20
|
-
|
19
|
+
def entities(text)
|
20
|
+
payload = {
|
21
|
+
'text' => text
|
22
|
+
}
|
23
|
+
response = RestClient.post("#{@root_url}/entities", payload.to_json, @headers)
|
24
|
+
JSON.parse(response.body)
|
21
25
|
end
|
22
26
|
|
23
|
-
def
|
24
|
-
|
27
|
+
def classification(text, labels, multi_class)
|
28
|
+
payload = {
|
29
|
+
'text' => text,
|
30
|
+
'labels' => labels,
|
31
|
+
'multi_class' => multi_class
|
32
|
+
}
|
33
|
+
response = RestClient.post("#{@root_url}/classification", payload.to_json, @headers)
|
34
|
+
JSON.parse(response.body)
|
25
35
|
end
|
26
36
|
|
27
|
-
def
|
28
|
-
|
37
|
+
def sentiment(text)
|
38
|
+
payload = {
|
39
|
+
'text' => text
|
40
|
+
}
|
41
|
+
response = RestClient.post("#{@root_url}/sentiment", payload.to_json, @headers)
|
42
|
+
JSON.parse(response.body)
|
29
43
|
end
|
30
44
|
|
31
|
-
def
|
32
|
-
|
45
|
+
def question(context, question)
|
46
|
+
payload = {
|
47
|
+
'context' => context,
|
48
|
+
'question' => question
|
49
|
+
}
|
50
|
+
response = RestClient.post("#{@root_url}/question", payload.to_json, @headers)
|
51
|
+
JSON.parse(response.body)
|
33
52
|
end
|
34
53
|
|
35
|
-
|
54
|
+
def summarization(text)
|
55
|
+
payload = {
|
56
|
+
'text' => text
|
57
|
+
}
|
58
|
+
response = RestClient.post("#{@root_url}/summarization", payload.to_json, @headers)
|
59
|
+
JSON.parse(response.body)
|
60
|
+
end
|
36
61
|
|
37
|
-
def
|
62
|
+
def dependencies(text)
|
38
63
|
payload = {
|
39
|
-
'text' =>
|
64
|
+
'text' => text
|
40
65
|
}
|
41
|
-
response = RestClient.post("#{@root_url}
|
66
|
+
response = RestClient.post("#{@root_url}/dependencies", payload.to_json, @headers)
|
42
67
|
JSON.parse(response.body)
|
43
68
|
end
|
44
69
|
|
45
|
-
def
|
46
|
-
|
70
|
+
def sentence_dependencies(text)
|
71
|
+
payload = {
|
72
|
+
'text' => text
|
73
|
+
}
|
74
|
+
response = RestClient.post("#{@root_url}/sentence-dependencies", payload.to_json, @headers)
|
75
|
+
JSON.parse(response.body)
|
76
|
+
end
|
77
|
+
|
78
|
+
def lib_versions
|
79
|
+
response = RestClient.get("#{@root_url}/versions", @headers)
|
47
80
|
JSON.parse(response.body)
|
48
81
|
end
|
49
82
|
end
|
metadata
CHANGED
@@ -1,18 +1,19 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Salinas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: 'Ruby client for the NLP Cloud API. NLP Cloud serves
|
14
|
-
models
|
15
|
-
|
13
|
+
description: 'Ruby client for the NLP Cloud API. NLP Cloud serves high performance
|
14
|
+
pre-trained models for NER, sentiment-analysis, classification, summarization, question
|
15
|
+
answering, and POS tagging, ready for production, served through a REST API. More
|
16
|
+
details here: https://nlpcloud.io. Documentation: https://docs.nlpcloud.io.'
|
16
17
|
email: all@juliensalinas.com
|
17
18
|
executables: []
|
18
19
|
extensions: []
|