-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix tests movie model, the lime output is now slightly different as well
- Loading branch information
Showing
2 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,11 @@ def test_lime_text(self): | |
def test_lime_text_special_chars(self): | ||
"""Tests exact expected output given a text with special characters and model for Lime.""" | ||
review = 'such a bad movie "!?\'"' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
loostrum
Author
Member
|
||
expected_words = ['bad', '?', '!', 'movie', 'such', 'a', "'", '"', '"'] | ||
expected_word_indices = [2, 6, 5, 3, 0, 1, 7, 4, 8] | ||
expected_words = ['bad', 'movie', '?', 'such', '!', "'", '"', 'a', '"'] | ||
expected_word_indices = [2, 3, 6, 0, 5, 7, 8, 1, 4] | ||
expected_scores = [ | ||
0.50032869, 0.06458735, -0.05793979, 0.01413776, -0.01246357, | ||
-0.00528022, 0.00305347, 0.00185159, -0.00165128 | ||
0.51140699, 0.02827488, 0.02657974, -0.02208464, -0.02140743, | ||
0.00962419, 0.00746798, -0.00743376, -0.0012061 | ||
] | ||
|
||
explanation = dianna.explain_text(self.runner, | ||
|
@@ -44,7 +44,7 @@ def test_lime_text_special_chars(self): | |
labels=[0], | ||
method='LIME', | ||
random_state=42)[0] | ||
|
||
print(explanation) | ||
assert_explanation_satisfies_expectations(explanation, expected_scores, | ||
expected_word_indices, | ||
expected_words) | ||
|
This file contains 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
Do we have a test somewhere with a "full stop"? I know the logic is the same as a "!" and "?", just wondering if we need a test with a full stop. Or are the examples in our tutorials enough?