Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

How to use it in production #55

Closed
adantoscano opened this issue Oct 22, 2019 · 5 comments
Closed

How to use it in production #55

adantoscano opened this issue Oct 22, 2019 · 5 comments

Comments

@adantoscano
Copy link

Sorry in advance if it's already explained, but I don't get how can I use this app after train the model.

Where is model file to use it with a existing app running with nlp.js?
Can I import a already trained model to work with it?
This app create an API to make request to it?

@jesus-seijas-sp
Copy link
Contributor

Hello,
Yes, it creates an API that is described in a swagger. You've the endpoints for the CRUD of agents, domains, intents, entities, slot filling.... but also for the session information of each user.
The main endpoint is the "converse". At the converse endpoint you provide a session identifier (unique per conversation with the user, by default es NLPUI) and the text to be processed. As it has a context, the slot filling is automatically processed also.

@jesus-seijas-sp
Copy link
Contributor

Also: it creates a training per agent in the database, so you can use it in your agents.
At the "serverless" branch you have an example with dynamodb and serverless mode... the use case is that you have a serverless chatbot also, so you can train with the app, and the serverless funcion of the chatbot retrieves the session info and the training model from the dynamodb.

@adantoscano
Copy link
Author

Nice!
And import a model obtained by nlp.js, is it possible?

@jesus-seijas-sp
Copy link
Contributor

Well, the collection "trainings" have a model with an agent id (identifier of the agent) and the model that is the string representation of the model.nlp... so technically it can be possible to inject the model from nlp.js into nlp.js-app... but I don't see the point about it. This app is built so you can set your intents/entities/answers and it trains an nlp.js-app while also storing all into database.

We use it that way: we build bots and they use the NLP.js-app API to resolve the intents/answers, exactly the same way as if you were using RASA, Dialogflow, Microsoft LUIS...
but also we use it without the API: you have a bot with the nlp.js library, and when a model in NLP.js-app is trained the model is injected into the bot. That way you don't need API calls, all happens inside the bot, so the speed to get the answer is faster.

@adantoscano
Copy link
Author

The point is that I already have a quite big model working that I'd like to modify, so make it from scratch is a quite big work. So I want to import it and use as you do.

Maybe I'll code a script to do so...

Thanks for you quick reply Jesus!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants