https://github.com/jpruden92/dialogflow-nlp-to-nlpjs
Transform your Dialogflow NLP model to a NLP.js model
https://github.com/jpruden92/dialogflow-nlp-to-nlpjs
chat chatbot dialogflow nlp nlpjs nlu text voice
Last synced: 6 months ago
JSON representation
Transform your Dialogflow NLP model to a NLP.js model
- Host: GitHub
- URL: https://github.com/jpruden92/dialogflow-nlp-to-nlpjs
- Owner: jpruden92
- License: gpl-3.0
- Created: 2019-04-26T12:02:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-12T22:18:02.000Z (almost 5 years ago)
- Last Synced: 2025-03-30T06:04:08.346Z (6 months ago)
- Topics: chat, chatbot, dialogflow, nlp, nlpjs, nlu, text, voice
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```sh
DIALOGFLOW_CREDENTIALS=my_json_credentials.json node index.js train
```At the end, you will have a ``dialogflow_model.nlp`` on ``model`` folder.
2. ``node index.js use "text example"``
Uses your model to transform your text to intent.
3. ``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.
```4. ``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
```