nlpcloud 1.0.22 → 1.0.25

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 -2
  3. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1d7b588b8fb73939149515c74c2e5fb52d601071cbb2b2db48c1af6fdd21985
4
- data.tar.gz: b22e7d05f89357357c563e9a9550d9a56f373425f7c69573f07b31b963384f3a
3
+ metadata.gz: c9f78fc814311ca5dbf1de43d42cba079fe11642a0bac4e6ad45438f2bf7c56a
4
+ data.tar.gz: 8fd473b787f85d8e51f0cdf3fd8c1c76e06e40619846aa261613c319e86b9f7d
5
5
  SHA512:
6
- metadata.gz: 9909e0444136ca0b75a7b49319d592698a9886ba86a61c9729821e2bcac565bffad9d816804841f71057e8805f8cb9a93f3e20649744d491a992f29e199440e0
7
- data.tar.gz: 4d0ab4da026e6b515a5660889b871c351e6ef27ee21e3f33af7e08e7670611dca52e5ff0a3e03de294fadfc9e78144ec6a9a56211d58ab85618af39212e10cb4
6
+ metadata.gz: ae66cb895e78e0ad0879b1aa089fd850e701a0e6366c51a084749314d2948ea45ebb192dbc106774d71716a93004c57c275b968e830a3922e99291ce9ab61fa3
7
+ data.tar.gz: 3425a1d03d3028d3d096c1fc3facc088629bdb6119f6afca1db9148b782f7aae5f116ed3fa6ee85de92eb58577f83f613f12b60a23cb0e826b49b3a0a5d28019
data/lib/nlpcloud.rb CHANGED
@@ -18,6 +18,7 @@ module NLPCloud
18
18
 
19
19
  if lang == 'en'
20
20
  lang = ''
21
+ end
21
22
 
22
23
  @root_url = if gpu && (lang != '')
23
24
  "#{BASE_URL}/#{API_VERSION}/gpu/#{lang}/#{model}"
@@ -38,6 +39,14 @@ module NLPCloud
38
39
  JSON.parse(response.body)
39
40
  end
40
41
 
42
+ def article_generation(title)
43
+ payload = {
44
+ 'title' => title
45
+ }
46
+ response = RestClient.post("#{@root_url}/article-generation", payload.to_json, @headers)
47
+ JSON.parse(response.body)
48
+ end
49
+
41
50
  def chatbot(_text, history: nil)
42
51
  payload = {
43
52
  'text' => history
@@ -56,6 +65,14 @@ module NLPCloud
56
65
  JSON.parse(response.body)
57
66
  end
58
67
 
68
+ def code_generation(instruction)
69
+ payload = {
70
+ 'instruction' => instruction
71
+ }
72
+ response = RestClient.post("#{@root_url}/code-generation", payload.to_json, @headers)
73
+ JSON.parse(response.body)
74
+ end
75
+
59
76
  def dependencies(text)
60
77
  payload = {
61
78
  'text' => text
@@ -203,9 +220,11 @@ module NLPCloud
203
220
  JSON.parse(response.body)
204
221
  end
205
222
 
206
- def translation(text)
223
+ def translation(text, source, target)
207
224
  payload = {
208
- 'text' => text
225
+ 'text' => text,
226
+ 'source' => source,
227
+ 'target' => target
209
228
  }
210
229
  response = RestClient.post("#{@root_url}/translation", payload.to_json, @headers)
211
230
  JSON.parse(response.body)
metadata CHANGED
@@ -1,23 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nlpcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.22
4
+ version: 1.0.25
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-05-17 00:00:00.000000000 Z
11
+ date: 2022-07-11 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, paraphrasing, grammar and spelling
15
15
  correction, keywords and keyphrases extraction, chatbot, product description and
16
- ad generation, intent classification, text generation, question answering, machine
17
- translation, language detection, semantic similarity, tokenization, POS tagging,
18
- embeddings, and dependency parsing. It is ready for production, served through a
19
- REST API. This is the Ruby client for the API. More details here: https://nlpcloud.io.
20
- Documentation: https://docs.nlpcloud.io.'
16
+ ad generation, intent classification, text generation, code generation, blog post
17
+ generation, question answering, machine translation, language detection, semantic
18
+ similarity, tokenization, POS tagging, embeddings, and dependency parsing. It is
19
+ ready for production, served through a REST API. This is the Ruby client for the
20
+ API. More details here: https://nlpcloud.io. Documentation: https://docs.nlpcloud.io.'
21
21
  email: all@juliensalinas.com
22
22
  executables: []
23
23
  extensions: []