-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #790 from snipsco/release/0.19.6
Release 0.19.6
- Loading branch information
Showing
11 changed files
with
338 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
Contributors | ||
============ | ||
|
||
This is a list of everyone who has made significant contributions to Snips NLU, in alphabetical order. Thanks a lot for the great work! | ||
This is a list of everyone who has made contributions to Snips NLU, in alphabetical order. Thanks a lot for the great work! | ||
|
||
* `Alice Coucke <https://github.com/choufractal>`_ | ||
* `cclauss <https://github.com/cclauss>`_ | ||
* `ddorian <https://github.com/ddorian>`_ | ||
* `Josh Meyer <https://github.com/JRMeyer>`_ | ||
* `Matthieu Brouillard <https://github.com/McFoggy>`_ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,14 @@ | |
|
||
__title__ = "snips_nlu" | ||
__summary__ = "Snips Natural Language Understanding library" | ||
__uri__ = "https://snips-nlu.readthedocs.io" | ||
__github_url__ = "https://github.com/snipsco/snips-nlu" | ||
__doc_url__ = "https://snips-nlu.readthedocs.io" | ||
__tracker_url__ = "https://github.com/snipsco/snips-nlu/issues" | ||
__author__ = "Clement Doumouro, Adrien Ball" | ||
__email__ = "[email protected], [email protected]" | ||
__license__ = "Apache License, Version 2.0" | ||
|
||
__version__ = "0.19.5" | ||
__version__ = "0.19.6" | ||
__model_version__ = "0.19.0" | ||
|
||
__download_url__ = "https://github.com/snipsco/snips-nlu-language-resources/releases/download" | ||
|
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
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
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,60 @@ | ||
from __future__ import unicode_literals | ||
|
||
import io | ||
from unittest import TestCase | ||
|
||
from snips_nlu.dataset import Dataset, validate_and_format_dataset | ||
from snips_nlu.dataset.utils import extract_entity_values | ||
|
||
|
||
class TestDatasetUtils(TestCase): | ||
def test_should_extract_entity_values(self): | ||
# Given | ||
set_light_color_yaml = io.StringIO(""" | ||
--- | ||
type: intent | ||
name: setLightColor | ||
utterances: | ||
- set the lights to [color](blue) | ||
- change the light to [color](yellow) in the [room](bedroom)""") | ||
|
||
turn_light_on_yaml = io.StringIO(""" | ||
--- | ||
type: intent | ||
name: turnLightOn | ||
utterances: | ||
- turn the light on in the [room](kitchen) | ||
- turn the [room](bathroom)'s lights on""") | ||
|
||
color_yaml = io.StringIO(""" | ||
type: entity | ||
name: color | ||
values: | ||
- [blue, cyan] | ||
- red""") | ||
|
||
room_yaml = io.StringIO(""" | ||
type: entity | ||
name: room | ||
values: | ||
- garage | ||
- [living room, main room]""") | ||
|
||
dataset_files = [set_light_color_yaml, turn_light_on_yaml, color_yaml, | ||
room_yaml] | ||
dataset = Dataset.from_yaml_files("en", dataset_files).json | ||
dataset = validate_and_format_dataset(dataset) | ||
|
||
# When | ||
entity_values = extract_entity_values(dataset, | ||
apply_normalization=True) | ||
|
||
# Then | ||
expected_values = { | ||
"setLightColor": {"blue", "yellow", "cyan", "red", "bedroom", | ||
"garage", "living room", "main room", "kitchen", | ||
"bathroom"}, | ||
"turnLightOn": {"bedroom", "garage", "living room", "main room", | ||
"kitchen", "bathroom"} | ||
} | ||
self.assertDictEqual(expected_values, entity_values) |
Oops, something went wrong.