| <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/[email protected]/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-4"> | |
| <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> | |
| <h3 class="mt-5 text-center">{{user_input}}</h3> | |
| <table class="table table-bordered"> | |
| <thead> | |
| <tr> | |
| <th>Label</th> | |
| <th>Score</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for item in response %} | |
| <tr> | |
| <td class="text-capitalize">{{ item.label }}</td> | |
| <td>{{ item.score }}</td> | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| {% endif %} | |
| </div> | |
| </body> | |
| </html> | |