-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: lookup intent parser (#121)
* 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
- Loading branch information
1 parent
b5cd19b
commit 774a20b
Showing
48 changed files
with
26,880 additions
and
241,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,6 @@ | |
"beverage_temperature": "Temperature", | ||
"number_of_cups": "snips/number" | ||
} | ||
} | ||
}, | ||
"stop_words_whitelist": {} | ||
} |
88 changes: 88 additions & 0 deletions
88
data/tests/models/nlu_engine/lookup_intent_parser/intent_parser.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"config": { | ||
"ignore_stop_words": true, | ||
"unit_name": "lookup_intent_parser" | ||
}, | ||
"entity_scopes": [ | ||
{ | ||
"entity_scope": { | ||
"builtin": [ | ||
"snips/number" | ||
], | ||
"custom": [] | ||
}, | ||
"intent_group": [ | ||
"MakeCoffee" | ||
] | ||
}, | ||
{ | ||
"entity_scope": { | ||
"builtin": [ | ||
"snips/number" | ||
], | ||
"custom": [ | ||
"Temperature" | ||
] | ||
}, | ||
"intent_group": [ | ||
"MakeTea" | ||
] | ||
} | ||
], | ||
"intents_names": [ | ||
"MakeCoffee", | ||
"MakeTea" | ||
], | ||
"language_code": "en", | ||
"map": { | ||
"-1658454006": [ | ||
1, | ||
[ | ||
0 | ||
] | ||
], | ||
"-1533083481": [ | ||
0, | ||
[ | ||
0 | ||
] | ||
], | ||
"-1416877420": [ | ||
0, | ||
[ | ||
0 | ||
] | ||
], | ||
"-1362288387": [ | ||
1, | ||
[ | ||
0, | ||
1 | ||
] | ||
], | ||
"-687749971": [ | ||
0, | ||
[ | ||
0 | ||
] | ||
], | ||
"1085718744": [ | ||
1, | ||
[ | ||
1 | ||
] | ||
], | ||
"1413162768": [ | ||
1, | ||
[ | ||
0, | ||
1 | ||
] | ||
] | ||
}, | ||
"slots_names": [ | ||
"number_of_cups", | ||
"beverage_temperature" | ||
], | ||
"stop_words_whitelist": {} | ||
} |
3 changes: 3 additions & 0 deletions
3
data/tests/models/nlu_engine/lookup_intent_parser/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"unit_name": "lookup_intent_parser" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...bilistic_intent_parser/intent_classifier/featurizer/cooccurrence_vectorizer/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"unit_name": "cooccurrence_vectorizer" | ||
} |
35 changes: 35 additions & 0 deletions
35
...listic_intent_parser/intent_classifier/featurizer/cooccurrence_vectorizer/vectorizer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"builtin_entity_scope": [ | ||
"snips/number" | ||
], | ||
"config": { | ||
"filter_stop_words": true, | ||
"keep_order": true, | ||
"unit_name": "cooccurrence_vectorizer", | ||
"unknown_words_replacement_string": null, | ||
"window_size": 5 | ||
}, | ||
"language_code": "en", | ||
"word_pairs": { | ||
"0": [ | ||
"SNIPSNUMBER", | ||
"coffee" | ||
], | ||
"1": [ | ||
"SNIPSNUMBER", | ||
"tea" | ||
], | ||
"2": [ | ||
"TEMPERATURE", | ||
"tea" | ||
], | ||
"3": [ | ||
"of", | ||
"coffee" | ||
], | ||
"4": [ | ||
"of", | ||
"tea" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.