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

Convert entity values from Duckling to strings for testing #6042

Merged
merged 4 commits into from
Jun 22, 2020

Conversation

tabergma
Copy link
Contributor

Proposed changes:
In our tests all entity values are of type string. However, values from duckling can be of any type. In order to correctly compare predicted and target entities, we need to convert the entity values from duckling to strings during our evaluation.

related to #5977

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

Thanks 🚀

Comment on lines 234 to 241
if (
k == ENTITY_ATTRIBUTE_VALUE
and EXTRACTOR in set(r)
and r[EXTRACTOR] == "DucklingHTTPExtractor"
):
# convert values from duckling to strings for evaluation as
# target values are all of type string
r[k] = str(r[k])
Copy link
Contributor

@erohmensing erohmensing Jun 22, 2020

Choose a reason for hiding this comment

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

Re the conversation we had in slack, i'm not sure if it makes more sense to change it for all extractors (e.g. if someone created a custom RegexExtractor that pulled a number in int instead of str) if the target values are always strings

@tabergma tabergma merged commit de8e585 into master Jun 22, 2020
@tabergma tabergma deleted the e2e-testing branch June 22, 2020 13:49
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.

2 participants