Skip to content

Commit

Permalink
Add space between systems
Browse files Browse the repository at this point in the history
  • Loading branch information
thequilo committed May 15, 2024
1 parent 2f7ab4d commit 785a74c
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions meeteval/viz/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,32 @@ def get_wer(v):
pass
doc.asis('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.2/css/theme.default.min.css">')
with tag('style'):
doc.asis('''
n = len(alignments.split(','))
doc.asis(f'''
/* Center table */
body {
body {{
width: fit-content;
margin: 0 auto;
}
}}
/* Make numbers monospace and right-aligned (aligns the decimal point) */
.number {
.number {{
font-family: monospace;
text-align: right;
}
td {
}}
td {{
text-align: right;
}
td:nth-child(1) {
}}
td:nth-child(1) {{
text-align: left;
}
}}
tbody tr:nth-child(odd) td {{
background-color: #f2f2f2;
}}
tbody td:nth-child({n}n+2),
thead tr:nth-child(2) th:nth-child({n}n+2),
thead tr:nth-child(1) th{{
padding-left: 3em;
}}
''')
with tag('body'):
with tag('table', klass='tablesorter', id='myTable', style='width: auto;'):
Expand All @@ -144,7 +153,8 @@ def get_wer(v):

for (k, alignment), v in avs.items():
with tag('th'):
doc.text(f'{alignment}WER: ')
doc.asis(f'{alignment}WER<br>')

with tag('span', klass='number'):
doc.text(get_wer(v))

Expand Down

0 comments on commit 785a74c

Please sign in to comment.