-
Notifications
You must be signed in to change notification settings - Fork 479
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
Add option to return HMTL object from visualize_text() #548
Conversation
Hi @cdpierse! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thanks @cdpierse for putting this together! @miguelmartin75 and @vivekmig: do you prefer we add return_html as a parameter? Or to always return the HTML content instead? (the routine currently does not return any value(. |
re @bilalsal I don't see any reason for why we couldn't always return HTML, since this method doesn't return anything and the HTML content is always being constructed. |
Feel free to return HTML. To avoid additional input argument, we can always return HTML and the user can chose to use it or not. |
I've updated the PR so that HTML is now just always returned by default. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bilalsal has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Related issue: #544 Adds flag `return_html`to `visualize_text()` that allows for the IPython HTML to be returned if the flag is set to `True`. This is useful for cases where users may want to save the output from outside of a notebook etc. Usage looks like: ```python from captum.attr import visualization as viz .... # get attributions and data record html_obj = viz.visualize_text([score_viz]) ``` Pull Request resolved: #548 Reviewed By: vivekmig Differential Revision: D25424019 Pulled By: bilalsal fbshipit-source-id: 27a90f2775d90cbc848858fe1b439ddc2855cba4
Related issue: #544
Adds flag
return_html
tovisualize_text()
that allows for the IPython HTML to be returned if the flag is set toTrue
.This is useful for cases where users may want to save the output from outside of a notebook etc.
Usage looks like: