flaskapp / templates /home.html
kumar9's picture
Update templates/home.html
f3992a4
raw
history blame
No virus
1.78 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sentiment Classification</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1 class="text-center mb-3">Sentiment Classification</h1>
<form method="POST" class="row justify-content-center">
<div class="col-md-12">
<textarea name="user_input" class="form-control" rows="5" cols="30" placeholder="Enter your input here..." required></textarea>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
{% if user_input %}
<h2 class="mt-5 text-center">Sentiment Analysis Results:</h2>
<p class="mt-2 text-center">{{user_input}}</p>
<div class="col-md-12 text-center">
<table class="table ">
<thead>
<tr>
<th>Label</th>
<th>Score</th>
</tr>
</thead>
<tbody>
{% for items in response %}
{% for item in items %}
<tr>
<td class="text-capitalize">{{ item.label }}</td>
<td>{{ item.score }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</body>
</html>