CODAIT / text-extensions-for-pandas

Natural language processing support for Pandas dataframes.
Apache License 2.0
217 stars 34 forks source link

Add code to convert NLU entity mentions information to a DataFrame #146

Closed frreiss closed 3 years ago

frreiss commented 3 years ago

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, 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().

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB