Skip to content

jpruden92/dialogflow-nlp-to-nlpjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commands

  1. node index.js train

Gets dialogflow content and generates a NLP.js model that replicates its functionality. You need to export your Dialogflow service account as environment variable:

DIALOGFLOW_CREDENTIALS=my_json_credentials.json node index.js train

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

  1. node index.js use "text example"

Uses your model to transform your text to intent.

  1. node index.js 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.
  1. node index.js 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

Releases

No releases published

Packages

No packages published