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

Lookup Intent Parser #759

Merged
merged 28 commits into from
Jul 11, 2019
Merged

Lookup Intent Parser #759

merged 28 commits into from
Jul 11, 2019

Conversation

mattgathu
Copy link
Contributor

@mattgathu mattgathu commented Feb 22, 2019

What

This introduces a new dictionary-based deterministic intent parser.

The parser uses a hashmap to map normalized utterances to their
expected intent and slots.

Symbol tables are used to store the intents names and slot names
and this reduces the amount of information stored in the dictionary
values.

Why

  • This implementation is compact enough to store a huge number of
    utterances and their expected outputs.
  • It also out performs the regex implementation as dict lookups are faster.
  • The space usage is reduced further by hashing the dictionary keys.

Checklist:

  • My PR is ready for code review
  • I have added some tests, if applicable, and run the whole test suite, including linting tests
  • I have updated the documentation, if applicable

What
--
This introduces a new dictionary-based deterministic intent parser.

The parser uses a hashmap to map normalized utterances to their
expected intent and slots.

Symbol tables are used to store the intents names and slot names
and this reduces the amount of information stored in the dictionary
values.

Why
--
This implementation is compact enough to store a huge number of
utterances and their expected outputs. It also out performs the
regex implementation as dict lookups are faster.

**NOTE**: The space usage can even be reduced further by hashing the
dictionary keys. (_this is a future plan once this impl is stabilized_)
@mattgathu mattgathu changed the title New Intent Parser: LookupIntentParser Lookup Intent Parser Feb 22, 2019
mattgathu added a commit to snipsco/snips-nlu-rs that referenced this pull request Feb 26, 2019
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
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
* simplify implementation for consistency and simplicity:
    - avoid calculating range mappings
    - refactor text preprocessing and avoid code duplication
* fix bug
    - fix key collision handling
* fix up the docs
mattgathu added a commit to snipsco/snips-nlu-rs that referenced this pull request Mar 1, 2019
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
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/intent_parser/lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/tests/test_lookup_intent_parser.py Outdated Show resolved Hide resolved
snips_nlu/tests/test_lookup_intent_parser.py Outdated Show resolved Hide resolved
@adrienball adrienball force-pushed the feature/lookup_intent_parser branch from 6a97318 to a3c3039 Compare May 16, 2019 14:43
@adrienball adrienball added this to the 1.0.0 milestone Jun 24, 2019
adrienball pushed a commit to snipsco/snips-nlu-rs that referenced this pull request Jul 11, 2019
* feature: lookup intent parser

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
@adrienball adrienball merged commit 0f95d96 into develop Jul 11, 2019
@adrienball adrienball deleted the feature/lookup_intent_parser branch July 11, 2019 21:09
@ClemDoum ClemDoum mentioned this pull request Jul 12, 2019
1 task
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.

None yet

2 participants