Implement TextImputer with Flexible Players, Perturbations and Target Callables#557
Open
samoger wants to merge 72 commits into
Open
Implement TextImputer with Flexible Players, Perturbations and Target Callables#557samoger wants to merge 72 commits into
samoger wants to merge 72 commits into
Conversation
Feature feng
Text imputer draft clean
Modification all
Author
|
Hi, we have now addressed all of the review comments and pushed the corresponding changes to the PR. We also replied to each comment individually to briefly explain the changes we made. The PR should now be ready for another review. Thank you. |
Fix optional TextImputer import and CI lint
Author
|
Hi, We have fixed the CI issue from the previous run, so the import errors should now be resolved and the CI tests can be run again. Thank you! |
|
Hi! The NLTK WordNet issue has been fixed. The CI tests should pass now, so could you please rerun them? Thanks! |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Final fix
Author
|
Hi, we have fixed the issues from the previous CI test. Could you please run the tests again? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR implements a generalized TextImputer that integrates naturally into the existing shapiq imputation pipeline and enables coalition-based explanations for a broad range of NLP models through a modular architecture.
The implementation is built around three independent components:
In addition, the implementation includes batched coalition evaluation for efficient model inference and integrates directly with HuggingFace transformers.
Compared with a model-specific implementation, this design cleanly separates player definitions, perturbation methods, and model architectures, making the TextImputer extensible to future NLP models and perturbation strategies while remaining compatible with the existing shapiq workflow.
Public API Changes
TextImputer follows the same interface as other shapiq imputers: it is initialized once with a model and an input text, then evaluated by passing coalition matrices directly (imputer(coalitions)).
Constructor
##Supported player definitions
##Supported perturbation strategies
##Supported model interfaces
##Optional configuration
How Has This Been Tested?
Implemented three dedicated test suites covering the TextImputer components:
test_text_imputer.pytest_text_imputer_seq2seq.pytest_text_imputer_attention.pyChecklist
CHANGELOG.md(if relevant for users).