Spaces:
Running
Running
Commit
·
137a655
1
Parent(s):
106fec8
Update templates/index.html
Browse files- templates/index.html +27 -49
templates/index.html
CHANGED
@@ -1,56 +1,34 @@
|
|
1 |
-
<html
|
2 |
<head>
|
3 |
-
<title>
|
4 |
-
<script src="https://
|
5 |
-
<script
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
});
|
12 |
-
|
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>
|
45 |
-
<
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
</body>
|
56 |
</html>
|
|
|
1 |
+
<html>
|
2 |
<head>
|
3 |
+
<title>Paraphraser Webapp</title>
|
4 |
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
5 |
+
<script>
|
6 |
+
function copyText(text) {
|
7 |
+
navigator.clipboard.writeText(text).then(function() {
|
8 |
+
console.log('Text copied to clipboard');
|
9 |
+
}, function(err) {
|
10 |
+
console.error('Could not copy text: ', err);
|
11 |
});
|
12 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
</script>
|
14 |
</head>
|
15 |
<body>
|
16 |
+
<h1>Paraphraser Webapp</h1>
|
17 |
+
<form action="/" method="post">
|
18 |
+
<textarea name="input_text" rows="10" cols="30"></textarea>
|
19 |
+
<br><br>
|
20 |
+
<input type="checkbox" name="options" value="remove_special_characters">Remove special characters<br>
|
21 |
+
<input type="checkbox" name="options" value="correct_grammar">Correct grammar<br>
|
22 |
+
<input type="checkbox" name="options" value="summarize">Summarize<br>
|
23 |
+
<input type="checkbox" name="options" value="adjust_tone">Adjust tone<br>
|
24 |
+
<br>
|
25 |
+
<input type="submit" value="Paraphrase">
|
26 |
+
</form>
|
27 |
+
{% if result %}
|
28 |
+
<p>Paraphrased text:</p>
|
29 |
+
<textarea rows="10" cols="30">{{ result }}</textarea>
|
30 |
+
<br><br>
|
31 |
+
<button onclick="copyText()">Copy to Clipboard</button>
|
32 |
+
{% endif %}
|
33 |
</body>
|
34 |
</html>
|