Commit
·
ab0c546
1
Parent(s):
556df27
Update app.py
Browse files
app.py
CHANGED
@@ -25,5 +25,7 @@ if text:
|
|
25 |
attributions = cls_explainer(text)
|
26 |
df = pd.DataFrame(attributions[1:-1])
|
27 |
df.rename(columns = {0: 'Token', 1: 'Contribution'}, inplace = True)
|
28 |
-
st.write(
|
29 |
-
st.write(
|
|
|
|
|
|
25 |
attributions = cls_explainer(text)
|
26 |
df = pd.DataFrame(attributions[1:-1])
|
27 |
df.rename(columns = {0: 'Token', 1: 'Contribution'}, inplace = True)
|
28 |
+
st.sidebar.write('This table shows how each word contributes to the model\'s judgment. Positive scores indicate that the word contributed toward the judgment while negative scores show how much the word pushed the model in the other direction.')
|
29 |
+
st.sidebar.write(df.style.hide(axis = 'index'))
|
30 |
+
st.write(cls_explainer.visualize())
|
31 |
+
st.write('Note that the model is trained on a dataset of ethical judgments that are meant to represent the intuitive judgments of Americans and as such might conflict with what you believe, the judgments of people in other cultures, or what might in fact be right.')
|