Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -193,6 +193,7 @@ def plot_weights(file_obj):
|
|
193 |
def interpretation_function(file_obj):
|
194 |
text = read_file(file_obj)
|
195 |
clean_text = text_preprocessing(text)
|
|
|
196 |
explainer = shap.Explainer(document_classifier)
|
197 |
shap_values = explainer([clean_text])
|
198 |
|
@@ -244,4 +245,4 @@ with gr.Blocks() as demo:
|
|
244 |
interpret_lime.click(as_pyplot_figure, file, plot)
|
245 |
|
246 |
if __name__ == "__main__":
|
247 |
-
demo.launch()
|
|
|
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])
|
199 |
|
|
|
245 |
interpret_lime.click(as_pyplot_figure, file, plot)
|
246 |
|
247 |
if __name__ == "__main__":
|
248 |
+
demo.launch(share=True)
|