Spaces:
Running
Running
eljanmahammadli
commited on
Commit
•
9913704
1
Parent(s):
a1e484f
Update highlighter.py
Browse files- highlighter.py +1 -1
highlighter.py
CHANGED
@@ -6,7 +6,7 @@ from predictors import predict_proba_quillbot
|
|
6 |
def explainer(text):
|
7 |
class_names = ['negative', 'positive']
|
8 |
explainer = LimeTextExplainer(class_names=class_names, split_expression=sent_tokenize)
|
9 |
-
exp = explainer.explain_instance(text,
|
10 |
sentences = [sent for sent in sent_tokenize(text)]
|
11 |
weights_mapping = exp.as_map()[1]
|
12 |
sentences_weights = {sentence: 0 for sentence in sentences}
|
|
|
6 |
def explainer(text):
|
7 |
class_names = ['negative', 'positive']
|
8 |
explainer = LimeTextExplainer(class_names=class_names, split_expression=sent_tokenize)
|
9 |
+
exp = explainer.explain_instance(text, predict_proba_quillbot, num_features=20, num_samples=300)
|
10 |
sentences = [sent for sent in sent_tokenize(text)]
|
11 |
weights_mapping = exp.as_map()[1]
|
12 |
sentences_weights = {sentence: 0 for sentence in sentences}
|