AlexanderHolmes0 commited on
Commit
53193a8
·
verified ·
1 Parent(s): 48b58ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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"]}, t
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")