-
Notifications
You must be signed in to change notification settings - Fork 624
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
Multiple entities of same type/same values resolving incorrectly #1054
Comments
We're seeing this issue as well. Here is a discussion about it: https://community.jovo.tech/t/entities-resolved-incorrectly/1767/6?u=jan |
I think the reason is that entities are parsed just by searching for the words in the whole text. So the "order of the entities in the utterance" is not taken into account right now. Especially because of the support to detect "repeated entities" of the same type in such nunbered entities makes that very difficult. I think one idea could be to combine an enum with "trim rules" (would be new feature), so allow to specify that e.g. before the enum always e.g. "to" needs to be existence. then the "ccyTo" wopuld have an options list AND a trim definition and only if both matches it would be allowed. Currently if you define two entitiy types for the same entity name they are processed both and in the end you might end up with two entities found ... this would needed to change, so in fact kind of a breakign change .... I could look into this because I'm currently working on entity stuff if wanted |
I prepare a PR for it - also in connection to #1174 ... but most likely PR nreeds to wait until my other 4 PRs are merged ... It starts to overlap code-wise, so else it gets a merge hell. With the changes from the said PR we end in this matching:
|
should be adressed by #1221 |
Hi @Apollon77 is this feature already implemented and if so is there sample corpus for this? Thanks |
Describe the bug
When the utterances have multiple entities of the same type (i.e., same values), then the entities are resolved incorrectly.
To Reproduce
Steps to reproduce the behavior:
cd nlp-entities-test
npm i
node .
corpus.json:
Here,
USD
&INR
are part of bothccyFrom
andccyTo
. In my case, these 2 entities are actually of the same type. For this test purpose only I removed a few entries fromccyFrom
.When the test phrase is:
convert from USD to INR
, both the entities are resolved as sameccyFrom
with alias asccyFrom_0 = USD
andccyFrom_1 = INR
. Below is the output:If the test phrase is
convert from USD to GBP
, then the entities are resolved as expected toccyFrom = USD
andccyTo = GBP
asGBP
is not present inccyFrom
options.Expected behavior
Entities should be resolved by the entity names used in the utterances (in this case, matching utterance is 'convert from @ccyFrom to @ccyto')
Desktop (please complete the following information):
- OS: Windows 11
- Browser: NA
- Package version: 4.22.7
- Node version: 16.13.
The text was updated successfully, but these errors were encountered: