-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (84 loc) · 4.27 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Summarization</title>
<link rel="icon" type="image/png" href="{{ url_for('static', filename='LOGO MohLearning.png') }}">
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<link href="/static/css/jquery-ui.min.css" rel="stylesheet">
</head>
<body>
<header style="background-color: #004A56;"
class="fixed inset-0 w-full flex flex-col justify-center justify-items-center content-center h-20 rounded-b-lg">
<img src="/static/LOGO MohLearning.png" alt="Logo"
class="object-contain w-16 self-center md:self-left md:w-30">
<div class="self-center text-white">Text Summarization</div>
</header>
<section class="flex flex-wrap mt-20 w-full">
<div class="w-full md:w-1/2">
<form class="w-full flex flex-col md:h-screen" action="{{url_for('Summarize')}}" method="post">
<textarea class="w-11/12 md:h-3/4 m-2 p-2 border-black rounded-lg border self-center justify-center"
name="data" id="data" cols="30" rows="10" placeholder="Enter your Data"
required="required"></textarea>
<div class="flex self-center">
<h3>Summary Length</h3>
<input type="range" class="m-2" min="20" max="1024" name="maxL">
</div>
<div class="flex self-center">
<button class="m-1 bg-green-500 hover:bg-blue-700 text-white font-semi-bold py-2 px-4 rounded-lg"
type="submit" onclick="Check()">Submit</button>
<button class="m-1 bg-red-500 hover:bg-blue-700 text-white font-semi-bold py-2 px-4 rounded-lg"
type="reset">Clear</button>
</div>
</form>
</div>
<div class="w-full md:w-1/2">
<div class="mt-2 flex flex-col w-full md:h-screen">
<textarea style="background-color: #EDFFD2;"
class="w-11/12 border-green-600 rounded-lg p-2 border self-center justify-center md:h-3/4" rows="10"
cols="30" name="result" id="myInput" readonly placeholder="Your Summary">{{result}}</textarea>
<div class="flex self-center space-x-2">
<!-- Bouton "Copy text" -->
<button
class="m-2 bg-blue-400 hover:bg-blue-700 text-white font-semi-bold py-2 px-4 rounded-lg self-center"
onclick="myFunction()">Copy text</button>
<!-- Champ pour words count -->
<div class="bg-yellow-500 text-white font-semi-bold py-2 px-4 rounded-lg self-center">
Words count: <span id="wordsCount">{{word_count}}</span>
</div>
<!-- Champ pour le sentiment -->
<div class="bg-green-500 text-white font-semi-bold py-2 px-4 rounded-lg self-center">
Sentiment: <span id="sentiment">{{sentiment}}</span>
</div>
</div>
<!-- Champ de la pertinence -->
<div class="bg-purple-500 text-white font-semi-bold py-2 px-4 rounded-lg self-center">
Pertinence: <span id="nouveauChamp">{{pertinence}}</span>
</div>
</div>
</div>
</section>
<script>
function myFunction() {
/* Get the text field */
var copyText = document.getElementById("myInput");
/* Select the text field */
copyText.select();
copyText.setSelectionRange(0, 99999); /* For mobile devices */
/* Copy the text inside the text field */
navigator.clipboard.writeText(copyText.value);
}
</script>
<script>
function Check() {
var reg = /<(.|\n)*>/g;
if (reg.test(document.getElementById("data").value) == true) {
var ErrorText = 'Make Sure You Provide Valid Data.';
alert('Error Text');
}
}
</script>
</body>
</html>