nlpcloud 1.0.37 → 1.0.39

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 +7 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a20e24f855ce461f9df9db9a2bb2758429e364a6d70a7cc4f2a0ea91ac7b767d
4
- data.tar.gz: 8d5c8355004fa6e4aea42c7a94f927276a4949f3a3dfc67602460b34d6ad9be4
3
+ metadata.gz: 5c73ed23223ba9a90b9242dd158de916189178ddb118e31e45756064dbaeb31b
4
+ data.tar.gz: a7797cce5d7893270bc604bd2da4ea6f4eada93760d5794e47b690c5beb66e10
5
5
  SHA512:
6
- metadata.gz: cb67e579a3453d0db143e0f124cdf1d260974d207577a2d9f153e0add3779a904fc1cacd07b5a7de087e46e54b938e815667f2369e12838d02ac82a344f5e55f
7
- data.tar.gz: 6832a1f0bc642f310f1317a296a3f9c9976640211b64f7de4e22b149e9eadfd9410bf09c902afbedf8921fc84058f6c5e6663cd55339d2e845cdf93a58768fbf
6
+ metadata.gz: 06dce8cda990d1db8e3a2f0731390ae1a4c86088f9c9e81bb7e277d5519a6aca1b54ac912e63f19f5f5d0d4e17826eeddeaa58cc05f78946e89ae99c8041e162
7
+ data.tar.gz: 91e769169faecf69c722ba2f1f44a76436bff61c5cb05855114f80a30aa848ce5b141d5ca3f020d7cd4619628fdbb3960b4f7acf542b46823fc561ed578f5953
data/lib/nlpcloud.rb CHANGED
@@ -125,7 +125,8 @@ module NLPCloud
125
125
  def generation(text, min_length: nil, max_length: nil, length_no_input: nil,
126
126
  end_sequence: nil, remove_input: nil, do_sample: nil, num_beams: nil, early_stopping: nil,
127
127
  no_repeat_ngram_size: nil, num_return_sequences: nil, top_k: nil, top_p: nil,
128
- temperature: nil, repetition_penalty: nil, length_penalty: nil, bad_words: nil, remove_end_sequence: nil)
128
+ temperature: nil, repetition_penalty: nil, length_penalty: nil, bad_words: nil, remove_end_sequence: nil,
129
+ is_instruct: nil)
129
130
  payload = {
130
131
  'text' => text,
131
132
  'min_length' => min_length,
@@ -144,7 +145,8 @@ module NLPCloud
144
145
  'repetition_penalty' => repetition_penalty,
145
146
  'length_penalty' => length_penalty,
146
147
  'bad_words' => bad_words,
147
- 'remove_end_sequence' => remove_end_sequence
148
+ 'remove_end_sequence' => remove_end_sequence,
149
+ 'is_instruct' => is_instruct
148
150
  }
149
151
  response = RestClient.post("#{@root_url}/generation", payload.to_json, @headers)
150
152
  JSON.parse(response.body)
@@ -212,9 +214,10 @@ module NLPCloud
212
214
  JSON.parse(response.body)
213
215
  end
214
216
 
215
- def semantic_search(sentences)
217
+ def semantic_search(text, num_results: nil)
216
218
  payload = {
217
- 'text' => text
219
+ 'text' => text,
220
+ 'num_results' => num_results
218
221
  }
219
222
  response = RestClient.post("#{@root_url}/semantic_search", payload.to_json, @headers)
220
223
  JSON.parse(response.body)
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.37
4
+ version: 1.0.39
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-12-13 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client