https://github.com/tiledesk/tiledesk-ai
Tiledesk Module for Conversational AI. Tiledesk is an open source conversational platform alternative to Intercom, Zendesk, Drift, Tawk.to and Tidio for Customer Service and Conversational Marketing.
https://github.com/tiledesk/tiledesk-ai
chatbot conversational-ai open-source python
Last synced: about 1 year ago
JSON representation
Tiledesk Module for Conversational AI. Tiledesk is an open source conversational platform alternative to Intercom, Zendesk, Drift, Tawk.to and Tidio for Customer Service and Conversational Marketing.
- Host: GitHub
- URL: https://github.com/tiledesk/tiledesk-ai
- Owner: Tiledesk
- License: mit
- Created: 2022-08-30T15:33:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T20:25:56.000Z (over 2 years ago)
- Last Synced: 2025-03-27T05:23:02.201Z (over 1 year ago)
- Topics: chatbot, conversational-ai, open-source, python
- Language: Python
- Homepage: https://tiledesk.com/
- Size: 2.83 MB
- Stars: 12
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tiledesk-ai
Tiledesk Module for AI
This module uses a simple Feed Forward Network implemented using PyTorch (more to come in the future) to understand the user intent.
## Use with the command line
> NOTE: recommended Python version >= 3.9
### Install
We recommend to install a python3 virtual env and install tiledesk-ai on it.
```
pip install virtualenv
python3 -m venv tileai
source ./tileai/bin/activate
```
Create your working folder:
```
mkdir tiledesk-ai
cd tiledesk-ai
```
Now synchronize with the source repo:
```
git clone https://github.com/Tiledesk/tiledesk-ai.git
cd tiledesk-ai
pip install -r requirements.txt
```
Now you can choose between two alternatives.
**PRODUCTION MODE**
If you are not interested in customize the code to improve/modify the module you can just
use the production command:
> pip install .
**DEVELOPMENT MODE**
For developement (if you want to modify the source code), use:
```
pip install -e .
```
This command will install the in-place the program. You can edit the script files and test them from the command line.
### Train
Use the ./domain/**nlu.json** file to setup all intents train in your project.
### nlu.json example
```json
{
"configuration": {
"pipeline": ["auto"]
},
"nlu": [
{
"intent":"hello_intent",
"examples":["Hi","Hello"]
},
{
"intent":"goodbye_intent",
"examples":["goodbye","bye","good night"]
}
]
}
```
Actually *configuration* parameter only takes this settings:
```
"configuration": {
"pipeline": "auto|embeddingwbag|feedforward|lstm|bert"
}
```
To **train the model** use the *tileai* command.
*tileai* command synthax:
```
> tileai train [-f nlu_filepath] [-o model_file_path]
```
*nlu_filepath* defaults to local */domain/nlu.json* file.
Example:
> tileai train -f domain/nlu.json -o models/my_trained_model
### Query
```shell
> tileai query [-m model path] -t "question"
```
Query example:
```shell
> tileai query -m models/my_trained_model -t "ciao"
```
## HTTP server
### Run the HTTP server
You can run the tiledesk-ai module as a web app, launching the HTTP server.
Default HTTP server port is 6006. You can change the port using the _-p port_ option.
```shell
> tileai run [-p port]
```
### Query from HTTP server
To train your model from http server:
```
POST http://localhost:port/train
```
```json
{
"configuration": {
"algo": "auto"
},
"nlu": [{
"intent":"hello_intent",
"examples":["Hi","Hello", "..."]
},
]
}
```
To query your model
```shell
POST http://localhost:port/model/parse
```
```json
{
"model":"models/",
"text":"..."
}
```
## APIs
TODO