Spaces:
Running
Running
Commit
·
33d18f5
1
Parent(s):
49be6a8
Update templates/index.html
Browse files- templates/index.html +55 -47
templates/index.html
CHANGED
@@ -1,48 +1,56 @@
|
|
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 |
</html>
|
|
|
1 |
+
<html<html>
|
2 |
+
<head>
|
3 |
+
<title>Paraphrasing Webapp</title>
|
4 |
+
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
5 |
+
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
6 |
+
<script type="text/javascript">
|
7 |
+
$(document).ready(function(){
|
8 |
+
var clipboard = new ClipboardJS('.copy-btn');
|
9 |
+
clipboard.on('success', function(e) {
|
10 |
+
alert("Paraphrased Text Copied to Clipboard!");
|
11 |
+
});
|
12 |
+
clipboard.on('error', function(e) {
|
13 |
+
alert("Unable to Copy. Please try again.");
|
14 |
+
});
|
15 |
+
$('#correct-grammar').click(function(){
|
16 |
+
$.post("/correct_grammar", {text: $('#input-text').val()}, function(data){
|
17 |
+
$('#input-text').val(data.corrected_text);
|
18 |
+
});
|
19 |
+
});
|
20 |
+
$('#remove-special-characters').click(function(){
|
21 |
+
$.post("/remove_special_characters", {text: $('#input-text').val()}, function(data){
|
22 |
+
$('#input-text').val(data.filtered_text);
|
23 |
+
});
|
24 |
+
});
|
25 |
+
$('#paraphrase').click(function(){
|
26 |
+
$.post("/paraphrase", {text: $('#input-text').val()}, function(data){
|
27 |
+
$('#output-text').val(data.paraphrased_text);
|
28 |
+
});
|
29 |
+
});
|
30 |
+
$('#summarize').click(function(){
|
31 |
+
$.post("/summarize", {text: $('#input-text').val()}, function(data){
|
32 |
+
$('#output-text').val(data.summarized_text);
|
33 |
+
});
|
34 |
+
});
|
35 |
+
$('#detect-emotion').click(function(){
|
36 |
+
$.post("/detect_emotion", {text: $('#input-text').val()}, function(data){
|
37 |
+
alert("Detected Emotion: " + data.emotion);
|
38 |
+
});
|
39 |
+
});
|
40 |
+
});
|
41 |
+
</script>
|
42 |
+
</head>
|
43 |
+
<body>
|
44 |
+
<h1>Paraphrasing Webapp</h1>
|
45 |
+
<label for="input-text">Input Text:</label>
|
46 |
+
<textarea id="input-text"></textarea><br><br>
|
47 |
+
<button id="correct-grammar">Correct Grammar</button>
|
48 |
+
<button id="remove-special-characters">Remove Special Characters</button><br><br>
|
49 |
+
<label for="output-text">Output Text:</label>
|
50 |
+
<textarea id="output-text"></textarea><br><br>
|
51 |
+
<button id="paraphrase">Paraphrase</button>
|
52 |
+
<button id="summarize">Summarize</button>
|
53 |
+
<button id="detect-emotion">Detect Emotion</button><br><br>
|
54 |
+
<button class="copy-btn" data-clipboard-target="#output-text">Copy Paraphrased Text</button>
|
55 |
+
</body>
|
56 |
</html>
|