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

feature: lookup intent parser #121

Merged
merged 19 commits into from
Jul 11, 2019
Merged

Conversation

mattgathu
Copy link
Contributor

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

@mattgathu mattgathu requested review from adrienball, ClemDoum and klefevre and removed request for adrienball and ClemDoum February 26, 2019 13:45
src/intent_parser/lookup_intent_parser.rs Outdated Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Outdated Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Outdated Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Outdated Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Show resolved Hide resolved
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.
Copy link
Collaborator

@adrienball adrienball left a 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.

src/intent_parser/lookup_intent_parser.rs Outdated Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Outdated Show resolved Hide resolved
src/intent_parser/lookup_intent_parser.rs Show resolved Hide resolved
register lookup intent parser in the nlu engine metadata enum
@mattgathu mattgathu force-pushed the feature/lookup_intent_parser branch from e0f383e to 54755db Compare March 1, 2019 16:42
mattgathu and others added 6 commits March 1, 2019 18:26
* 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
@adrienball adrienball force-pushed the feature/lookup_intent_parser branch from 5549133 to 526bc37 Compare May 21, 2019 17:08
@adrienball adrienball merged commit 774a20b into develop Jul 11, 2019
@adrienball adrienball deleted the feature/lookup_intent_parser branch July 11, 2019 12:57
@ClemDoum ClemDoum mentioned this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants