Skip to content
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

Error in Explanation of a pytorch NLP model #389

Closed
andreybavt opened this issue Dec 5, 2022 · 0 comments
Closed

Error in Explanation of a pytorch NLP model #389

andreybavt opened this issue Dec 5, 2022 · 0 comments
Assignees
Labels
p:normal Normal priority yt Issues migrated from YouTrack

Comments

@andreybavt
Copy link
Contributor

GSK-393

I'm currently getting the following error when attempting to explain a NLP model:

Traceback (most recent call last):
  File "/Users/rak/Documents/giskard/python-client/giskard/ml_worker/core/model_explanation.py", line 67, in explain_text
    text_explainer.fit(text_document, prediction_function)
  File "/Users/rak/Documents/giskard/python-client/.venv/lib/python3.7/site-packages/eli5/lime/lime.py", line 265, in fit
    random_state=self.rng_
  File "/Users/rak/Documents/giskard/python-client/.venv/lib/python3.7/site-packages/eli5/lime/lime.py", line 367, in _train_local_classifier
    random_state=rng)
  File "/Users/rak/Documents/giskard/python-client/.venv/lib/python3.7/site-packages/eli5/lime/utils.py", line 32, in fit_proba
    random_state=random_state,
  File "/Users/rak/Documents/giskard/python-client/.venv/lib/python3.7/site-packages/eli5/lime/utils.py", line 111, in expanded_X_y_sample_weights
    sample_weight
  File "/Users/rak/Documents/giskard/python-client/.venv/lib/python3.7/site-packages/eli5/lime/utils.py", line 145, in expand_dataset
    for label in rng.choice(classes, size=factor, p=probs):
  File "mtrand.pyx", line 937, in numpy.random.mtrand.RandomState.choice
ValueError: probabilities are not non-negative

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rak/Documents/giskard/python-client/giskard/ml_worker/utils/error_interceptor.py", line 43, in wrapper
    res = behavior(request, context)
  File "/Users/rak/Documents/giskard/python-client/giskard/ml_worker/server/ml_worker_service.py", line 182, in explainText
    html_response = explain_text(model, input_df, text_column, text_document, n_samples)._repr_html_()
  File "/Users/rak/Documents/giskard/python-client/giskard/ml_worker/utils/logging.py", line 74, in wrap
    result = fn(*args, **kw)
  File "/Users/rak/Documents/giskard/python-client/giskard/ml_worker/core/model_explanation.py", line 71, in explain_text
    raise Exception("Failed to create text explanation") from e
Exception: Failed to create text explanation

Project: Giskard
Reporter: rabah
Created: 2022-11-30

@andreybavt andreybavt added yt_assignee:rabah abdul khalek yt Issues migrated from YouTrack p:normal Normal priority labels Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:normal Normal priority yt Issues migrated from YouTrack
Development

No branches or pull requests

2 participants