cognitive-catalyst / WA-Testing-Tool

Scripts that run against Watson Assistant for K fold validation on training set, testing on blind test, and draw precision curves for comparison.
Apache License 2.0
78 stars 60 forks source link

Response returned by Watson Assistant isn't always type string #153

Closed pratyushsingh97 closed 4 years ago

pratyushsingh97 commented 4 years ago

TLDR;

Edge-case to handle weird instances when the response returned by the Assistant is not always a string

Issue

The ' '.join(respone_text_list) will fail if the items in the list are not type string. I encountered this edge case when running the notebook for the client, and they returned a blank dictionary, {}, to the user (see attached). This is an issue that needs to be fixed at the client site, but added this extra check for robustness.

image

DCO 1.1 Signed-off-by: Pratyush Singh pratyushsingh@ibm.com

andrewrfreed commented 4 years ago

Very useful fix and nice catch!