Bikas0's picture
ui update
cbd2d9b verified
raw
history blame
No virus
4.28 kB
<!DOCTYPE html>
<html>
<head>
<title>BERT Predictions</title>
<style>
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
margin: 0;
display: flex;
flex-direction: column;
min-height: 100vh;
position: relative;
}
h2 {
color: #333;
}
.content-wrapper {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.input-container {
max-width: 600px;
width: 100%;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: left;
}
textarea {
width: 100%;
padding: 10px;
font-size: 16px;
margin-bottom: 10px;
}
input[type="submit"] {
padding: 10px 20px;
font-size: 16px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
display: block;
margin: 0 auto;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #d62728;
}
.predictions {
text-align: center;
margin-top: 20px;
}
.prediction-item {
margin-bottom: 10px;
padding-left: 20px;
font-size: 18px;
display: inline-block;
text-align: left;
}
.icon {
font-size: 20px;
margin-right: 10px;
vertical-align: middle;
}
.category-price {
color: #1f77b4;
}
.category-packaging {
color: #ff7f0e;
}
.category-product {
color: #2ca02c;
}
.category-rider {
color: #d62728;
}
.category-delivery {
color: #9467bd;
}
.category-shelf {
color: #8c564b;
}
.category-service {
color: #e377c2;
}
.category-seller {
color: #7f7f7f;
}
.logo {
position: absolute;
top: 20px;
right: 20px;
width: 150px;
height: 80px;
}
footer {
width: 100%;
background-color: #ccc;
padding: 10px 0;
text-align: center;
color: #666;
position: relative;
}
</style>
<script>
function validateForm() {
var text = document.forms["predictForm"]["text"].value.trim();
if (text == "") {
alert("Please enter some text");
return false;
}
return true;
}
function clearPredictions() {
var predictionsDiv = document.querySelector('.predictions');
if (predictionsDiv) {
predictionsDiv.innerHTML = '';
}
}
</script>
</head>
<body>
<div class="content-wrapper">
<img src="static/static_logo.png" alt="Company Logo" class="logo">
<div class="input-container">
<h2>Enter Text to Predict Multi-Label Classification</h2>
<form name="predictForm" method="post" onsubmit="clearPredictions(); return validateForm()">
<textarea name="text" rows="4" cols="50">{{ text }}</textarea><br><br>
<input type="submit" value="Predict">
</form>
</div>
{% if predictions %}
<div class="predictions">
<h3>Predicted Labels:</h3>
{% for prediction in predictions %}
<div class="prediction-item category-{{ prediction }}">
<span class="icon"></span>{{ prediction }}
</div>
{% endfor %}
</div>
{% endif %}
</div>
<footer>
<p>&copy; 2024 Bikasuzzaman. Machine Learning Engineer.</p>
</footer>
</body>
</html>