paralleldots 3.2.9 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +38 -50
- data/lib/paralleldots.rb +10 -10
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: da25c3799e36ca6035f81529514f334b226c5d7b
|
4
|
+
data.tar.gz: e4d9fbc45c67dc3c9e0b7598e27e7ece5687da50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc18dc01445e9eb50de52f4f0babef2b14b39ffa98b7788240af985212130c7a5388c143c36ac8d647cda78a1e6dc25e7eb489182cb555b9fac66c543202fd3
|
7
|
+
data.tar.gz: 8bd2283778da2248d35301d3962d7f2beff7423fbc130d4256a1c19dbd7d918afadbb50759970a87236f6dbbfb168dc8ed2dcf7ffa419c6e0ec28e98f8355a0d
|
data/README.md
CHANGED
@@ -83,96 +83,84 @@ Examples
|
|
83
83
|
> url = "http://i.imgur.com/klb812s.jpg"
|
84
84
|
|
85
85
|
> puts( "\nAbuse" )
|
86
|
-
>
|
87
|
-
|
86
|
+
> abuse( text )
|
87
|
+
|
88
88
|
|
89
89
|
> puts( "\nCustom Classifier" )
|
90
|
-
>
|
91
|
-
|
90
|
+
> custom_classifier( text, category )
|
91
|
+
|
92
|
+
> puts( "\nSarcasm" )
|
93
|
+
> sarcasm( text )
|
94
|
+
|
95
|
+
> puts( "\nSarcasm - Lang: Fr". )
|
96
|
+
> sarcasm( lang_text, lang_code )
|
92
97
|
|
93
98
|
> puts( "\nEmotion" )
|
94
|
-
>
|
95
|
-
|
99
|
+
> emotion( text )
|
100
|
+
|
96
101
|
|
97
102
|
> puts( "\nEmotion - Lang: Fr". )
|
98
|
-
>
|
99
|
-
|
103
|
+
> emotion( lang_text, lang_code )
|
104
|
+
|
100
105
|
|
101
106
|
> puts( "\nFacial Emotion" )
|
102
|
-
>
|
103
|
-
{"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."}
|
107
|
+
> facial_emotion( path )
|
104
108
|
|
105
109
|
> puts( "\nFacial Emotion: URL Method" )
|
106
|
-
>
|
107
|
-
{"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"}
|
110
|
+
> facial_emotion_url( url )
|
108
111
|
|
109
112
|
> puts( "\nIntent" )
|
110
|
-
>
|
111
|
-
{"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"}
|
113
|
+
> intent( text )
|
112
114
|
|
113
115
|
> puts( "\nKeywords" )
|
114
|
-
>
|
115
|
-
{"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"}
|
116
|
+
> keywords( text )
|
116
117
|
|
117
118
|
> puts( "\nLanguage Detection" )
|
118
|
-
>
|
119
|
-
|
119
|
+
> language_detection( lang_text )
|
120
|
+
|
120
121
|
|
121
122
|
> puts( "\nMultilang Keywords - Lang: Fr". )
|
122
|
-
>
|
123
|
-
{"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"}
|
123
|
+
> multilang_keywords( lang_text, lang_code )
|
124
124
|
|
125
125
|
> puts( "\nNER" )
|
126
|
-
>
|
127
|
-
|
126
|
+
> ner( text)
|
127
|
+
|
128
|
+
> puts( "\nMultilang NER" )
|
129
|
+
> ner( text,"en")
|
128
130
|
|
129
131
|
> puts( "\nNSFW" )
|
130
|
-
>
|
131
|
-
{"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}
|
132
|
+
> nsfw( path )
|
132
133
|
|
133
134
|
> puts( "\nNSFW: URL Method" )
|
134
|
-
>
|
135
|
-
|
135
|
+
> nsfw_url( url )
|
136
|
+
|
136
137
|
|
137
138
|
> puts( "\nObject Recognizer" )
|
138
|
-
>
|
139
|
-
{"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"}]}
|
139
|
+
> object_recognizer( path )
|
140
140
|
|
141
141
|
> puts( "\nObject Recognizer: URL Method" )
|
142
|
-
>
|
143
|
-
{"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"}]}
|
142
|
+
> object_recognizer_url( url )
|
144
143
|
|
145
144
|
> puts( "\nPhrase Extractor" )
|
146
|
-
>
|
147
|
-
{"keywords"=>[{"relevance_score"=>3, "keyword"=>"Hyderabad Central University"}, {"relevance_score"=>2, "keyword"=>"Rohith Vemula"}, {"relevance_score"=>2, "keyword"=>"JNU row"}, {"relevance_score"=>6, "keyword"=>"Human Resource Development Minister Smriti Irani"}, {"relevance_score"=>2, "keyword"=>"Lok Sabha"}, {"relevance_score"=>4, "keyword"=>"Prime Minister Narendra Modi"}, {"relevance_score"=>2, "keyword"=>"Dalit scholar"}], "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"}
|
145
|
+
> phrase_extractor( text )
|
148
146
|
|
149
147
|
> puts( "\nPopularity" )
|
150
|
-
>
|
151
|
-
{"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"}
|
148
|
+
> popularity( path )
|
152
149
|
|
153
150
|
> puts( "\nPopularity: URL Method" )
|
154
|
-
>
|
155
|
-
{"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"}
|
151
|
+
> popularity_url( url )
|
156
152
|
|
157
153
|
> puts( "\nSentiment" )
|
158
|
-
>
|
159
|
-
{"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"}
|
154
|
+
> sentiment( text )
|
160
155
|
|
161
156
|
> puts( "\nSentiment - Lang: Fr". )
|
162
|
-
>
|
163
|
-
{"probabilities"=>{"positive"=>0.02, "neutral"=>0.291, "negative"=>0.689}, "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"=>"negative"}
|
157
|
+
> sentiment( lang_text, lang_code )
|
164
158
|
|
165
159
|
> puts( "\nSimilarity" )
|
166
|
-
>
|
167
|
-
{"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", "actual_score"=>0.848528, "normalized_score"=>4.936506}
|
160
|
+
> similarity( "I love fish and ice cream!", "fish and ice cream are the best!" )
|
168
161
|
|
169
162
|
> puts( "\nTaxonomy" )
|
170
|
-
>
|
171
|
-
{"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", "taxonomy"=>[{"tag"=>"News and Politics/Law", "confidence_score"=>0.845402}, {"tag"=>"Hobbies & Interests/Workshops and Classes", "confidence_score"=>0.878964}, {"tag"=>"Business and Finance/Industries", "confidence_score"=>0.7353}]}
|
163
|
+
> taxonomy( text )
|
172
164
|
|
173
|
-
|
174
|
-
>
|
175
|
-
{"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"=>[{"text"=>"Prime", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Minister", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Narendra", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Modi", "Dependency"=>"nominal subject", "Tags"=>"noun"}, {"text"=>"tweeted", "Dependency"=>"root", "Tags"=>"verb"}, {"text"=>"a", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"link", "Dependency"=>"direct object", "Tags"=>"noun"}, {"text"=>"to", "Dependency"=>"prepositional modifier", "Tags"=>"preposition or conjunction"}, {"text"=>"the", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"speech", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Human", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Resource", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Development", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Minister", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Smriti", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Irani", "Dependency"=>"object of a preposition", "Tags"=>"noun"}, {"text"=>"in", "Dependency"=>"prepositional modifier", "Tags"=>"preposition or conjunction"}, {"text"=>"the", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"Lok", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Sabha", "Dependency"=>"object of a preposition", "Tags"=>"noun"}, {"text"=>"during", "Dependency"=>"prepositional modifier", "Tags"=>"preposition or conjunction"}, {"text"=>"the", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"debate", "Dependency"=>"object of a preposition", "Tags"=>"noun"}, {"text"=>"on", "Dependency"=>"prepositional modifier", "Tags"=>"preposition or conjunction"}, {"text"=>"the", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"ongoing", "Dependency"=>"adjectival modifier", "Tags"=>"adjective"}, {"text"=>"JNU", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"row", "Dependency"=>"object of a preposition", "Tags"=>"noun"}, {"text"=>"and", "Dependency"=>"coordinating conjunction", "Tags"=>"conjuction"}, {"text"=>"the", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"suicide", "Dependency"=>"conjunct", "Tags"=>"noun"}, {"text"=>"of", "Dependency"=>"prepositional modifier", "Tags"=>"preposition or conjunction"}, {"text"=>"Dalit", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"scholar", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Rohith", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Vemula", "Dependency"=>"object of a preposition", "Tags"=>"noun"}, {"text"=>"at", "Dependency"=>"prepositional modifier", "Tags"=>"preposition or conjunction"}, {"text"=>"the", "Dependency"=>"determiner", "Tags"=>"determiner"}, {"text"=>"Hyderabad", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"Central", "Dependency"=>"compound", "Tags"=>"noun"}, {"text"=>"University", "Dependency"=>"object of a preposition", "Tags"=>"noun"}]}
|
176
|
-
|
177
|
-
> usage()
|
178
|
-
{ "paying": False, "visual_monthly_quota": 100, "visual_daily_quota": 1000, "monthly_quota": 10000, "daily_quota": 1000, "excel_monthly_quota": 1000, "excel_daily_quota": 100 }
|
165
|
+
|
166
|
+
> usage()
|
data/lib/paralleldots.rb
CHANGED
@@ -10,9 +10,9 @@ def sentiment( text, lang_code= "en" )
|
|
10
10
|
return response
|
11
11
|
end
|
12
12
|
|
13
|
-
def ner( text )
|
13
|
+
def ner( text,lang_code = "en" )
|
14
14
|
api_key = get_api_key
|
15
|
-
response = RestClient.post "https://apis.paralleldots.com/v4/ner", { api_key: api_key, text: text }
|
15
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/ner", { api_key: api_key, text: text, lang_code: lang_code }
|
16
16
|
response = JSON.parse( response )
|
17
17
|
return response
|
18
18
|
end
|
@@ -190,9 +190,9 @@ def batch_abuse( data )
|
|
190
190
|
return response
|
191
191
|
end
|
192
192
|
|
193
|
-
def batch_ner( data )
|
193
|
+
def batch_ner( data, lang_code="en")
|
194
194
|
api_key = get_api_key()
|
195
|
-
response = RestClient.post "https://apis.paralleldots.com/v4/ner_batch", { "text": data.to_json, "api_key": api_key }
|
195
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/ner_batch", { "text": data.to_json, "api_key": api_key, "lang_code":lang_code}
|
196
196
|
response = JSON.parse( response )
|
197
197
|
return response
|
198
198
|
end
|
@@ -225,23 +225,23 @@ def batch_keywords( data )
|
|
225
225
|
return response
|
226
226
|
end
|
227
227
|
|
228
|
-
def batch_sentiment( data )
|
228
|
+
def batch_sentiment( data, lang_code="en")
|
229
229
|
api_key = get_api_key()
|
230
|
-
response = RestClient.post "https://apis.paralleldots.com/v4/sentiment_batch", { "text": data.to_json, "api_key": api_key }
|
230
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/sentiment_batch", { "text": data.to_json, "api_key": api_key, "lang_code":lang_code}
|
231
231
|
response = JSON.parse( response )
|
232
232
|
return response
|
233
233
|
end
|
234
234
|
|
235
|
-
def batch_emotion( data )
|
235
|
+
def batch_emotion( data, lang_code="en")
|
236
236
|
api_key = get_api_key()
|
237
|
-
response = RestClient.post "https://apis.paralleldots.com/v4/emotion_batch", { "text": data.to_json, "api_key": api_key }
|
237
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/emotion_batch", { "text": data.to_json, "api_key": api_key, "lang_code":lang_code}
|
238
238
|
response = JSON.parse( response )
|
239
239
|
return response
|
240
240
|
end
|
241
241
|
|
242
|
-
def batch_sarcasm( data )
|
242
|
+
def batch_sarcasm( data, lang_code="en")
|
243
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 }
|
244
|
+
response = RestClient.post "https://apis.paralleldots.com/v4/sarcasm_batch", { "text": data.to_json, "api_key": api_key, "lang_code":lang_code}
|
245
245
|
response = JSON.parse( response )
|
246
246
|
return response
|
247
247
|
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.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vipin Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-25 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.0
|
20
17
|
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: '1.8'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.8.0
|
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.0
|
30
27
|
- - "~>"
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: '1.8'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.8.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: parseconfig
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,7 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
|
88
|
+
rubyforge_project:
|
89
|
+
rubygems_version: 2.5.2.1
|
89
90
|
signing_key:
|
90
91
|
specification_version: 4
|
91
92
|
summary: Ruby Wrapper for ParallelDots APIs
|