Martijn van Beers
commited on
Commit
•
9c33733
1
Parent(s):
97c0e0a
Fix copied visualize_text
Browse filesformat_classname is from captum.visualization too, so since we call it
outside captum, we need to add the namespace to the call
app.py
CHANGED
@@ -104,14 +104,14 @@ def visualize_text(datarecords, legend=True):
|
|
104 |
"".join(
|
105 |
[
|
106 |
"<tr>",
|
107 |
-
format_classname(datarecord.true_class),
|
108 |
-
format_classname(
|
109 |
"{0} ({1:.2f})".format(
|
110 |
datarecord.pred_class, datarecord.pred_prob
|
111 |
)
|
112 |
),
|
113 |
-
format_classname(datarecord.attr_class),
|
114 |
-
format_classname("{0:.2f}".format(datarecord.attr_score)),
|
115 |
format_word_importances(
|
116 |
datarecord.raw_input_ids, datarecord.word_attributions
|
117 |
),
|
|
|
104 |
"".join(
|
105 |
[
|
106 |
"<tr>",
|
107 |
+
visualization.format_classname(datarecord.true_class),
|
108 |
+
visualization.format_classname(
|
109 |
"{0} ({1:.2f})".format(
|
110 |
datarecord.pred_class, datarecord.pred_prob
|
111 |
)
|
112 |
),
|
113 |
+
visualization.format_classname(datarecord.attr_class),
|
114 |
+
visualization.format_classname("{0:.2f}".format(datarecord.attr_score)),
|
115 |
format_word_importances(
|
116 |
datarecord.raw_input_ids, datarecord.word_attributions
|
117 |
),
|