Spaces:
Sleeping
Sleeping
| html_code = """ | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Sentiment Analysis</title> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <div class="container mt-5"> | |
| <h2 class="text-center">Sentiment Analysis</h2> | |
| <form method="POST" class="mt-4"> | |
| <div class="mb-3"> | |
| <label for="text" class="form-label">Enter Text:</label> | |
| <textarea class="form-control" id="text" name="text" rows="3"></textarea> | |
| </div> | |
| <button type="submit" class="btn btn-primary">Analyze</button> | |
| </form> | |
| {% if sentiment %} | |
| <div class="alert alert-info mt-3"> | |
| Sentiment: <strong>{{ sentiment }}</strong> | |
| </div> | |
| {% endif %} | |
| </div> | |
| </body> | |
| </html>""" | |
| with open("templates/index.html", "w") as file: | |
| file.write(html_code) |