AlexanderHolmes0
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -37,10 +37,10 @@ def classify_text_1(text):
|
|
37 |
# Text Classification Demo 2
|
38 |
def classify_text_2(text):
|
39 |
res = text_2(text)[0]
|
40 |
-
shap_values = explainer_long([text])
|
41 |
-
t = shap.plots.text(shap_values[:, :, "fake"], display=False)
|
42 |
-
t2 = shap.plots.text(shap_values[:, :, "true"], display=False)
|
43 |
-
return {res[0]["label"]: res[0]["score"], res[1]["label"]: res[1]["score"]}
|
44 |
|
45 |
|
46 |
label = gr.Label(label="Label")
|
|
|
37 |
# Text Classification Demo 2
|
38 |
def classify_text_2(text):
|
39 |
res = text_2(text)[0]
|
40 |
+
#shap_values = explainer_long([text])
|
41 |
+
#t = shap.plots.text(shap_values[:, :, "fake"], display=False)
|
42 |
+
#t2 = shap.plots.text(shap_values[:, :, "true"], display=False)
|
43 |
+
return {res[0]["label"]: res[0]["score"], res[1]["label"]: res[1]["score"]}#, t
|
44 |
|
45 |
|
46 |
label = gr.Label(label="Label")
|