Sample / templates /index.html
Swathi6's picture
Create templates/index.html
9c1519d verified
raw
history blame contribute delete
826 Bytes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Classification with Hugging Face</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="container">
<h1>Hugging Face Text Classification</h1>
<form action="/predict" method="POST">
<textarea name="text" rows="4" cols="50" placeholder="Enter your text here...">{{ text }}</textarea>
<br>
<input type="submit" value="Classify">
</form>
{% if prediction %}
<h2>Prediction:</h2>
<p>{{ prediction[0]['label'] }} (confidence: {{ prediction[0]['score'] }})</p>
{% endif %}
</div>
</body>
</html>