Xrenya commited on
Commit
267b4f9
·
1 Parent(s): cfed90e

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -193,9 +193,9 @@ def plot_weights(file_obj):
193
  def interpretation_function(file_obj):
194
  text = read_file(file_obj)
195
  clean_text = text_preprocessing(text)
196
- clean_text = tokenizer.decode(tokenizer(clean_text)["input_ids"][:512])[6:]
197
  explainer = shap.Explainer(document_classifier)
198
- shap_values = explainer([clean_text[:-10]])
199
 
200
  # Dimensions are (batch size, text size, number of classes)
201
  # Since we care about positive sentiment, use index 1
 
193
  def interpretation_function(file_obj):
194
  text = read_file(file_obj)
195
  clean_text = text_preprocessing(text)
196
+ clean_text = tokenizer.decode(tokenizer(clean_text)["input_ids"][6:512])
197
  explainer = shap.Explainer(document_classifier)
198
+ shap_values = explainer([clean_text[:-20]])
199
 
200
  # Dimensions are (batch size, text size, number of classes)
201
  # Since we care about positive sentiment, use index 1