File size: 8,278 Bytes
fa53be0 9d43e30 fa53be0 9d43e30 fa53be0 9d43e30 fa53be0 9d43e30 fa53be0 69d37ef eb2147a 69d37ef eb2147a 69d37ef 66eae26 69d37ef d421cc0 72d281f 69d37ef d421cc0 69d37ef 06388b5 72d281f 06388b5 d421cc0 72d281f 69d37ef d421cc0 72d281f 69d37ef 787f657 69d37ef 66eae26 d421cc0 69d37ef 86a95d5 fa53be0 9d43e30 fa53be0 86a95d5 fa53be0 4600a8b fa53be0 39d7f47 69d37ef d421cc0 66eae26 69d37ef fa53be0 69d37ef fa53be0 39d7f47 fa53be0 69d37ef fa53be0 787f657 4600a8b 6420f62 fa53be0 69d37ef e3a9e0f 69d37ef 39d7f47 69d37ef 4600a8b fa53be0 9d43e30 |
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
<!DOCTYPE html>
<html>
<head>
<title>Trustworthy LLMs for Table QA</title>
<style>
body {
font-family: 'Roboto', sans-serif;
background: url('/static/images/background.jpg') no-repeat center center fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
text-align: center;
background-color: #ffffff;
padding: 60px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 60%;
}
h1 {
color: #000000;
font-size: 48px;
margin-bottom: 30px;
}
label {
display: block;
margin: 20px 0 10px;
color: #000000;
font-size: 24px;
}
input[type="text"], input[type="number"] {
width: 80%;
padding: 15px;
margin-bottom: 20px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 18px;
}
.method-buttons {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
gap: 20px;
}
.method-button {
width: calc(45% - 10px);
padding: 15px;
font-size: 20px;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
border: 2px solid transparent;
font-weight: bold;
text-align: center;
}
.method-button.Chain-of-Table {
background-color: #ffcc80;
color: #1e90ff;
}
.method-button.Plan-of-SQLs {
background-color: #ffcc80;
color: #e65100;
}
.method-button.Text2SQL {
background-color: #ffcc80;
color: #7b1fa2;
}
.method-button.Dater {
background-color: #ffcc80;
color: #4caf50;
}
.method-button.No-XAI {
background-color: #ffcc80;
color: #ff9800;
}
.task-instruction {
background-color: #f0f8ff;
border-left: 5px solid #4CAF50;
padding: 20px;
margin-bottom: 30px;
border-radius: 5px;
text-align: left;
}
.task-instruction h2 {
color: #4CAF50;
margin-top: 0;
}
.task-step {
display: flex;
align-items: center;
margin-bottom: 15px;
}
.task-icon {
font-size: 24px;
margin-right: 15px;
color: #4CAF50;
}
.task-text {
font-size: 18px;
color: #333;
}
.method-button:hover {
opacity: 0.8;
}
.method-button.selected {
border-color: #000000;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
transform: scale(1.05);
animation: borderPulse 0.5s ease-in-out;
}
@keyframes borderPulse {
0% { border-color: transparent; }
50% { border-color: #000000; }
100% { border-color: #000000; }
}
button {
background-color: #4CAF50;
color: white;
padding: 15px 30px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 24px;
transition: background-color 0.3s ease;
margin-top: 20px;
}
button:hover {
background-color: #45a049;
}
.error-message {
color: red;
margin-bottom: 10px;
font-size: 18px;
}
</style>
<script>
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
function createMethodButtons() {
const methods = [
{ name: 'Chain-of-Table', color: '#1e90ff' },
{ name: 'Plan-of-SQLs', color: '#e65100' },
{ name: 'Text2SQL', color: '#7b1fa2' },
{ name: 'Dater', color: '#4caf50' },
{ name: 'No-XAI', color: '#ff9800' }
];
const shuffledMethods = shuffleArray(methods);
const container = document.querySelector('.method-buttons');
container.innerHTML = ''; // Clear existing buttons
shuffledMethods.forEach(method => {
if (method.name === 'No-XAI' && !{{ show_no_xai|tojson }}) {
return; // Skip No-XAI if not shown
}
const button = document.createElement('div');
button.className = `method-button ${method.name}`;
button.onclick = () => selectMethod(method.name);
button.textContent = method.name;
container.appendChild(button);
});
}
function selectMethod(method) {
document.getElementById('method').value = method;
var buttons = document.getElementsByClassName('method-button');
for (var i = 0; i < buttons.length; i++) {
buttons[i].classList.remove('selected');
}
var selectedButton = document.querySelector(`.method-button.${method}`);
if (selectedButton) {
selectedButton.classList.add('selected');
}
}
function validateForm() {
var username = document.getElementById('username').value;
var seed = document.getElementById('seed').value;
var method = document.getElementById('method').value;
if (!username || !seed || !method) {
alert("Please fill in all fields and select a method.");
return false;
}
return true;
}
// Call this function when the page loads
window.onload = function() {
createMethodButtons();
};
</script>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="task-instruction">
<h2>Let's Get Started! π</h2>
<div class="task-step">
<span class="task-icon">π€</span>
<span class="task-text">Enter your name</span>
</div>
<div class="task-step">
<span class="task-icon">π’</span>
<span class="task-text">Choose a lucky number</span>
</div>
<div class="task-step">
<span class="task-icon">π</span>
<span class="task-text">Select an explanation method</span>
</div>
<div class="task-step">
<span class="task-icon">π―</span>
<span class="task-text">Complete 10 samples in the experiment</span>
</div>
</div>
{% if error %}
<div class="error-message">
{{ error }}
</div>
{% endif %}
<form id="method-form" action="{{ url_for('index') }}" method="post" onsubmit="return validateForm();">
<label for="username">Hi there πππ ! What is your name?</label>
<input type="text" id="username" name="username" required>
<label for="seed">What is your lucky number? πππ </label>
<input type="number" id="seed" name="seed" required>
<input type="hidden" id="method" name="method" required>
<h2 style="color: #333; margin-top: 30px; margin-bottom: 20px;">Explanation Methods</h2>
<div class="method-buttons">
<!-- Method buttons will be dynamically inserted here -->
</div>
<button type="submit">Next</button>
</form>
</div>
</body>
</html> |