Commit
•
021575f
1
Parent(s):
1e1bfc0
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ sample_text = [
|
|
28 |
]
|
29 |
|
30 |
description = """
|
31 |
-
British Library Books genre detection model
|
32 |
"""
|
33 |
|
34 |
tokenizer = AutoTokenizer.from_pretrained("BritishLibraryLabs/bl-books-genre")
|
@@ -44,7 +44,7 @@ def predict(text):
|
|
44 |
gr.Interface(predict,
|
45 |
inputs=gr.inputs.Textbox(label="Book title"),
|
46 |
outputs=gr.outputs.Label(label="Predicted genre"),
|
47 |
-
interpretation='shap',
|
48 |
examples=sample_text,description=description,
|
49 |
).launch(enable_queue=True)
|
50 |
|
|
|
28 |
]
|
29 |
|
30 |
description = """
|
31 |
+
British Library Books genre detection model. The interpretation interface helps what the model is using to make its predictions. Words highlighted in red contributed to the model being more confident about a prediction. The intensity of colour corresponds to the importance of that part of the input. The words that decrease the label confidence are highlighted in blue.
|
32 |
"""
|
33 |
|
34 |
tokenizer = AutoTokenizer.from_pretrained("BritishLibraryLabs/bl-books-genre")
|
|
|
44 |
gr.Interface(predict,
|
45 |
inputs=gr.inputs.Textbox(label="Book title"),
|
46 |
outputs=gr.outputs.Label(label="Predicted genre"),
|
47 |
+
interpretation='shap', num_shap=5,
|
48 |
examples=sample_text,description=description,
|
49 |
).launch(enable_queue=True)
|
50 |
|