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

Package misses out custom entities but picks the duckling entity #18

Open
NomanSaleem4 opened this issue Aug 12, 2020 · 6 comments
Open

Comments

@NomanSaleem4
Copy link

NomanSaleem4 commented Aug 12, 2020

I have this pattern

{
    "composite_entities": [
        {
            "name": "order.salads_composite",
            "patterns": ["@quantity @salads"]
        }
    ]
}

but the problem i am facing here is, when i input "i want to order 1 greek salad " bot extracts three entities quantity salads and number as
[{'entity': 'quantity', 'start': 16, 'end': 17, 'confidence_entity': 0.9876763780464889, 'value': '1', 'extractor': 'CRFEntityExtractor'}, {'start': 16, 'end': 17, 'text': '1', 'value': 1, 'confidence': 1.0, 'additional_info': {'value': 1, 'type': 'value'}, 'entity': 'number', 'extractor': 'DucklingHTTPExtractor'}, {'entity': 'salads', 'start': 18, 'end': 29, 'confidence_entity': 0.9803940941544417, 'value': 'Greek Salad', 'extractor': 'CRFEntityExtractor', 'processors': ['EntitySynonymMapper']}]

Here why does the package does not extract composite order.salads_composite containing [quantity and salads]? It should have extracted it.

But on the other side when i included another pattern that is "patterns": ["@number @salads"] its extracted order.salads_composite composite(number is the duckling entity). Why its showing this behavior?
Eagerly waiting for your response and the fix if required . Thank you so much.

@BeWe11
Copy link
Owner

BeWe11 commented Aug 13, 2020

Gonna take a look at this today @NomanSaleem4

@BeWe11
Copy link
Owner

BeWe11 commented Aug 13, 2020

Ok, you found an edge case where overlapping entities override each other during the pattern search. In your example, the duckling number comes after the "quantity" entity but starts at the same position "16", therefore the "quantity" entity cannot be found when patterns are searched. If the duckling number would be the first item in your entity list, the pattern would have been found, as the "quantity" entity would then override the duckling number.

The (general) solution to this problem is not obvious to me, I'll have to think about this.

@NomanSaleem4
Copy link
Author

Hmm i got you. A bit tricky it is

@NomanSaleem4
Copy link
Author

Did you face the similar problem in version 0.4.5 or it was not there?

@BeWe11
Copy link
Owner

BeWe11 commented Aug 13, 2020

The problem arises out of the core functionality of this component, so it should have been there from the start.

@NomanSaleem4
Copy link
Author

Hmm ok.

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

No branches or pull requests

2 participants