0.1.0 • Published 5 years ago

dialogflow-to-nlpjs v0.1.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
5 years ago

What is this?

Gets dialogflow content and generates a NLP.js model that replicates its functionality.

Commands

npx dialogflow-to-nlpjs train
npx dialogflow-to-nlpjs test
npx dialogflow-to-nlpjs expose

How to use

Train

Create a Dialogflow credential key and rename it as credentials.json or export it as environment variable:

DIALOGFLOW_CREDENTIALS=my_json_credentials.json npx dialogflow-to-nlpjs train

Note: You have to run this command with the file in the same folder

At the end, you will have a dialogflow_model.nlp on model folder.

Use

npx dialogflow-to-nlpjs use "text example"

Gets analysis info of your text

Test

npx dialogflow-to-nlpjs test

Allows to test a conversation using your model. Example:

Enter a text: hola
Result:
- [intent]: adf.smalltalk.hola
- [score]: 1.
Enter a text: que tal
Result:
- [intent]: adf.smalltalk.quetal
- [score]: 1.
Enter a text: cuentame un chiste
Result:
- [intent]: adf.smalltalk.chiste
- [score]: 1.

Expose

npx dialogflow-to-nlpjs expose

Exposes the model as REST API.

Here you have an example of request:

- Type: POST
- Endpoint: http://localhost:3000/resolve
- Body: { "text": "hola" }
- Header: Content-Type: application/json
0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago