nlpcloud 1.0.23 → 1.0.26

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: f076500f18c31ff51717007432a3d67c991803991a048af82086f94167442174
4
- data.tar.gz: 3add87cd8b074c486dde61676376243c1bc4e08b8d2eb711ffdc65d292fa1844
3
+ metadata.gz: a760805d316c66fd4e45b7fe061a85b0fea798da1da42261d462578710c3fe1b
4
+ data.tar.gz: 903426e5d75ebcc811369493c9864ae933824476dc60a0573e900e35668800a6
5
5
  SHA512:
6
- metadata.gz: 02e26507bee02346f3ebd871ba2e0daaa3f1862a4a20ee03c97815841b0aa3604ae61ed512ba11adc2cd6f7adc14a0e932553fc8699bcb3ef66811508cf387a6
7
- data.tar.gz: 9482ba800cd69ce7158d32dea7b6ff5689b2e776235d8ec790a329ef9cb1054fba16abbd8b9fe24a3886824d41da32e41af3d04752ea18b093d941bedd00fcd4
6
+ metadata.gz: 250b393eb22965bd7807e8aa4f87d0a9ae8c1ecabd2f1d627d0713824c2ea0eec83445a630b9012d2a41e8fc103ff144b362321be9e3d08d3c6820afdca1bd64
7
+ data.tar.gz: 2d4fead9c8452e021feb97c4fc24f0b664d9113ebdb41191f110b31cffe86fe57eaf51c7de658264d27ba0c229692d5f6b5ea4a6a5f8e4d74314a258d38e6154
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,9 +39,19 @@ module NLPCloud
38
39
  JSON.parse(response.body)
39
40
  end
40
41
 
41
- def chatbot(_text, history: nil)
42
+ def article_generation(title)
42
43
  payload = {
43
- 'text' => history
44
+ 'title' => title
45
+ }
46
+ response = RestClient.post("#{@root_url}/article-generation", payload.to_json, @headers)
47
+ JSON.parse(response.body)
48
+ end
49
+
50
+ def chatbot(text, context: nil, history: nil)
51
+ payload = {
52
+ 'text' => text,
53
+ 'context' => context,
54
+ 'history' => history
44
55
  }
45
56
  response = RestClient.post("#{@root_url}/chatbot", payload.to_json, @headers)
46
57
  JSON.parse(response.body)
@@ -56,6 +67,14 @@ module NLPCloud
56
67
  JSON.parse(response.body)
57
68
  end
58
69
 
70
+ def code_generation(instruction)
71
+ payload = {
72
+ 'instruction' => instruction
73
+ }
74
+ response = RestClient.post("#{@root_url}/code-generation", payload.to_json, @headers)
75
+ JSON.parse(response.body)
76
+ end
77
+
59
78
  def dependencies(text)
60
79
  payload = {
61
80
  'text' => text
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.23
4
+ version: 1.0.26
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-06-01 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: []