Rudrameher45 commited on
Commit
058d869
·
verified ·
1 Parent(s): 32fea1e

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +11 -26
index.html CHANGED
@@ -1,33 +1,18 @@
 
1
  <html lang="en">
2
  <head>
3
  <meta charset="UTF-8">
4
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
- <title>Headline Predictor</title>
6
  </head>
7
  <body>
8
- <h1>Headline Predictor</h1>
9
- <form id="article-form">
10
- <label for="article">Article:</label><br>
11
- <textarea id="article" name="article" rows="10" cols="50"></textarea><br><br>
12
- <button type="submit">Predict Headline</button>
13
  </form>
14
- <h2>Predicted Headline:</h2>
15
- <p id="headline"></p>
16
-
17
- <script>
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>