-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrender_pair_comparison.py
More file actions
executable file
·40 lines (34 loc) · 986 Bytes
/
render_pair_comparison.py
File metadata and controls
executable file
·40 lines (34 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
"""Generate forms for human evaluation."""
from jinja2 import FileSystemLoader, Environment
def main():
"""Main function."""
loader = FileSystemLoader(searchpath="./templates")
env = Environment(loader=loader)
template = env.get_template("pair_comparison.html.jinja2")
html = template.render(
page_title="語者判別實驗表單 1",
form_url="http://localhost:8888",
form_id=1,
questions=[
{
"title": "問題 1",
"audio_paths": [
"wavs/test1.wav",
"wavs/test2.wav"
],
"name": "q1"
},
{
"title": "問題 2",
"audio_paths": [
"wavs/test3.wav",
"wavs/test4.wav"
],
"name": "q2"
},
]
)
print(html)
if __name__ == "__main__":
main()