luulinh90s commited on
Commit
69d37ef
Β·
1 Parent(s): 9d43e30
Files changed (2) hide show
  1. templates/experiment.html +72 -8
  2. templates/index.html +76 -6
templates/experiment.html CHANGED
@@ -3,26 +3,90 @@
3
  <head>
4
  <title>Experiment</title>
5
  <style>
6
- /* ... (keep existing styles) ... */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  </style>
8
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
9
- <script>
10
- // ... (keep existing script) ...
11
- </script>
12
  </head>
13
  <body>
14
  <div class="container">
15
- <h1>{{ sample_id + 1 }} / 10</h1>
16
- <p><strong>Task description:</strong> {{ statement }}</p>
 
 
 
 
17
  <div class="visualization-container">
18
  <iframe src="{{ visualization }}"></iframe>
19
  </div>
20
  <div class="buttons">
21
- <form action="{{ url_for('feedback') }}" method="post" style="width: 48%;">
22
  <input type="hidden" name="username" value="{{ username }}">
23
  <button type="submit" name="prediction" value="TRUE">Predict TRUE</button>
24
  </form>
25
- <form action="{{ url_for('feedback') }}" method="post" style="width: 48%;">
26
  <input type="hidden" name="username" value="{{ username }}">
27
  <button type="submit" name="prediction" value="FALSE" class="reject">Predict FALSE</button>
28
  </form>
 
3
  <head>
4
  <title>Experiment</title>
5
  <style>
6
+ body, html {
7
+ margin: 0;
8
+ padding: 0;
9
+ height: 100%;
10
+ font-family: 'Roboto', sans-serif;
11
+ }
12
+ .container {
13
+ display: flex;
14
+ flex-direction: column;
15
+ height: 100vh;
16
+ width: 100vw;
17
+ background-color: #ffffff;
18
+ }
19
+ .header {
20
+ padding: 20px;
21
+ background-color: #f0f0f0;
22
+ text-align: center;
23
+ }
24
+ h1 {
25
+ margin: 0;
26
+ font-size: 24px;
27
+ }
28
+ .task-description {
29
+ padding: 10px 20px;
30
+ background-color: #e0e0e0;
31
+ text-align: center;
32
+ }
33
+ .visualization-container {
34
+ flex-grow: 1;
35
+ display: flex;
36
+ justify-content: center;
37
+ align-items: center;
38
+ overflow: hidden;
39
+ }
40
+ iframe {
41
+ width: 100%;
42
+ height: 100%;
43
+ border: none;
44
+ }
45
+ .buttons {
46
+ display: flex;
47
+ justify-content: space-around;
48
+ padding: 20px;
49
+ background-color: #f0f0f0;
50
+ }
51
+ button {
52
+ background-color: #4CAF50;
53
+ color: white;
54
+ padding: 15px 30px;
55
+ border: none;
56
+ border-radius: 5px;
57
+ cursor: pointer;
58
+ font-size: 18px;
59
+ transition: background-color 0.3s ease;
60
+ }
61
+ button:hover {
62
+ background-color: #45a049;
63
+ }
64
+ button.reject {
65
+ background-color: #f44336;
66
+ }
67
+ button.reject:hover {
68
+ background-color: #e53935;
69
+ }
70
  </style>
71
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
 
 
 
72
  </head>
73
  <body>
74
  <div class="container">
75
+ <div class="header">
76
+ <h1>{{ sample_id + 1 }} / 10</h1>
77
+ </div>
78
+ <div class="task-description">
79
+ <p><strong>Task description:</strong> {{ statement }}</p>
80
+ </div>
81
  <div class="visualization-container">
82
  <iframe src="{{ visualization }}"></iframe>
83
  </div>
84
  <div class="buttons">
85
+ <form action="{{ url_for('feedback') }}" method="post">
86
  <input type="hidden" name="username" value="{{ username }}">
87
  <button type="submit" name="prediction" value="TRUE">Predict TRUE</button>
88
  </form>
89
+ <form action="{{ url_for('feedback') }}" method="post">
90
  <input type="hidden" name="username" value="{{ username }}">
91
  <button type="submit" name="prediction" value="FALSE" class="reject">Predict FALSE</button>
92
  </form>
templates/index.html CHANGED
@@ -40,7 +40,48 @@
40
  border-radius: 5px;
41
  font-size: 18px;
42
  }
43
- button {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  background-color: #4CAF50;
45
  color: white;
46
  padding: 15px 30px;
@@ -51,32 +92,61 @@
51
  transition: background-color 0.3s ease;
52
  margin-top: 20px;
53
  }
54
- button:hover {
55
  background-color: #45a049;
56
  }
57
  </style>
58
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
59
  <script>
 
 
 
 
 
 
 
 
 
 
 
