-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Multiple Sentence Inputs #24
Comments
Oh, this is interesting - you have both text AND continuous features.
Then, if you wanted to explain a particular instance, you would have to do something like this:
You may have to be a bit creative if you want to use the visualizations we have, since the text displayed will have both sentences. Also, you have to think if it makes sense to use bow=True or False in this case. If you're doing anything with sequences, I would say False makes more sense. If you want to explain the impact of the words and the numerical features, you'll have to write a function that perturbs both at the same time. If this is the case, you would want to do a mix of __data_labels_distances in lime_text.py and __data_inverse in lime_tabular.py. Both are viable ideas, the second one is definitely a bit more work. Best, |
Thank you so so much! Your explanations are super helpful. For now, I'm particularly interested in the text components so will focus on that. I will definitely drop you a mail :) |
Hi, in code "explainer.explain_instance(text, fn, labels=(0,))", the default value is "labels=(1,)" and explanation in your original code is "labels: iterable with labels to be explained." I wonder what this variable exactly stands for? Thanks. |
This parameter is there for multi-class classification problems, and it defines for which classes (or labels) we want to generate explanations for. The default is 1 because usually what we have is two-class classification, where we only care about explaining label 1 (since the explanation for label 0 is the opposite). |
Thanks so much for your quick response. BTW, is there a chance to only explain several particular features? Which parameter should I set? |
Do you mean restrict the explanation to a particular set of features? If so, there is no parameter for that. |
Hi! I am conducting the same task as yours. But I find the final score of every token is similar. I think it's incorrect. Could you please tell me how you complete it? |
can someone give an example |
@marcotcr can you give an example for
|
apparently without using |
My model takes 2 sentences as input, as well as a number of continuous values.
The sentences are converted into 2 sentence vectors, operations are applied to them, and then are passed on to the next model along with the continuous values. This model then predicts semantic similarity (softmax) based on cosine distance between sentence vectors and the extra continuous valued features.
I would like to see if I can adapt parts of the
LimeTextExplainer
in order to explain which parts of each sentence result in high semantic similarity.Do you have any suggestions on where I should begin? Is it a viable idea? Any help would be appreciated
The text was updated successfully, but these errors were encountered: