nlpcloud 1.0.21 → 1.0.24
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 +8 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc0da7199ea326f3bb8806a3aad379a0bb83dfa18009649430520cbd360924a4
|
4
|
+
data.tar.gz: 9a31c0ad59d36dc359dbacf22c2adebf0c1c92e84bd37511e372e6d9a4fa8838
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948776a34d14055118b712ce899a6cff957b8966221e82cdd62ba6cc8fa051c37758fa830b4c3ab0d47d0413fdc8ad4f3b17628633bc456fdc2a69c8208eccbb
|
7
|
+
data.tar.gz: ef59d43f673255e527e1e2cada38070a7a24b9115facf7b7342ce2ef695961e768209d74bb867e9445483983d22dc74960749871493acb596cc87f3f2f6a4ced
|
data/lib/nlpcloud.rb
CHANGED
@@ -16,6 +16,10 @@ module NLPCloud
|
|
16
16
|
'User-Agent' => 'nlpcloud-ruby-client'
|
17
17
|
}
|
18
18
|
|
19
|
+
if lang == 'en'
|
20
|
+
lang = ''
|
21
|
+
end
|
22
|
+
|
19
23
|
@root_url = if gpu && (lang != '')
|
20
24
|
"#{BASE_URL}/#{API_VERSION}/gpu/#{lang}/#{model}"
|
21
25
|
elsif gpu && (lang == '')
|
@@ -200,9 +204,11 @@ module NLPCloud
|
|
200
204
|
JSON.parse(response.body)
|
201
205
|
end
|
202
206
|
|
203
|
-
def translation(text)
|
207
|
+
def translation(text, source, target)
|
204
208
|
payload = {
|
205
|
-
'text' => text
|
209
|
+
'text' => text,
|
210
|
+
'source' => source,
|
211
|
+
'target' => target
|
206
212
|
}
|
207
213
|
response = RestClient.post("#{@root_url}/translation", payload.to_json, @headers)
|
208
214
|
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.
|
4
|
+
version: 1.0.24
|
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-
|
11
|
+
date: 2022-06-13 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
|
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
requirements: []
|
49
|
-
rubygems_version: 3.
|
49
|
+
rubygems_version: 3.3.5
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Ruby client for the NLP Cloud API
|