| <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> | |