Spaces:
Running
Running
Use green instead of blue for suggested locations
Browse files
app.py
CHANGED
@@ -130,7 +130,7 @@ def highlight_edits():
|
|
130 |
show = span['token'] != span['most_likely_token'] and span['loss_ratio'] >= min_loss
|
131 |
hover = f'<span style="position: absolute; top: -10px; left: 5px; font-size: 10px; min-width:6em; line-height: 1; color: grey; transform-origin: left; transform: rotate(-15deg)">{span["most_likely_token"]}</span>'
|
132 |
html_out += '<span style="position: relative; color: {color}" title="{title}">{hover}{orig_token}</span>'.format(
|
133 |
-
color="
|
134 |
title=html.escape(span["most_likely_token"]).replace('\n', ' ') if show else '',
|
135 |
orig_token=html.escape(span["token"]).replace('\n', '<br>'),
|
136 |
hover=hover if show else ''
|
|
|
130 |
show = span['token'] != span['most_likely_token'] and span['loss_ratio'] >= min_loss
|
131 |
hover = f'<span style="position: absolute; top: -10px; left: 5px; font-size: 10px; min-width:6em; line-height: 1; color: grey; transform-origin: left; transform: rotate(-15deg)">{span["most_likely_token"]}</span>'
|
132 |
html_out += '<span style="position: relative; color: {color}" title="{title}">{hover}{orig_token}</span>'.format(
|
133 |
+
color="green" if show else "black",
|
134 |
title=html.escape(span["most_likely_token"]).replace('\n', ' ') if show else '',
|
135 |
orig_token=html.escape(span["token"]).replace('\n', '<br>'),
|
136 |
hover=hover if show else ''
|