60
  function validateForm() {
61
  var username = document.getElementById('username').value;
62
  var seed = document.getElementById('seed').value;
63
- if (!username || !seed) {
64
- alert("Please fill in all fields.");
 
65
  return false;
66
  }
67
  return true;
68
  }
69
  </script>
 
70
  </head>
71
  <body>
72
  <div class="container">
73
  <h1>Trustworthy LLMs for Table QA</h1>
74
- <form id="start-form" action="/" method="post" onsubmit="return validateForm();">
75
  <label for="username">Hi there πŸ‘‹πŸ‘‹πŸ‘‹ ! What is your name?</label>
76
  <input type="text" id="username" name="username" required>
77
  <label for="seed">What is your lucky number? πŸ€πŸ€πŸ€ </label>
78
  <input type="number" id="seed" name="seed" required>
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  <button type="submit">Start Experiment</button>
81
  </form>
82
  </div>
 
40
  border-radius: 5px;
41
  font-size: 18px;
42
  }
43
+ .method-buttons {
44
+ display: flex;
45
+ flex-wrap: wrap;
46
+ justify-content: space-between;
47
+ margin-bottom: 20px;
48
+ gap: 20px;
49
+ }
50
+ .method-button {
51
+ width: calc(50% - 10px);
52
+ padding: 15px;
53
+ font-size: 20px;
54
+ border-radius: 10px;
55
+ cursor: pointer;
56
+ transition: background-color 0.3s ease, border 0.3s ease;
57
+ border: 2px solid transparent;
58
+ font-weight: bold;
59
+ text-align: center;
60
+ }
61
+ .method-button.cot {
62
+ background-color: #e0f0ff;
63
+ color: #1e90ff;
64
+ }
65
+ .method-button.pos {
66
+ background-color: #ffcc80;
67
+ color: #e65100;
68
+ }
69
+ .method-button.cot-ext {
70
+ background-color: #e8f5e9;
71
+ color: #4caf50;
72
+ }
73
+ .method-button.pos-ext {
74
+ background-color: #fff3e0;
75
+ color: #ff9800;
76
+ }
77
+ .method-button:hover {
78
+ opacity: 0.8;
79
+ }
80
+ .method-button.selected {
81
+ border-color: #000000;
82
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
83
+ }
84
+ button[type="submit"] {
85
  background-color: #4CAF50;
86
  color: white;
87
  padding: 15px 30px;
 
92
  transition: background-color 0.3s ease;
93
  margin-top: 20px;
94
  }
95
+ button[type="submit"]:hover {
96
  background-color: #45a049;
97
  }
98
  </style>
 
99
  <script>
100
+ function selectMethod(method) {
101
+ document.getElementById('method').value = method;
102
+
103
+ var buttons = document.getElementsByClassName('method-button');
104
+ for (var i = 0; i < buttons.length; i++) {
105
+ buttons[i].classList.remove('selected');
106
+ }
107
+
108
+ document.querySelector(`.${method.toLowerCase().replace('-', '-')}`).classList.add('selected');
109
+ }
110
+
111
  function validateForm() {
112
  var username = document.getElementById('username').value;
113
  var seed = document.getElementById('seed').value;
114
+ var method = document.getElementById('method').value;
115
+ if (!username || !seed || !method) {
116
+ alert("Please fill in all fields and select a method.");
117
  return false;
118
  }
119
  return true;
120
  }
121
  </script>
122
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
123
  </head>
124
  <body>
125
  <div class="container">
126
  <h1>Trustworthy LLMs for Table QA</h1>
127
+ <form id="method-form" action="/" method="post" onsubmit="return validateForm();">
128
  <label for="username">Hi there πŸ‘‹πŸ‘‹πŸ‘‹ ! What is your name?</label>
129
  <input type="text" id="username" name="username" required>
130
  <label for="seed">What is your lucky number? πŸ€πŸ€πŸ€ </label>
131
  <input type="number" id="seed" name="seed" required>
132
 
133
+ <input type="hidden" id="method" name="method" required>
134
+
135
+ <div class="method-buttons">
136
+ <div class="method-button cot" onclick="selectMethod('Chain-of-Table')">
137
+ Chain-of-Table
138
+ </div>
139
+ <div class="method-button pos" onclick="selectMethod('Plan-of-SQLs')">
140
+ Plan-of-SQLs
141
+ </div>
142
+ <div class="method-button cot-ext" onclick="selectMethod('Chain-of-Table-Ext')">
143
+ Chain-of-Table-Ext
144
+ </div>
145
+ <div class="method-button pos-ext" onclick="selectMethod('Plan-of-SQLs-Ext')">
146
+ Plan-of-SQLs-Ext
147
+ </div>
148
+ </div>
149
+
150
  <button type="submit">Start Experiment</button>
151
  </form>
152
  </div>