paralleldots 3.1.0 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -3
- data/lib/paralleldots.rb +76 -34
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f527c60fc81b58f3d5206d95692ffc764af8773afacf1aec37f5bb43f64b6b5
|
4
|
+
data.tar.gz: 232eef4ac5e9c7829a8c68e6e2d61c0643a3268668b885133ee34d9ab80da9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 364179cb814d8bd3adb89bc8dd24d1da6f8d0996fc3eed72c39c3eb585a26fac7d45348995324f8835ff6036dbb2477ea3fd0b521ab8b6737aec011d5a79e1c6
|
7
|
+
data.tar.gz: 85e77290fe0af1d60cf469051bfcb93a054a4c7ec1685d7b9aab3f9d5f6312e42667b126ed196dd5009d3d6924107c5516f1edaf547f301cab567a0ae1762064
|
data/README.md
CHANGED
@@ -51,6 +51,7 @@ Supported APIs:
|
|
51
51
|
- Abuse
|
52
52
|
- Custom Classifier
|
53
53
|
- Emotion
|
54
|
+
- Facial Emotion
|
54
55
|
- Intent
|
55
56
|
- Keywords
|
56
57
|
- Multilanguage Keywords ( Supports Multiple Languages )
|
@@ -58,6 +59,7 @@ Supported APIs:
|
|
58
59
|
- Not Safe For Work ( NSFW Image Classifier )
|
59
60
|
- Phrase Extractor
|
60
61
|
- Popularity ( Image Classifier )
|
62
|
+
- Object Recognizer
|
61
63
|
- Sentiment Analysis
|
62
64
|
- Semantic Similarity
|
63
65
|
- Taxonomy
|
@@ -75,6 +77,7 @@ Examples
|
|
75
77
|
> category = { "finance": [ "markets", "economy", "shares" ], "world politics": [ "diplomacy", "UN", "war" ] }
|
76
78
|
> lang_code = "fr"
|
77
79
|
> lang_text = "C'est un environnement très hostile, si vous choisissez de débattre ici, vous serez vicieusement attaqué par l'opposition."
|
80
|
+
> url = "http://i.imgur.com/klb812s.jpg"
|
78
81
|
|
79
82
|
> puts( "\nAbuse" )
|
80
83
|
> puts( abuse( text ) )
|
@@ -92,10 +95,14 @@ Examples
|
|
92
95
|
> puts( emotion( lang_text, lang_code ) )
|
93
96
|
{"emotion"=>{"emotion"=>"Angry", "probabilities"=>{"Sarcasm"=>0.052613839507102966, "Angry"=>0.07304570078849792, "Sad"=>0.051657479256391525, "Fear"=>0.07096020132303238, "Bored"=>0.0, "Excited"=>0.0, "Happy"=>0.0}}, "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"}
|
94
97
|
|
95
|
-
> puts( "\nFacial Emotion"
|
98
|
+
> puts( "\nFacial Emotion" )
|
96
99
|
> puts( facial_emotion( path ) )
|
97
100
|
{"usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "output"=>"No face detected."}
|
98
101
|
|
102
|
+
> puts( "\nFacial Emotion: URL Method" )
|
103
|
+
> puts( facial_emotion_url( url ) )
|
104
|
+
{"facial_emotion"=>[{"score"=>0.439317524433136, "tag"=>"Angry"}, {"score"=>0.18545667827129364, "tag"=>"Surprise"}, {"score"=>0.11217296868562698, "tag"=>"Sad"}, {"score"=>0.08146321028470993, "tag"=>"Neutral"}, {"score"=>0.06052987277507782, "tag"=>"Happy"}, {"score"=>0.06052987277507782, "tag"=>"Fear"}, {"score"=>0.06052987277507782, "tag"=>"Disgust"}], "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions"}
|
105
|
+
|
99
106
|
> puts( "\nIntent" )
|
100
107
|
> puts( intent( text ) )
|
101
108
|
{"probabilities"=>{"marketing"=>0.042, "spam/junk"=>0.003, "news"=>0.927, "feedback/opinion"=>0.024, "query"=>0.004}, "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "intent"=>"news"}
|
@@ -104,6 +111,10 @@ Examples
|
|
104
111
|
> puts( keywords( text ) )
|
105
112
|
{"keywords"=>[{"keyword"=>"Prime Minister Narendra Modi", "confidence_score"=>0.857594}, {"keyword"=>"link", "confidence_score"=>0.913924}, {"keyword"=>"speech Human Resource", "confidence_score"=>0.70655}, {"keyword"=>"Smriti", "confidence_score"=>0.860351}, {"keyword"=>"Lok", "confidence_score"=>0.945534}], "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"}
|
106
113
|
|
114
|
+
> puts( "\nLanguage Detection" )
|
115
|
+
> puts( language_detection( lang_text ) )
|
116
|
+
{"usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "output"=>"French", "code"=>200, "prob"=>0.9999592304229736}
|
117
|
+
|
107
118
|
> puts( "\nMultilang Keywords - Lang: Fr". )
|
108
119
|
> puts( multilang_keywords( lang_text, lang_code ) )
|
109
120
|
{"keywords"=>["cest", "très", "vicieusement", "attaqué", "hostile", "environnement", "débattre", "choisissez", "lopposition", "si"], "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"}
|
@@ -114,11 +125,19 @@ Examples
|
|
114
125
|
|
115
126
|
> puts( "\nNSFW" )
|
116
127
|
> puts( nsfw( path ) )
|
117
|
-
{"
|
128
|
+
{"usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "output"=>"not safe to open at work", "prob"=>0.9995405673980713}
|
129
|
+
|
130
|
+
> puts( "\nNSFW: URL Method" )
|
131
|
+
> puts( nsfw_url( url ) )
|
132
|
+
{"usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions", "output"=>"safe to open at work", "prob"=>0.979527473449707}
|
118
133
|
|
119
134
|
> puts( "\nObject Recognizer" )
|
120
135
|
> puts( object_recognizer( path ) )
|
121
|
-
|
136
|
+
{"usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "output"=>[{"score"=>0.8445611596107483, "tag"=>"Muscle"}, {"score"=>0.6443125605583191, "tag"=>"Limb"}, {"score"=>0.5493743419647217, "tag"=>"Arm"}, {"score"=>0.5155590772628784, "tag"=>"Person"}, {"score"=>0.39905625581741333, "tag"=>"Human body"}, {"score"=>0.39764025807380676, "tag"=>"Leg"}, {"score"=>0.3255367875099182, "tag"=>"Hand"}, {"score"=>0.2798691689968109, "tag"=>"Male person"}, {"score"=>0.25423258543014526, "tag"=>"Adult"}, {"score"=>0.2470093071460724, "tag"=>"Man"}]}
|
137
|
+
|
138
|
+
> puts( "\nObject Recognizer: URL Method" )
|
139
|
+
> puts( object_recognizer_url( url ) )
|
140
|
+
{"usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions", "output"=>[{"score"=>0.8752718567848206, "tag"=>"Dog"}, {"score"=>0.8702095746994019, "tag"=>"Pet"}, {"score"=>0.8646901249885559, "tag"=>"Mammal"}, {"score"=>0.8270695209503174, "tag"=>"Animal"}, {"score"=>0.2900576591491699, "tag"=>"Snow"}, {"score"=>0.22053982317447662, "tag"=>"Winter"}, {"score"=>0.1604217290878296, "tag"=>"Dog breed"}, {"score"=>0.14872552454471588, "tag"=>"Carnivore"}, {"score"=>0.08632490038871765, "tag"=>"Puppy"}, {"score"=>0.07958601415157318, "tag"=>"Wildlife"}]}
|
122
141
|
|
123
142
|
> puts( "\nPhrase Extractor" )
|
124
143
|
> puts( phrase_extractor( text ) )
|
@@ -128,6 +147,10 @@ Examples
|
|
128
147
|
> puts( popularity( path ) )
|
129
148
|
{"Popular"=>"38.1271243095", "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "Not Popular"=>"61.8728756905"}
|
130
149
|
|
150
|
+
> puts( "\nPopularity: URL Method" )
|
151
|
+
> puts( popularity_url( url ) )
|
152
|
+
{"Popular"=>"68.9268052578", "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions", "Not Popular"=>"31.0731947422"}
|
153
|
+
|
131
154
|
> puts( "\nSentiment" )
|
132
155
|
> puts( sentiment( text ) )
|
133
156
|
{"probabilities"=>{"positive"=>0.266, "neutral"=>0.549, "negative"=>0.185}, "usage"=>"By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions", "sentiment"=>"neutral"}
|
data/lib/paralleldots.rb
CHANGED
@@ -22,9 +22,8 @@ def sentiment( text, lang_code= "en" )
|
|
22
22
|
if valid != true then
|
23
23
|
return valid
|
24
24
|
end
|
25
|
-
response = RestClient.post "
|
25
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/sentiment", { api_key: api_key, text: text, lang_code: lang_code }
|
26
26
|
response = JSON.parse( response )
|
27
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
28
27
|
return response
|
29
28
|
end
|
30
29
|
|
@@ -34,9 +33,8 @@ def ner( text )
|
|
34
33
|
if valid != true then
|
35
34
|
return valid
|
36
35
|
end
|
37
|
-
response = RestClient.post "
|
36
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/ner", { api_key: api_key, text: text }
|
38
37
|
response = JSON.parse( response )
|
39
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
40
38
|
return response
|
41
39
|
end
|
42
40
|
|
@@ -46,9 +44,8 @@ def keywords( text )
|
|
46
44
|
if valid != true then
|
47
45
|
return valid
|
48
46
|
end
|
49
|
-
response = RestClient.post "
|
47
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/keywords", { api_key: api_key, text: text }
|
50
48
|
response = JSON.parse( response )
|
51
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
52
49
|
return response
|
53
50
|
end
|
54
51
|
|
@@ -58,9 +55,8 @@ def intent( text )
|
|
58
55
|
if valid != true then
|
59
56
|
return valid
|
60
57
|
end
|
61
|
-
response = RestClient.post "
|
58
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/intent", { api_key: api_key, text: text }
|
62
59
|
response = JSON.parse( response )
|
63
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
64
60
|
return response
|
65
61
|
end
|
66
62
|
|
@@ -70,9 +66,8 @@ def emotion( text, lang_code= "en" )
|
|
70
66
|
if valid != true then
|
71
67
|
return valid
|
72
68
|
end
|
73
|
-
response = RestClient.post "
|
69
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/emotion", { api_key: api_key, text: text, lang_code: lang_code }
|
74
70
|
response = JSON.parse( response )
|
75
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
76
71
|
return response
|
77
72
|
end
|
78
73
|
|
@@ -82,9 +77,8 @@ def abuse( text )
|
|
82
77
|
if valid != true then
|
83
78
|
return valid
|
84
79
|
end
|
85
|
-
response = RestClient.post "
|
80
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/abuse", { api_key: api_key, text: text }
|
86
81
|
response = JSON.parse( response )
|
87
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
88
82
|
return response
|
89
83
|
end
|
90
84
|
|
@@ -94,9 +88,8 @@ def taxonomy( text )
|
|
94
88
|
if valid != true then
|
95
89
|
return valid
|
96
90
|
end
|
97
|
-
response = RestClient.post "
|
91
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/taxonomy", { api_key: api_key, text: text }
|
98
92
|
response = JSON.parse( response )
|
99
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
100
93
|
return response
|
101
94
|
end
|
102
95
|
|
@@ -107,9 +100,8 @@ def similarity( text_1, text_2 )
|
|
107
100
|
if valid_1 != true or valid_2 != true then
|
108
101
|
return { text_1: valid_1, text_2: valid_2 }
|
109
102
|
end
|
110
|
-
response = RestClient.post "
|
103
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/similarity", { api_key: api_key, text_1: text_1, text_2: text_2 }
|
111
104
|
response = JSON.parse( response )
|
112
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
113
105
|
return response
|
114
106
|
end
|
115
107
|
|
@@ -120,9 +112,8 @@ def custom_classifier( text, category )
|
|
120
112
|
return valid
|
121
113
|
end
|
122
114
|
category = category.to_json
|
123
|
-
response = RestClient.post "
|
115
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/custom_classifier", { api_key: api_key, text: text, category: category }
|
124
116
|
response = JSON.parse( response )
|
125
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
126
117
|
return response
|
127
118
|
end
|
128
119
|
|
@@ -132,9 +123,19 @@ def phrase_extractor( text )
|
|
132
123
|
if valid != true then
|
133
124
|
return valid
|
134
125
|
end
|
135
|
-
response = RestClient.post "
|
126
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/phrase_extractor", { api_key: api_key, text: text }
|
127
|
+
response = JSON.parse( response )
|
128
|
+
return response
|
129
|
+
end
|
130
|
+
|
131
|
+
def language_detection( text )
|
132
|
+
api_key = get_api_key
|
133
|
+
valid = check( api_key, text )
|
134
|
+
if valid != true then
|
135
|
+
return valid
|
136
|
+
end
|
137
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/language_detection", { api_key: api_key, text: text }
|
136
138
|
response = JSON.parse( response )
|
137
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
138
139
|
return response
|
139
140
|
end
|
140
141
|
|
@@ -144,9 +145,8 @@ def text_parser( text )
|
|
144
145
|
if valid != true then
|
145
146
|
return valid
|
146
147
|
end
|
147
|
-
response = RestClient.post "
|
148
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/text_parser", { api_key: api_key, text: text }
|
148
149
|
response = JSON.parse( response )
|
149
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
150
150
|
return response
|
151
151
|
end
|
152
152
|
|
@@ -156,9 +156,8 @@ def multilang_keywords( text, lang_code= "en" )
|
|
156
156
|
if valid != true then
|
157
157
|
return valid
|
158
158
|
end
|
159
|
-
response = RestClient.post "
|
159
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/multilang_keywords", { api_key: api_key, text: text, lang_code: lang_code }
|
160
160
|
response = JSON.parse( response )
|
161
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
162
161
|
return response
|
163
162
|
end
|
164
163
|
|
@@ -168,9 +167,8 @@ def popularity( path )
|
|
168
167
|
if valid != true then
|
169
168
|
return valid
|
170
169
|
end
|
171
|
-
response = RestClient.post "
|
170
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/popularity", { api_key: api_key, file: File.new( path ) }
|
172
171
|
response = JSON.parse( response )
|
173
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
174
172
|
return response
|
175
173
|
end
|
176
174
|
|
@@ -180,9 +178,8 @@ def nsfw( path )
|
|
180
178
|
if valid != true then
|
181
179
|
return valid
|
182
180
|
end
|
183
|
-
response = RestClient.post "
|
181
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/nsfw", { api_key: api_key, file: File.new( path ) }
|
184
182
|
response = JSON.parse( response )
|
185
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
186
183
|
return response
|
187
184
|
end
|
188
185
|
|
@@ -192,9 +189,8 @@ def facial_emotion( path )
|
|
192
189
|
if valid != true then
|
193
190
|
return valid
|
194
191
|
end
|
195
|
-
response = RestClient.post "
|
192
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/facial_emotion", { api_key: api_key, file: File.new( path ) }
|
196
193
|
response = JSON.parse( response )
|
197
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
198
194
|
return response
|
199
195
|
end
|
200
196
|
|
@@ -204,9 +200,56 @@ def object_recognizer( path )
|
|
204
200
|
if valid != true then
|
205
201
|
return valid
|
206
202
|
end
|
207
|
-
response = RestClient.post "
|
203
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/object_recognizer", { api_key: api_key, file: File.new( path ) }
|
204
|
+
response = JSON.parse( response )
|
205
|
+
return response
|
206
|
+
end
|
207
|
+
|
208
|
+
def popularity_url( url )
|
209
|
+
api_key = get_api_key
|
210
|
+
valid = check( api_key, url )
|
211
|
+
if valid != true then
|
212
|
+
return valid
|
213
|
+
end
|
214
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/popularity", { api_key: api_key, url: url }
|
215
|
+
response = JSON.parse( response )
|
216
|
+
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions"
|
217
|
+
return response
|
218
|
+
end
|
219
|
+
|
220
|
+
def nsfw_url( url )
|
221
|
+
api_key = get_api_key
|
222
|
+
valid = check( api_key, url )
|
223
|
+
if valid != true then
|
224
|
+
return valid
|
225
|
+
end
|
226
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/nsfw", { api_key: api_key, url: url }
|
227
|
+
response = JSON.parse( response )
|
228
|
+
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions"
|
229
|
+
return response
|
230
|
+
end
|
231
|
+
|
232
|
+
def facial_emotion_url( url )
|
233
|
+
api_key = get_api_key
|
234
|
+
valid = check( api_key, url )
|
235
|
+
if valid != true then
|
236
|
+
return valid
|
237
|
+
end
|
238
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/facial_emotion", { api_key: api_key, url: url }
|
239
|
+
response = JSON.parse( response )
|
240
|
+
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions"
|
241
|
+
return response
|
242
|
+
end
|
243
|
+
|
244
|
+
def object_recognizer_url( url )
|
245
|
+
api_key = get_api_key
|
246
|
+
valid = check( api_key, url )
|
247
|
+
if valid != true then
|
248
|
+
return valid
|
249
|
+
end
|
250
|
+
response = RestClient.post "https://apis.paralleldots.com/v3/object_recognizer", { api_key: api_key, url: url }
|
208
251
|
response = JSON.parse( response )
|
209
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use:
|
252
|
+
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: https://www.paralleldots.com/terms-and-conditions"
|
210
253
|
return response
|
211
254
|
end
|
212
255
|
|
@@ -215,8 +258,7 @@ def usage()
|
|
215
258
|
if api_key == nil or api_key == "" then
|
216
259
|
return { "error": "API Key cannot be nil or an empty String." }
|
217
260
|
end
|
218
|
-
response = RestClient.post "
|
261
|
+
response = RestClient.post "https://apis.paralleldots.com/usage", { api_key: api_key }
|
219
262
|
response = JSON.parse( response )
|
220
|
-
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
221
263
|
return response
|
222
264
|
end
|