File size: 1,776 Bytes
09b9b64
 
 
 
 
 
 
 
 
 
 
 
 
 
454c8f4
4d5ed04
09b9b64
4d5ed04
09b9b64
 
 
 
48f3284
888ecec
48f3284
f3992a4
888ecec
 
48f3284
 
 
 
 
 
 
888ecec
 
 
 
 
 
 
48f3284
 
 
888ecec
48f3284
 
09b9b64
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!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>