paralleldots 3.2.8 → 3.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -0
- data/lib/paralleldots.rb +58 -30
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7cab7083cd1b4160682b5587481f72f5cc07f3b2f3f74bbff9c08ce33b03e119
|
4
|
+
data.tar.gz: 8e392d0e2dbd12909dbad5d5291b56fbb7a0467f30247a0c15db4d8faaeadedc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fafe1ec02d8657a92d64199a4504ed8ea1232744c55dd296278a4ce718388ffd29d9cb04f7292caca26220cbc36d941c7e12b68d8744537ed852b280d272f03
|
7
|
+
data.tar.gz: f39135c5506cfcc103cfb61a18c9ea97488498de6d0eac1e6470db3e10b1c582fe8070d8d93254de8bd6b97536def1bd9c30b81d7a720609f823a566213543bf
|
data/README.md
CHANGED
data/lib/paralleldots.rb
CHANGED
@@ -5,56 +5,70 @@ require 'json'
|
|
5
5
|
|
6
6
|
def sentiment( text, lang_code= "en" )
|
7
7
|
api_key = get_api_key
|
8
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
8
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/sentiment", { api_key: api_key, text: text, lang_code: lang_code }
|
9
9
|
response = JSON.parse( response )
|
10
10
|
return response
|
11
11
|
end
|
12
12
|
|
13
13
|
def ner( text )
|
14
14
|
api_key = get_api_key
|
15
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
15
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/ner", { api_key: api_key, text: text }
|
16
16
|
response = JSON.parse( response )
|
17
17
|
return response
|
18
18
|
end
|
19
19
|
|
20
20
|
def keywords( text )
|
21
21
|
api_key = get_api_key
|
22
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
22
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/keywords", { api_key: api_key, text: text }
|
23
23
|
response = JSON.parse( response )
|
24
24
|
return response
|
25
25
|
end
|
26
26
|
|
27
27
|
def intent( text )
|
28
28
|
api_key = get_api_key
|
29
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
29
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/intent", { api_key: api_key, text: text }
|
30
30
|
response = JSON.parse( response )
|
31
31
|
return response
|
32
32
|
end
|
33
33
|
|
34
34
|
def emotion( text, lang_code= "en" )
|
35
35
|
api_key = get_api_key
|
36
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
36
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/emotion", { api_key: api_key, text: text, lang_code: lang_code }
|
37
|
+
response = JSON.parse( response )
|
38
|
+
return response
|
39
|
+
end
|
40
|
+
|
41
|
+
def sarcasm( text, lang_code= "en" )
|
42
|
+
api_key = get_api_key
|
43
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/sarcasm", { api_key: api_key, text: text, lang_code: lang_code }
|
44
|
+
response = JSON.parse( response )
|
45
|
+
return response
|
46
|
+
end
|
47
|
+
|
48
|
+
def target_sentiment( text, entity )
|
49
|
+
api_key = get_api_key
|
50
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/target/sentiment", { api_key: api_key, text: text, entity: entity }
|
37
51
|
response = JSON.parse( response )
|
38
52
|
return response
|
39
53
|
end
|
40
54
|
|
41
55
|
def abuse( text )
|
42
56
|
api_key = get_api_key
|
43
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
57
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/abuse", { api_key: api_key, text: text }
|
44
58
|
response = JSON.parse( response )
|
45
59
|
return response
|
46
60
|
end
|
47
61
|
|
48
62
|
def taxonomy( text )
|
49
63
|
api_key = get_api_key
|
50
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
64
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/taxonomy", { api_key: api_key, text: text }
|
51
65
|
response = JSON.parse( response )
|
52
66
|
return response
|
53
67
|
end
|
54
68
|
|
55
69
|
def similarity( text_1, text_2 )
|
56
70
|
api_key = get_api_key
|
57
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
71
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/similarity", { api_key: api_key, text_1: text_1, text_2: text_2 }
|
58
72
|
response = JSON.parse( response )
|
59
73
|
return response
|
60
74
|
end
|
@@ -62,91 +76,91 @@ end
|
|
62
76
|
def custom_classifier( text, category )
|
63
77
|
api_key = get_api_key
|
64
78
|
category = category.to_json
|
65
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
79
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/custom_classifier", { api_key: api_key, text: text, category: category }
|
66
80
|
response = JSON.parse( response )
|
67
81
|
return response
|
68
82
|
end
|
69
83
|
|
70
84
|
def phrase_extractor( text )
|
71
85
|
api_key = get_api_key
|
72
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
86
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/phrase_extractor", { api_key: api_key, text: text }
|
73
87
|
response = JSON.parse( response )
|
74
88
|
return response
|
75
89
|
end
|
76
90
|
|
77
91
|
def language_detection( text )
|
78
92
|
api_key = get_api_key
|
79
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
93
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/language_detection", { api_key: api_key, text: text }
|
80
94
|
response = JSON.parse( response )
|
81
95
|
return response
|
82
96
|
end
|
83
97
|
|
84
98
|
def text_parser( text )
|
85
99
|
api_key = get_api_key
|
86
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
100
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/text_parser", { api_key: api_key, text: text }
|
87
101
|
response = JSON.parse( response )
|
88
102
|
return response
|
89
103
|
end
|
90
104
|
|
91
105
|
def multilang_keywords( text, lang_code= "en" )
|
92
106
|
api_key = get_api_key
|
93
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
107
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/multilang_keywords", { api_key: api_key, text: text, lang_code: lang_code }
|
94
108
|
response = JSON.parse( response )
|
95
109
|
return response
|
96
110
|
end
|
97
111
|
|
98
112
|
def popularity( path )
|
99
113
|
api_key = get_api_key
|
100
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
114
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/popularity", { api_key: api_key, file: File.new( path ) }
|
101
115
|
response = JSON.parse( response )
|
102
116
|
return response
|
103
117
|
end
|
104
118
|
|
105
119
|
def nsfw( path )
|
106
120
|
api_key = get_api_key
|
107
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
121
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/nsfw", { api_key: api_key, file: File.new( path ) }
|
108
122
|
response = JSON.parse( response )
|
109
123
|
return response
|
110
124
|
end
|
111
125
|
|
112
126
|
def facial_emotion( path )
|
113
127
|
api_key = get_api_key
|
114
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
128
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/facial_emotion", { api_key: api_key, file: File.new( path ) }
|
115
129
|
response = JSON.parse( response )
|
116
130
|
return response
|
117
131
|
end
|
118
132
|
|
119
133
|
def object_recognizer( path )
|
120
134
|
api_key = get_api_key
|
121
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
135
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/object_recognizer", { api_key: api_key, file: File.new( path ) }
|
122
136
|
response = JSON.parse( response )
|
123
137
|
return response
|
124
138
|
end
|
125
139
|
|
126
140
|
def popularity_url( url )
|
127
141
|
api_key = get_api_key
|
128
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
142
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/popularity", { api_key: api_key, url: url }
|
129
143
|
response = JSON.parse( response )
|
130
144
|
return response
|
131
145
|
end
|
132
146
|
|
133
147
|
def nsfw_url( url )
|
134
148
|
api_key = get_api_key
|
135
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
149
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/nsfw", { api_key: api_key, url: url }
|
136
150
|
response = JSON.parse( response )
|
137
151
|
return response
|
138
152
|
end
|
139
153
|
|
140
154
|
def facial_emotion_url( url )
|
141
155
|
api_key = get_api_key
|
142
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
156
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/facial_emotion", { api_key: api_key, url: url }
|
143
157
|
response = JSON.parse( response )
|
144
158
|
return response
|
145
159
|
end
|
146
160
|
|
147
161
|
def object_recognizer_url( url )
|
148
162
|
api_key = get_api_key
|
149
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
163
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/object_recognizer", { api_key: api_key, url: url }
|
150
164
|
response = JSON.parse( response )
|
151
165
|
return response
|
152
166
|
end
|
@@ -164,63 +178,77 @@ end
|
|
164
178
|
|
165
179
|
def batch_intent( data )
|
166
180
|
api_key = get_api_key()
|
167
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
181
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/intent_batch", { "text": data.to_json, "api_key": api_key }
|
168
182
|
response = JSON.parse( response )
|
169
183
|
return response
|
170
184
|
end
|
171
185
|
|
172
186
|
def batch_abuse( data )
|
173
187
|
api_key = get_api_key()
|
174
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
188
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/abuse_batch", { "text": data.to_json, "api_key": api_key }
|
175
189
|
response = JSON.parse( response )
|
176
190
|
return response
|
177
191
|
end
|
178
192
|
|
179
193
|
def batch_ner( data )
|
180
194
|
api_key = get_api_key()
|
181
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
195
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/ner_batch", { "text": data.to_json, "api_key": api_key }
|
182
196
|
response = JSON.parse( response )
|
183
197
|
return response
|
184
198
|
end
|
185
199
|
|
186
200
|
def batch_taxonomy( data )
|
187
201
|
api_key = get_api_key()
|
188
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
202
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/taxonomy_batch", { "text": data.to_json, "api_key": api_key }
|
189
203
|
response = JSON.parse( response )
|
190
204
|
return response
|
191
205
|
end
|
192
206
|
|
193
207
|
def batch_language_detection( data )
|
194
208
|
api_key = get_api_key()
|
195
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
209
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/language_detection_batch", { "text": data.to_json, "api_key": api_key }
|
196
210
|
response = JSON.parse( response )
|
197
211
|
return response
|
198
212
|
end
|
199
213
|
|
200
214
|
def batch_phrase_extractor( data )
|
201
215
|
api_key = get_api_key()
|
202
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
216
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/phrase_extractor_batch", { "text": data.to_json, "api_key": api_key }
|
203
217
|
response = JSON.parse( response )
|
204
218
|
return response
|
205
219
|
end
|
206
220
|
|
207
221
|
def batch_keywords( data )
|
208
222
|
api_key = get_api_key()
|
209
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
223
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/keywords_batch", { "text": data.to_json, "api_key": api_key }
|
210
224
|
response = JSON.parse( response )
|
211
225
|
return response
|
212
226
|
end
|
213
227
|
|
214
228
|
def batch_sentiment( data )
|
215
229
|
api_key = get_api_key()
|
216
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
230
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/sentiment_batch", { "text": data.to_json, "api_key": api_key }
|
217
231
|
response = JSON.parse( response )
|
218
232
|
return response
|
219
233
|
end
|
220
234
|
|
221
235
|
def batch_emotion( data )
|
222
236
|
api_key = get_api_key()
|
223
|
-
response = RestClient.post "https://apis.paralleldots.com/
|
237
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/emotion_batch", { "text": data.to_json, "api_key": api_key }
|
238
|
+
response = JSON.parse( response )
|
239
|
+
return response
|
240
|
+
end
|
241
|
+
|
242
|
+
def batch_sarcasm( data )
|
243
|
+
api_key = get_api_key()
|
244
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/sarcasm_batch", { "text": data.to_json, "api_key": api_key }
|
245
|
+
response = JSON.parse( response )
|
246
|
+
return response
|
247
|
+
end
|
248
|
+
|
249
|
+
def batch_target_sentiment( data, entity )
|
250
|
+
api_key = get_api_key
|
251
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/target/sentiment_batch", { "api_key": api_key, "text": data.to_json, "entity": entity }
|
224
252
|
response = JSON.parse( response )
|
225
253
|
return response
|
226
254
|
end
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paralleldots
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Vipin Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.8'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 1.8.0
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.8'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.8'
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 1.8.0
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.8'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: parseconfig
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 1.0.8
|
53
53
|
description: Ruby Wrapper for ParallelDots APIs
|
54
|
-
email:
|
54
|
+
email: vipin@paralleldots.com
|
55
55
|
executables: []
|
56
56
|
extensions: []
|
57
57
|
extra_rdoc_files:
|
@@ -85,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
|
89
|
-
rubygems_version: 2.5.2.1
|
88
|
+
rubygems_version: 3.0.1
|
90
89
|
signing_key:
|
91
90
|
specification_version: 4
|
92
91
|
summary: Ruby Wrapper for ParallelDots APIs
|