nlpcloud 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nlpcloud.rb +21 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33a4b97770d4b1a6f6daf5c3365f5dbe266e82113ab54b4219cf414458aa7907
4
- data.tar.gz: ec629fbc99105b49cb4f90b90b42b2ad812d509c808d28b77859b61dc7c2b4e1
3
+ metadata.gz: a39b2bf884144622e741cf6de5e6ec38a9d19ef1379dcc54d1c6d5b8a4f4aeeb
4
+ data.tar.gz: 0b15ca98c9731449ee6ecab93d298eeb0e673ecac512643c359e282ea2958649
5
5
  SHA512:
6
- metadata.gz: a618257dc0d197126b16698d51957209989b533bbcaf731c6ac4a7987c25ad83b712688d14ea5b3bccdf61c5c8a7675bd0786f30ca5ddb8dca6a6a69f1307f7c
7
- data.tar.gz: db964aa4c66127a60c64e19b21c8377969f83eec024b1dab3dd3d85ed47d31ece8458ee7cebca7c664b3bb993eae69d028bdfe04c3f5fa2afc965f92c827e49a
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.10
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-07-25 00:00:00.000000000 Z
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,