This is a simple application that enables text classification using IBM Watson's Natural Language Understanding.
Features
- Recieves text from the user through a minimalist interface.
- Provides three possible classifications for the inputted text.
- Provides a confidence value for each of the classifications.
The application builds on top of the Natural Language Understanding API developed by IBM.
All of the backend code is in one file that you can read at: /Python-Flask/microservices/watson/src/server.py
All of the frontend code is in one file that you can read at: /React_Native/App.js
-
Send a POST request payload to Flask backend at
/
-
Request Format:
{ method: "POST", headers: { "Accept": "application/json", "Content-Type": "multipart/form-data" }, body: <payload> }
-
The Payload must contain a key value pair
"text":"Text to be analyzed here"
-
The backend returns the computed result in the form of JSON. Example JSON:
{ " categories ": [ { " label ": "/ technology and computing / software / databases " , " score ": 0.436991 }, { " label ": "/ technology and computing / programming languages / java " , " score ": 0.311278 }, { " label ": "/ health and fitness / disease / headaches and migraines " , " score ": 0.259054 } ], " language ": " en " , " usage ": { " features ": 1 , " text_characters ": 300 , " text_units ": 1 } }
-
Simply download and install the application found at
/React_Native/app-release-Flask.apk
for the Backend with Python Flask or -
Install the application found at
/React_Native/app-release-Express.apk
for the Backend with Python Flask -
Input the text to be classified into the given textbox.
- Tap Analyze to receive your results.
- Go Inside
/React_Native
and rename App-Flask.js as App.js and run
npm install
- For Android in terminal type in
react-native run-android
- For iOS in terminal type in
react-native run-ios
- Go Inside
/React_Native
and rename App-Express.js as App.js and run
npm install
- For Android in terminal type in
react-native run-android
- For iOS in terminal type in
react-native run-ios
- In
/Python-Flask/microservices/watson/src/server.py
replace the username and password with your IBM BlueMix credentials. - Push these changes to your Hasura cluster using Hasura's CLI.
$ git add . $ git commit -m "<Commit Message>" $ git push hasura master
In case of any bugs, issues or feature requests, feel free to raise an issue. We will try to work on it as soon as possible.