wit-ai / pywit

Python library for Wit.ai
Other
1.45k stars 359 forks source link

wit chooses the entity with low confidence #97

Open akasranjan005 opened 7 years ago

akasranjan005 commented 7 years ago

I have a bot to get mobile number of user and send OTP, in webchat everything is fine but in skype, the skype gives the url to every mobile number which creates exception for the bot, but still it gets 3 entities, out which one is with conifdence 1 and have the correct/required values

{u'otp_value': [{u'suggested': True, u'confidence': 0.36571505592569503, u'type': u'value', u'value': u'>'}], u'contact_number': [{u'confidence': 1, u'type': u'value', u'value': u'+917809899999'}, {u'confidence': 1, u'type': u'value', u'value': u'+917809899999'}]}

but by default the wit processes the first entity and not the entity with highest confidence. How can i integrate this logic. I am using run_actions() to process the text received from the user