nlpcloud 1.0.10 → 1.0.11
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 +21 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a39b2bf884144622e741cf6de5e6ec38a9d19ef1379dcc54d1c6d5b8a4f4aeeb
|
4
|
+
data.tar.gz: 0b15ca98c9731449ee6ecab93d298eeb0e673ecac512643c359e282ea2958649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 299e5bddc247032e76dd556bad12fa86dc1b88170335061c2d4f7be468e5ccfff317677549066b88266935746fcdec4a4a7e37928df919c329718f56285d0ffc
|
7
|
+
data.tar.gz: fb23ed98fa5e1baa7177f7d66020135ac9252737c9f7f30e7a32da97fa59030a8795297d31a830e4fb674be7eef510e288ffdce6ba242508cb3b14bfd7a68453
|
data/lib/nlpcloud.rb
CHANGED
@@ -30,7 +30,7 @@ module NLPCloud
|
|
30
30
|
JSON.parse(response.body)
|
31
31
|
end
|
32
32
|
|
33
|
-
def classification(text, labels, multi_class)
|
33
|
+
def classification(text, labels, multi_class: nil)
|
34
34
|
payload = {
|
35
35
|
'text' => text,
|
36
36
|
'labels' => labels,
|
@@ -40,6 +40,26 @@ module NLPCloud
|
|
40
40
|
JSON.parse(response.body)
|
41
41
|
end
|
42
42
|
|
43
|
+
def generation(text, min_length: nil, max_length: nil, length_no_input: nil,
|
44
|
+
end_sequence: nil, remove_input: nil, top_k: nil, top_p: nil,
|
45
|
+
temperature: nil, repetition_penalty: nil, length_penalty: nil)
|
46
|
+
payload = {
|
47
|
+
'text' => text,
|
48
|
+
'min_length' => min_length,
|
49
|
+
'max_length' => max_length,
|
50
|
+
'length_no_input' => length_no_input,
|
51
|
+
'end_sequence' => end_sequence,
|
52
|
+
'remove_input' => remove_input,
|
53
|
+
'top_k' => top_k,
|
54
|
+
'top_p' => top_p,
|
55
|
+
'temperature' => temperature,
|
56
|
+
'repetition_penalty' => repetition_penalty,
|
57
|
+
'length_penalty' => length_penalty
|
58
|
+
}
|
59
|
+
response = RestClient.post("#{@root_url}/generation", payload.to_json, @headers)
|
60
|
+
JSON.parse(response.body)
|
61
|
+
end
|
62
|
+
|
43
63
|
def sentiment(text)
|
44
64
|
payload = {
|
45
65
|
'text' => text
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.11
|
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-08-24 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,
|