Skip to content

Cerebro manages the NLU (Natural Language Understanding) part of milobella.

Notifications You must be signed in to change notification settings

milobella/cerebro

Repository files navigation

Cerebro

Cerebro manage the NLU (Natural Language Understanding) part of Milobella.

Installation

python -m spacy download fr_core_news_md
pip install -r requirements.txt
pip install -e .

Update the learning sentences

Update the spacy_sandbox/simple_cats.py file with the new sentences and categories.

python spacy_sandbox/simple_cats.py

It might take a few minutes.

Run

$ sanic cerebro.server.app --dev

Upload and train a model

When the server is running, this is not over. You have two tasks to perform to make it work. To facilitate these steps scripts has been built in scripts folder.

cd scripts
./upload_model.sh
./train_model.sh
./poll_model.sh # To repeat until the 503 message disappears /!\ It can take several minutes

Upload the model (not necessary if the model is already in database)

$ curl -iv -X PUT 'http://localhost:9444/models/default/samples' -d samples.json

An example of samples.json file format is here : ./scripts/samples.json

Train the model (necessary after each server start and after each upload)

$ curl -iv -X POST 'http://localhost:9444/models/default/train'

Request example

$ curl -iv -X POST 'http://localhost:9444/understand' -d '{"text": "Bonjour"}'

CHANGELOGS