Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- main/utils.py +2 -2
main/utils.py
CHANGED
|
@@ -15,7 +15,7 @@ except:
|
|
| 15 |
raise FileNotFoundError("Failed to load file having model metadata")
|
| 16 |
|
| 17 |
# Intialize lime explainer with class names
|
| 18 |
-
_global_explainer = LimeTextExplainer(class_names=["hate", "non-hate"])
|
| 19 |
|
| 20 |
class LimeExplainer:
|
| 21 |
def __init__(self):
|
|
@@ -53,7 +53,7 @@ class LimeExplainer:
|
|
| 53 |
tweet,
|
| 54 |
self._get_prediction_explaination,
|
| 55 |
num_features=5,
|
| 56 |
-
num_samples=
|
| 57 |
)
|
| 58 |
return round_dict_values(dic = dict(explanation.as_list()))
|
| 59 |
|
|
|
|
| 15 |
raise FileNotFoundError("Failed to load file having model metadata")
|
| 16 |
|
| 17 |
# Intialize lime explainer with class names
|
| 18 |
+
_global_explainer = LimeTextExplainer(class_names=["hate", "non-hate"], bow=False)
|
| 19 |
|
| 20 |
class LimeExplainer:
|
| 21 |
def __init__(self):
|
|
|
|
| 53 |
tweet,
|
| 54 |
self._get_prediction_explaination,
|
| 55 |
num_features=5,
|
| 56 |
+
num_samples=20
|
| 57 |
)
|
| 58 |
return round_dict_values(dic = dict(explanation.as_list()))
|
| 59 |
|