I've added code to nlu.py to unroll the nested information that NLU returns about entity mentions into a DataFrame with one row per entity mention. After my modifications, the parse_response() method returns a dictionary with an additional key "entity_mentions" that points to the new DataFrame. If the user didn't tell NLU to extract entity mentions, this DataFrame will be empty but will still be present.
I added some new tests to cover the new functionality. I also updated the main NLU-related notebook with some Markdown to explain what's stored under the "entity_mentions" key in the return value of parse_response().
This PR implements the feature described in #54.
I've added code to
nlu.py
to unroll the nested information that NLU returns about entity mentions into a DataFrame with one row per entity mention. After my modifications, theparse_response()
method returns a dictionary with an additional key "entity_mentions" that points to the new DataFrame. If the user didn't tell NLU to extract entity mentions, this DataFrame will be empty but will still be present.I added some new tests to cover the new functionality. I also updated the main NLU-related notebook with some Markdown to explain what's stored under the "entity_mentions" key in the return value of
parse_response()
.