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

EntityExtractor in v1.10.0 yield wrong entity value for language without spaces #5755

Closed
tomgun132 opened this issue Apr 30, 2020 · 2 comments · Fixed by #5756
Closed

EntityExtractor in v1.10.0 yield wrong entity value for language without spaces #5755

tomgun132 opened this issue Apr 30, 2020 · 2 comments · Fixed by #5756
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR

Comments

@tomgun132
Copy link

Rasa version:
v1.10.0
Python version:
3.7
Operating system:
Windows, Linux

I'm not sure if this should be a bug or feature request, but here I go.

Description of Problem:
For language that doesn't have space that separate words, any EntityExtractor class will return the whole sentence as the value. When I see what changes have been made into that class, I see that there are few new functions that make up into clean_up_entities function. The problem appears from that function as I observe the process from the SpacyEntityExtractor. Based on the comment on function _token_clusters: "two tokens belong to the same word if there is no other character between them", I assume that all the process of the clean_up_entities function will merge whole input if there is no space between words.

Overview of the Solution:
I haven't really looked into the sub-words problem that requires this clean_up_entities function, so I can't really offer any solution except that I will still use v1.9.x. However, if this function will still be kept as it is for the future release, I either need to remake all of my training data to have space and preprocess the input to Rasa chatbot with custom components, or still stay on hold with version 1.9.x

Examples
On previous version:

>>> model.parse('木村拓哉は誰ですか')
'entities': [{'entity': 'Person',
   'value': '木村拓哉',
   'start': 0,
   'confidence': None,
   'end': 4,
   'extractor': 'SpacyEntityExtractor'}]

on version 1.10.0

>>> model.parse('木村拓哉は誰ですか')
'entities': [{'entity': 'Person',
   'value': '木村拓哉は誰ですか',
   'start': 0,
   'confidence': None,
   'end': 9,
   'extractor': 'SpacyEntityExtractor'}]
@tomgun132 tomgun132 added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR labels Apr 30, 2020
@tabergma
Copy link
Contributor

tabergma commented Apr 30, 2020

Thanks @tomgun132 for raising the issue. I'm already working on a fix. Should hopefully be in the next patch release.

EDIT: our fix will be in the next minor release

@tomgun132
Copy link
Author

Hello @tabergma,
Thank you very much for the quick response and I really appreciate it that you're already working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants