You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on introducing Text Counterfactual Explanations for Language Model Classifier models to CounterfactualExplanations.jl. The method I'm focusing on is Relevance-based Infilling for Textual Counterfactuals (RELITC) Pyhton code, paper. In short, the method generates an explanation for a string (text) classified by an LM Classifier by computing feature attribution per token (score of how much each token contributed to classifying the text to its class), masking the tokens with the highest attribution scores, and filling in the masks using a fine-tuned Conditional Masked Language Model (CMLM).
To have a fully implemented version of RELITC I think we need to have the following (also somewhat tracked in this project):
I'm working on those features in a separate branch, with this PR: #413 where I'm still working in a Jupyter Notebook, but I'm planning to introduce the features to the CE.jl architecture.
The generate_counterfactual(x, target, data, M, generator) can be used in the following way:
x being the text(s) to explain
target being the target class for the CE
data being optional data if fine-tuning of the LM Classifier or CMLM
M being the LM Classifier to explain
and generator being the RELITC method
so the function signature should be usable in this case as well.
Following the CounterfactualExplanations.jl spirit, we can think of interoperability for other CE methods, such as MiCE, which is a predecessor for RELITC so it should be possible to reuse some of the code.
MiCE
The text was updated successfully, but these errors were encountered:
Hi all!
I'm working on introducing Text Counterfactual Explanations for Language Model Classifier models to CounterfactualExplanations.jl. The method I'm focusing on is Relevance-based Infilling for Textual Counterfactuals (RELITC) Pyhton code, paper. In short, the method generates an explanation for a string (text) classified by an LM Classifier by computing feature attribution per token (score of how much each token contributed to classifying the text to its class), masking the tokens with the highest attribution scores, and filling in the masks using a fine-tuned Conditional Masked Language Model (CMLM).
To have a fully implemented version of RELITC I think we need to have the following (also somewhat tracked in this project):
I'm working on those features in a separate branch, with this PR: #413 where I'm still working in a Jupyter Notebook, but I'm planning to introduce the features to the CE.jl architecture.
The
generate_counterfactual(x, target, data, M, generator)
can be used in the following way:x
being the text(s) to explaintarget
being the target class for the CEdata
being optional data if fine-tuning of the LM Classifier or CMLMM
being the LM Classifier to explaingenerator
being the RELITC methodso the function signature should be usable in this case as well.
Following the CounterfactualExplanations.jl spirit, we can think of interoperability for other CE methods, such as MiCE, which is a predecessor for RELITC so it should be possible to reuse some of the code.
The text was updated successfully, but these errors were encountered: