-
Notifications
You must be signed in to change notification settings - Fork 654
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
New Custom Lexicon from scratch #257
Comments
yikes! nlp('mytext', {lexicon:myNewWords}).whatever() as a somehow non-persistent lexicon change? It's a little tricky, and I'm not an expert about how modules get loaded, but there's a fair amount if processing each time the lexicon gets built, so it would be a drag if it had to be rebuilt at each use. Also, the lexicon is just a hashmap, so if you change it, it's all pass-by-reference downstream. |
I'm not an expert on how modules get loaded it either, but I got it to work now for my majority of use without 'require-reload' thankfully. I had some unit tests that were sharing the same nlp instance and I wanted them to hit specific lexicons sometimes and others not. I decided to just instantiate the nlp instance inside the function instead and problem went away. =) |
hey, your timing is perfect for making this issue. |
HI @spencermountain and @elderbas, I just stumbled onto nlp-compromise last night. I'm trying to understand the different between plugins and custom lexicon and how I might use them. Can you share some use cases? Let's say if I want to help users navigate around my site by asking questions in natural language, for example: 'I want to see the readme section' or 'I want to make a reservation' then I want to be able to infer to 'mysite/readme.html' or 'mysite/reservation.html' Thanks. |
hey @playground yeah, it's not very clear right now. I've got some new documentation written but it's stuck behind a few other things. the plugins just allow for even more config than the lexicon parameter. So, here's how i'd go about doing that redirect-example: |
Hey @spencermountain, thanks for getting back with me. Yeah, I'm really digging nlp-compromise, it's one of the better library I have seen so far. I have posted an issue here nlp-compromise/compromise-plugin#1, I think it probably should belong to here more. I had forked and implemented some code to support questions and responses (more like commands and controls) via the plugin. I would love to be able to contribute. But before I do that I would like to spend a little time chatting with you to make sure I'm doing things in the right orders. |
hey, yeah just getting back to all my emails ;) i think what happened in your example is that the but yeah, you're on the right track with usage of the plugin, and I'd love some help, anywhere you'd like to help. The plugin scheme was finished in v11, about 2 weeks ago, so you'll be the second or third person/company to use it i think. The main motivation was to be able to compress config data, the same way the library does internally. - So it's pretty rough right now, and certainly lacking good docs, but ready for intrepid use |
I see. hmm, would be great if that will work :-) On the commands and controls side, I'm still playing around with it, here is what I have added to provide responses based on what is described in the plugin. For example:
in world/index.js
addResponses.js
|
hey, in v12 there's a more sensible way to configure per-parse lexicon information directly. |
It seems like once you load new words to the lexicon it stays there.
What's the best way to use a custom lexicon for only a temporary time?
Right now on my Node app I have to use require-reload to just re instantiate nlp every time.
The text was updated successfully, but these errors were encountered: