luulinh90s's picture
add text2sql vis
68eb98f
raw
history blame
4.69 kB
<!DOCTYPE html>
<html>
<head>
<title>Experiment</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
font-family: 'Roboto', sans-serif;
}
.container {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
background-color: #ffffff;
}
.header {
padding: 10px;
background-color: #f0f0f0;
text-align: center;
}
h1 {
margin: 0;
font-size: 20px;
}
.task-description {
padding: 10px;
background-color: #e0e0e0;
text-align: center;
}
.highlight {
font-size: 1.1em;
font-weight: bold;
color: #0056b3;
background-color: #e6e6e6;
padding: 5px 10px;
border-radius: 4px;
display: inline-block;
margin-top: 5px;
}
.visualization-container {
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: none;
}
.buttons {
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f0f0f0;
}
button {
background-color: #808080;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #707070;
}
.bottom-question {
text-align: center;
padding: 10px;
background-color: #e0e0e0;
font-weight: bold;
font-size: 14px;
}
/* Loader styles */
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: none;
z-index: 1000;
}
.loader {
border: 5px solid #f3f3f3;
border-top: 5px solid #3498db;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 1s linear infinite;
position: fixed;
top: 50%;
left: 50%;
margin-top: -25px;
margin-left: -25px;
display: none;
z-index: 1001;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="header">
<h1>{{ sample_id + 1 }} / 10</h1>
</div>
<div class="task-description">
<p><strong>Task:</strong> {{ statement | safe }}</p>
<p class="highlight">Based on the explanation below, please guess if what the AI model will predict?</p>
</div>
<div class="visualization-container">
<iframe src="{{ visualization }}"></iframe>
</div>
<div class="bottom-question">
<h1>Guess what the model will predict on the Statement based on the provided explanation?</h1>
</div>
<div class="buttons">
<form action="{{ url_for('feedback') }}" method="post" onsubmit="showLoader()">
<input type="hidden" name="session_id" value="{{ session_id }}">
<button type="submit" name="prediction" value="TRUE"><h1>Model predicts: Supported</h1></button>
</form>
<form action="{{ url_for('feedback') }}" method="post" onsubmit="showLoader()">
<input type="hidden" name="session_id" value="{{ session_id }}">
<button type="submit" name="prediction" value="FALSE"><h1>Model predicts: Not supported</h1></button>
</form>
</div>
</div>
<!-- Loader and overlay -->
<div class="overlay" id="overlay"></div>
<div class="loader" id="loader"></div>
<script>
function showLoader() {
document.getElementById('overlay').style.display = 'block';
document.getElementById('loader').style.display = 'block';
}
</script>
</body>
</html>