Text classification

FREE
By hani.amr
Updated 4 months ago
Data
5.7/10
Popularity Score
12226ms
Latency
88%
Success Rate

Text classification API Documentation

Classify text (English & Arabic) into 1 of 16 categories using a trained machine learning model: Arts and design, books, business, charity, fashion, food & drinks, health, holidays & dates, sentiment, music, politics, religion, science, sports, technology and tv & movies.

View API Details
POSTClassifyText
POSTClassifyText

Accepts an array of strings for classification, see the example payload

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
StringsJSON_STRING
REQUIREDList of strings representing the text to be classified. The model is trained on English and Arabic strings only so far.
Optional Parameters
thresholdNUMBER
OPTIONALCutoff threshold for the classifier's prediction (i.e. if prediction < threshold, then it is classified as Other)
Code Snippet
unirest.post("https://textclassification.p.rapidapi.com/?threshold=0.5")
.header("X-RapidAPI-Host", "textclassification.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send(["retweeted microsoft ireland (@microsoftirl):\\n\\nwe're recruiting for over 160 exciting job opportunities. @microsoftjobs #jobsintech see: https://t.co/zh58zxnh66 https://t.co/zcz5ul9xe9","rt @vancitybuzz: rt @opushotel: you can win a $10,000 dream trip from @travlandleisure - rt and vote for opus hotel vancouver & montreal ...","#tb to the stunning view from the park near our sweet home in london, miss those days so much","sitting is killing you! #getup #rise #awareness #fitness #infographic http://t.co/mimsvmomms","crowdsourcing for the missing malaysian flight 370. see if you can help tag objects in the map to help solve this mystery.","بعد قليل على ام بي سي مصر مع الاستاذ شريف عامر","the world has lost a lot more than an actor today .. rip mr. williams .. thank you for comedy .. http://t.co/u41xmnxkhh","how loyal are man utd fans http://t.co/uw3chh3x","#allah my life is in peace since i knew the way to you :)","اللهم ارحم كل من توفي في العبًّاره \\\"السلام ٩٨\\\" و احتسبهم عندك من الشهداء ، و انتقم من كل من تسبب و تستر علي هذا الحادث.","rt @dubaimusicweek: come on @30secondstomars fans... #rt this post if ur in the crowd to win 4 vip tickets right now! #dmw2015 #dulive http…","rt art to think about http://t.co/ous3pxpe via @9gag","fast easy chicken breasts recipe with tomatoes & olives -&gt; http://t.co/s9b36kuk #recipe #recipes #cooking http://t.co/boxndf30","مقال جميل من اليوم السابع. https://t.co/hlayrfdgyc","anyone knows a good book for machine learning?","rt @slashdot: intel develops linux 'software gpu' that's ~29-51x faster https://t.co/e2xu192xuu","rt القصر العينى الفرنساوى بيستقبل ائ حالات الانفجار فى العين ببلاش و فى أساتذة كتير شغلين دلوقتى من فضلوكوا أنشروا ده علشان ...","More than 9/10 refugee & migrant children arriving in Europe in 2016 through Italy are unaccompanied","thanks everybody for ur kind wishes :)"])
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://textclassification.p.rapidapi.com/
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://textclassification.p.rapidapi.com/?threshold=0.5")
.header("X-RapidAPI-Host", "textclassification.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send(["retweeted microsoft ireland (@microsoftirl):\\n\\nwe're recruiting for over 160 exciting job opportunities. @microsoftjobs #jobsintech see: https://t.co/zh58zxnh66 https://t.co/zcz5ul9xe9","rt @vancitybuzz: rt @opushotel: you can win a $10,000 dream trip from @travlandleisure - rt and vote for opus hotel vancouver & montreal ...","#tb to the stunning view from the park near our sweet home in london, miss those days so much","sitting is killing you! #getup #rise #awareness #fitness #infographic http://t.co/mimsvmomms","crowdsourcing for the missing malaysian flight 370. see if you can help tag objects in the map to help solve this mystery.","بعد قليل على ام بي سي مصر مع الاستاذ شريف عامر","the world has lost a lot more than an actor today .. rip mr. williams .. thank you for comedy .. http://t.co/u41xmnxkhh","how loyal are man utd fans http://t.co/uw3chh3x","#allah my life is in peace since i knew the way to you :)","اللهم ارحم كل من توفي في العبًّاره \\\"السلام ٩٨\\\" و احتسبهم عندك من الشهداء ، و انتقم من كل من تسبب و تستر علي هذا الحادث.","rt @dubaimusicweek: come on @30secondstomars fans... #rt this post if ur in the crowd to win 4 vip tickets right now! #dmw2015 #dulive http…","rt art to think about http://t.co/ous3pxpe via @9gag","fast easy chicken breasts recipe with tomatoes & olives -&gt; http://t.co/s9b36kuk #recipe #recipes #cooking http://t.co/boxndf30","مقال جميل من اليوم السابع. https://t.co/hlayrfdgyc","anyone knows a good book for machine learning?","rt @slashdot: intel develops linux 'software gpu' that's ~29-51x faster https://t.co/e2xu192xuu","rt القصر العينى الفرنساوى بيستقبل ائ حالات الانفجار فى العين ببلاش و فى أساتذة كتير شغلين دلوقتى من فضلوكوا أنشروا ده علشان ...","More than 9/10 refugee & migrant children arriving in Europe in 2016 through Italy are unaccompanied","thanks everybody for ur kind wishes :)"])
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication