Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload model.nlp on the fly #1074

Open
igorjos opened this issue Jan 28, 2022 · 3 comments
Open

Reload model.nlp on the fly #1074

igorjos opened this issue Jan 28, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@igorjos
Copy link

igorjos commented Jan 28, 2022

Hi I'm interested how I can re-load the model.nlp file on the fly - without need to restart the node process?

More input:

What I'm doing is, when there is no intent to which bot can answer, I look up on internet, find proper answer, then that is automatically stored in corpus.json file and new intent with u/a's. I also re-train on the fly, all changes are stored in model.nlp, but not loaded within the app until next restart.

I've tried

nlp.load('model.nlp') as well nlp.addCorpus('file.json') but nothing seems to work.

Thanks

@ScienceLion
Copy link

Yes, I would like to know too.

Right now, once I run a nlp.process(), any attempt to retrain or load a model creates a situation where any subsequent nlp.process() results with outputs from the original model rather than what I would expect from the new model, unless the utterance was an exact match to new phrases added.

Therefore, I'm finding that I also have to end the app and restart with the new model.

@ScienceLion
Copy link

I've got a workaround.

Instead of const nlp = new NlpManager( options );, I use var nlp = new NlpManager( options );.
so that when I want to reload a different model or retrain a new model, I would first nlp = new NlpManager( options ); and immediately nlp.load('model.nlp'); BEFORE performing any nlp.process( input );

There may be a better way, but just flat out rebuilding nlp seemed the safest.

@aigloss aigloss added the enhancement New feature or request label Nov 24, 2022
@MarketingPip
Copy link

@ScienceLion - been digging for this comment for awhile (knew I read this somewhere). Just wanted to say how much I appreciate your advice / workaround (hoping this works in browser). 🤞

Thank you big time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants