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

Gazetteer entities #668

Merged
merged 46 commits into from
Oct 4, 2018
Merged

Gazetteer entities #668

merged 46 commits into from
Oct 4, 2018

Conversation

adrienball
Copy link
Contributor

Description:
This PR introduces the use of gazetteer entities through new 3 builtin entities with initial support in French:

  • snips/musicAlbum
  • snips/musicArtist
  • snips/musicTrack

A new CustomEntityParser object is introduced. It relies on the gazetteer entity parser library, and replaces all the previous logics regarding the matching and the resolution of custom entities.

The serialization of the SnipsNLUEngine has also evolved, as there are now two new folders:

  • builtin_entity_parser
  • custom_entity_parser

Hence, the model version is bumped to 0.17.0.

adrienball and others added 30 commits October 2, 2018 18:19
@adrienball adrienball requested a review from ClemDoum October 3, 2018 15:56
@codecov-io
Copy link

codecov-io commented Oct 3, 2018

Codecov Report

Merging #668 into develop will decrease coverage by 0.21%.
The diff coverage is 83.19%.

@@             Coverage Diff             @@
##           develop     #668      +/-   ##
===========================================
- Coverage    89.17%   88.95%   -0.22%     
===========================================
  Files           59       64       +5     
  Lines         3306     3648     +342     
  Branches       627      672      +45     
===========================================
+ Hits          2948     3245     +297     
- Misses         258      307      +49     
+ Partials       100       96       -4

@adrienball adrienball force-pushed the task/custom-gazetteer-entities branch 2 times, most recently from dbc7c80 to 8d9320c Compare October 4, 2018 09:33
@adrienball adrienball force-pushed the task/custom-gazetteer-entities branch from 8d9320c to 2d4aa15 Compare October 4, 2018 09:47
if ENTITY in chunk:
entities_values[chunk[ENTITY]].add(chunk[TEXT].strip())
return {k: list(v) for k, v in iteritems(entities_values)}


def extract_intent_entities(dataset, entity_filter=None):
intent_entities = {intent: set() for intent in dataset[INTENTS]}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collections.defaultdict does exactly this

@ClemDoum
Copy link
Collaborator

ClemDoum commented Oct 4, 2018

🎉 🎉 🎉 🎉

@adrienball adrienball merged commit 0c60b3f into develop Oct 4, 2018
@adrienball adrienball deleted the task/custom-gazetteer-entities branch October 4, 2018 13:50
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.

3 participants