An open API service indexing awesome lists of open source software.

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.

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