Natural Language Classifiers apply deep learning to predict predefined classifications for text and return the best matching classifications.
The goal of this project is to easily build and deploy classification models and be a tool for NLP research.
cp .env.example .env
docker-compose up -d --build
docker exec -it capstone_app_1 bash
cd backend
python3 migrate.py db upgrade
Then browse to http://localhost/
-
Flask A Python lightweight WSGI web application framework.
-
SQLAlchemy A Python SQL toolkit and Object Relational Mapper.
-
Flask-CORS A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.
-
Tensorflow An end-to-end open source machine learning platform.
docker exec -it capstone_app_1 bash
cd backend
python3 test.py
- Request Arguments: None
- Returns: An array of objects
{
"results": [
{
"id": 1,
"is_locked": true,
"is_main": null,
"modules": [
{
"id": 1,
"is_locked": true,
"name": "base",
"uuid": "ec9fdf03ea18afe386c71150e532bb4d"
},
...
],
"name": "main"
},
...
],
"total_results": 5
}
- Request Arguments: None
- Returns: An array of objects
{
"results": [
{
"id": 25,
"is_locked": false,
"name": "faq",
"uuid": "c71150e532bb4dec9fdf03ea18afe386"
},
...
],
"success": true,
"total_results": 4
}
- Request Arguments: Agent Id
- Returns: An object with key success: true.
Example Response
{
"success":true
}
- Request Arguments: Agent Id
- Returns: An object with key success: true.
Example Response
{
"success":true
}
- Request Arguments: Module Id
- Returns: An object with key success: true.
{
"success":true
}
- Request Arguments: Intent Id
- Returns: An object with key success: true.
Example Response
{
"success":true
}
- Request Arguments: IntentPattern Id
- Returns: An object with key success: true.
Example Response
{
"success":true
}
- Request Arguments: IntentResponse Id
- Returns: An object with key success: true.
{
"success":true
}
- Request Body: name.
- Returns: An object with keys success and agent.
{
"data":
{
"name": "Agent Name"
}
}
{
"result": {
"id": 42,
"is_locked": false,
"is_main": false,
"modules": [],
"name": "foo"
},
"success": true
}
- Request Body: name, intents.
- Returns: An object with keys success and agent.
{
"data":{
"code": {
"name": "base",
"intents": [
{
"name": "greeting",
"patterns": [
{
"text": "Hi"
},
{
"text": "Hello"
},
...
],
"responses": [
{
"text": "Hello, what can I help with?"
},
...
]
},
...
}
}
}
{
"result": {
"id": 42,
"is_locked": false,
"is_main": false,
"modules": [],
"name": "foo"
},
"success": true
}
- Request Body: module_id.
- Returns: An object with keys success and agent.
{data: {agent_id: 7, module_id: 1}}
{
"result": {
"description": null,
"id": 7,
"is_locked": false,
"is_main": false,
"modules": [
{
"id": 1,
"is_locked": true,
"name": "base",
"uuid": "ec9fdf03ea18afe386c71150e532bb4d"
}
],
"name": "fd"
},
"success": true
}
- Request Body: message.
- Returns: An object with response, confidence and classification name.
{message: "hello"}
{
"result": {
"description": null,
"id": 7,
"is_locked": false,
"is_main": false,
"modules": [
{
"id": 1,
"is_locked": true,
"name": "base",
"uuid": "ec9fdf03ea18afe386c71150e532bb4d"
}
],
"name": "fd"
},
"success": true
}
- Request Body: empty
- Returns: An object with keys success and agent.
{
"result": {
"description": null,
"id": 7,
"is_locked": false,
"is_main": false,
"modules": [
{
"id": 1,
"is_locked": true,
"name": "base",
"uuid": "ec9fdf03ea18afe386c71150e532bb4d"
}
],
"name": "foo"
},
"success": true
}
- Request Body: empty
- Returns: An object with keys success and agent.
{
"result": {
"description": null,
"id": 7,
"is_locked": true,
"is_main": false,
"modules": [
{
"id": 1,
"is_locked": true,
"name": "base",
"uuid": "ec9fdf03ea18afe386c71150e532bb4d"
}
],
"name": "foo"
},
"success": true
}
- Request Body: name
- Returns: An object with keys success and agent.
{data: {name: "foo"}}
{
"result": {
"description": null,
"id": 7,
"is_locked": true,
"is_main": false,
"modules": [
{
"id": 1,
"is_locked": true,
"name": "base",
"uuid": "ec9fdf03ea18afe386c71150e532bb4d"
}
],
"name": "foo"
},
"success": true
}
- Request Body: name, intents
- Returns: An object with keys success and module.
{
"data":{
"code": {
"name": "base",
"intents": [
{
"name": "greeting",
"patterns": [
{
"text": "Hi"
},
{
"text": "Hello"
},
...
],
"responses": [
{
"text": "Hello, what can I help with?"
},
...
]
},
...
}
}
}
{
"result": {
"id": 25,
"intents": [
{
"id": 184,
"name": "greeting",
"patterns": [
{
"id": 826,
"text": "Hi"
},
{
"id": 827,
"text": "Hello"
},
{
"id": 828,
"text": "You there"
},
{
"id": 829,
"text": "Is anyone there"
},
{
"id": 830,
"text": "Hello"
},
{
"id": 831,
"text": "Hey"
},
{
"id": 832,
"text": "Moo"
},
{
"id": 833,
"text": "Hola"
}
],
"responses": [
{
"id": 320,
"text": "Hello, what can I help with?"
},
{
"id": 321,
"text": "Hi there, how can I help?"
}
]
},
...
{
"id": 196,
"name": "love",
"patterns": [
{
"id": 873,
"text": "what is love"
}
],
"responses": [
{
"id": 351,
"text": "baby don`t hurt me "
},
{
"id": 352,
"text": "There are a lot of chemicals racing around your brain and body when you're in love. ... Dopamine is thought to be the \"pleasure chemical,\" producing a feeling of bliss. Norepinephrine is similar to adrenaline and produces the racing heart and excitement."
}
]
}
],
"is_locked": false,
"name": "faqs",
"uuid": "c71150e532bb4dec9fdf03ea18afe386"
},
"success": true
}
- Request Body: empty
- Returns: An object with key success.
{
"success": true
}