Spaces:
Runtime error
Runtime error
Update index.html
Browse files- index.html +11 -26
index.html
CHANGED
@@ -1,33 +1,18 @@
|
|
|
|
1 |
<html lang="en">
|
2 |
<head>
|
3 |
<meta charset="UTF-8">
|
4 |
-
<
|
5 |
-
<title>Headline Predictor</title>
|
6 |
</head>
|
7 |
<body>
|
8 |
-
<h1>
|
9 |
-
<form
|
10 |
-
<
|
11 |
-
<
|
12 |
-
<button type="submit">Predict Headline</button>
|
13 |
</form>
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
document.getElementById('article-form').addEventListener('submit', async function(e) {
|
19 |
-
e.preventDefault();
|
20 |
-
const article = document.getElementById('article').value;
|
21 |
-
const response = await fetch('/predict', {
|
22 |
-
method: 'POST',
|
23 |
-
headers: {
|
24 |
-
'Content-Type': 'application/x-www-form-urlencoded',
|
25 |
-
},
|
26 |
-
body: new URLSearchParams({ article }),
|
27 |
-
});
|
28 |
-
const result = await response.json();
|
29 |
-
document.getElementById('headline').innerText = result.headline || result.error;
|
30 |
-
});
|
31 |
-
</script>
|
32 |
</body>
|
33 |
-
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
+
<title>Text Summarizer</title>
|
|
|
6 |
</head>
|
7 |
<body>
|
8 |
+
<h1>Article Summarizer</h1>
|
9 |
+
<form method="POST" action="/summarize">
|
10 |
+
<textarea name="article" rows="10" cols="50" placeholder="Enter your article here..."></textarea><br>
|
11 |
+
<input type="submit" value="Summarize">
|
|
|
12 |
</form>
|
13 |
+
{% if summary %}
|
14 |
+
<h2>Summary:</h2>
|
15 |
+
<p>{{ summary }}</p>
|
16 |
+
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
</body>
|
18 |
+
</html>
|