File size: 4,277 Bytes
4c5156b
 
 
 
 
 
cbd2d9b
4c5156b
cbd2d9b
4c5156b
 
cbd2d9b
 
4c5156b
 
 
 
 
cbd2d9b
4c5156b
 
 
cbd2d9b
4c5156b
 
 
cbd2d9b
4c5156b
 
 
 
cbd2d9b
4c5156b
 
 
 
 
 
 
 
 
 
cbd2d9b
4c5156b
 
 
cbd2d9b
 
 
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
 
 
 
 
cbd2d9b
 
4c5156b
 
 
 
 
 
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
cbd2d9b
4c5156b
 
 
 
 
cbd2d9b
 
4c5156b
 
 
cbd2d9b
 
4c5156b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cbd2d9b
4c5156b
 
 
 
 
 
 
 
 
 
cbd2d9b
4c5156b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cbd2d9b
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html>
<head>
    <title>BERT Predictions</title>
    <style>
        body {
            background-color: #f0f0f0;
            font-family: Arial, sans-serif;
            margin: 0;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            position: relative;
        }
        h2 {
            color: #333;
        }
        .content-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .input-container {
            max-width: 600px;
            width: 100%;
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            text-align: left;
        }
        textarea {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            margin-bottom: 10px;
        }
        input[type="submit"] {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
            display: block;
            margin: 0 auto;
            transition: background-color 0.3s ease;
        }
        input[type="submit"]:hover {
            background-color: #d62728;
        }
        .predictions {
            text-align: center;
            margin-top: 20px;
        }
        .prediction-item {
            margin-bottom: 10px;
            padding-left: 20px;
            font-size: 18px;
            display: inline-block;
            text-align: left;
        }
        .icon {
            font-size: 20px;
            margin-right: 10px;
            vertical-align: middle;
        }
        .category-price {
            color: #1f77b4;
        }
        .category-packaging {
            color: #ff7f0e;
        }
        .category-product {
            color: #2ca02c;
        }
        .category-rider {
            color: #d62728;
        }
        .category-delivery {
            color: #9467bd;
        }
        .category-shelf {
            color: #8c564b;
        }
        .category-service {
            color: #e377c2;
        }
        .category-seller {
            color: #7f7f7f;
        }
        .logo {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 150px;
            height: 80px;
        }
        footer {
            width: 100%;
            background-color: #ccc;
            padding: 10px 0;
            text-align: center;
            color: #666;
            position: relative;
        }
    </style>
    <script>
        function validateForm() {
            var text = document.forms["predictForm"]["text"].value.trim();
            if (text == "") {
                alert("Please enter some text");
                return false;
            }
            return true;
        }
        function clearPredictions() {
            var predictionsDiv = document.querySelector('.predictions');
            if (predictionsDiv) {
                predictionsDiv.innerHTML = '';
            }
        }
    </script>
</head>
<body>
    <div class="content-wrapper">
        <img src="static/static_logo.png" alt="Company Logo" class="logo">
        <div class="input-container">
            <h2>Enter Text to Predict Multi-Label Classification</h2>
            <form name="predictForm" method="post" onsubmit="clearPredictions(); return validateForm()">
                <textarea name="text" rows="4" cols="50">{{ text }}</textarea><br><br>
                <input type="submit" value="Predict">
            </form>
        </div>
        
        {% if predictions %}
            <div class="predictions">
                <h3>Predicted Labels:</h3>
                {% for prediction in predictions %}
                    <div class="prediction-item category-{{ prediction }}">
                        <span class="icon"></span>{{ prediction }}
                    </div>
                {% endfor %}
            </div>
        {% endif %}
    </div>

    <footer>
        <p>&copy; 2024 Bikasuzzaman. Machine Learning Engineer.</p>
    </footer>
</body>
</html>