-
Notifications
You must be signed in to change notification settings - Fork 56
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
feature: lookup intent parser #121
Conversation
A new hashmap based intent parser. The normalized/canonical form of an utterance serves as the key and the value is tuple of `(intent_id, [vec_of_slots_ids])` Once a lookup is done at inference, the intent and slots are retrieved by matching their ids to a vec of intent names and a vec of slot names respectively. This is the rust implementation of snipsco/snips-nlu#759
* refactor text preprocessing and avoid key generation * refactor replace entities and avoid range calculations
the first hashmap lookup is based on a key generated on the processed text (text with entity replacements). If this lookup returns no value a second lookup using the plain text is done, this lookup corresponds to having no entity replacements.
5a81b94
to
ae55fac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On top of the comments, you must also update the logic in intent_parser/mod.rs
and add the support of the new intent parser.
This is tested through the loading of data/tests/models/nlu_engine
and data/tests/models/nlu_engine.zip
, hence we should re-generate these files using the new lookup intent parser.
register lookup intent parser in the nlu engine metadata enum
e0f383e
to
54755db
Compare
* rebuilt the test nlu_engine dataset
Refactor lookup hashmap to use hashes as keys instead of actual string patterns. The reduces the size of the model.
…_hashing Add Lookup Intent Parser key hashing
5549133
to
526bc37
Compare
A new hashmap based intent parser.
The normalized/canonical form of an utterance serves as the key and the value is tuple of
(intent_id, [vec_of_slots_ids])
Once a lookup is done at inference, the intent and slots are retrieved by matching their ids to a vec of intent names and a vec of slot names respectively.
This is the rust implementation of snipsco/snips-nlu#759