Spaces:
Runtime error
Runtime error
Delete index.html
Browse files- index.html +0 -131
index.html
DELETED
|
@@ -1,131 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Text Summarizer</title>
|
| 7 |
-
<style>
|
| 8 |
-
body {
|
| 9 |
-
font-family: Arial, sans-serif;
|
| 10 |
-
margin: 0;
|
| 11 |
-
padding: 0;
|
| 12 |
-
background-color: #FFF7ED;
|
| 13 |
-
color: #333;
|
| 14 |
-
}
|
| 15 |
-
.container {
|
| 16 |
-
max-width: 600px;
|
| 17 |
-
margin: 50px auto;
|
| 18 |
-
padding: 20px;
|
| 19 |
-
background: #fff;
|
| 20 |
-
border-radius: 10px;
|
| 21 |
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 22 |
-
}
|
| 23 |
-
|
| 24 |
-
h1 {
|
| 25 |
-
text-align: center;
|
| 26 |
-
color: #FB923C;
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
h3 {
|
| 30 |
-
text-align: center;
|
| 31 |
-
margin-top: -20px;
|
| 32 |
-
margin-bottom: 40px;
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
form {
|
| 36 |
-
display: flex;
|
| 37 |
-
flex-direction: column;
|
| 38 |
-
gap: 15px;
|
| 39 |
-
}
|
| 40 |
-
|
| 41 |
-
textarea {
|
| 42 |
-
height: 150px;
|
| 43 |
-
padding: 10px;
|
| 44 |
-
border: 1px solid #ccc;
|
| 45 |
-
border-radius: 5px;
|
| 46 |
-
font-size: 16px;
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
button {
|
| 50 |
-
background-color: #FB923C;
|
| 51 |
-
color: white;
|
| 52 |
-
border: none;
|
| 53 |
-
padding: 10px 15px;
|
| 54 |
-
font-size: 16px;
|
| 55 |
-
cursor: pointer;
|
| 56 |
-
border-radius: 5px;
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
button:hover {
|
| 60 |
-
background-color: #F97316;
|
| 61 |
-
}
|
| 62 |
-
|
| 63 |
-
#summary-output {
|
| 64 |
-
margin-top: 20px;
|
| 65 |
-
background: #FFEDD5;
|
| 66 |
-
padding: 15px;
|
| 67 |
-
border-radius: 5px;
|
| 68 |
-
border: 1px solid #ccc;
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
-
#summary-heading {
|
| 72 |
-
margin-top: 0px;
|
| 73 |
-
margin-bottom: 0px;
|
| 74 |
-
}
|
| 75 |
-
</style>
|
| 76 |
-
</head>
|
| 77 |
-
<body>
|
| 78 |
-
<div class="container">
|
| 79 |
-
<h1>Text Summarizer</h1>
|
| 80 |
-
<h3>Using HuggingFace Transformer</h3>
|
| 81 |
-
<p>Write or Paste your content below for quick summarization.</p>
|
| 82 |
-
|
| 83 |
-
<form id="summarization-form">
|
| 84 |
-
<textarea id="dialogue-input" placeholder="Enter your content here..." required></textarea>
|
| 85 |
-
<button type="submit">Summarize</button>
|
| 86 |
-
</form>
|
| 87 |
-
|
| 88 |
-
<div id="summary-output">
|
| 89 |
-
<h3 id="summary-heading">Content Summary</h3>
|
| 90 |
-
<p id="summary-text"></p>
|
| 91 |
-
</div>
|
| 92 |
-
</div>
|
| 93 |
-
|
| 94 |
-
<script>
|
| 95 |
-
document.getElementById("summarization-form").addEventListener("submit", async (e) => {
|
| 96 |
-
e.preventDefault();
|
| 97 |
-
|
| 98 |
-
const dialogueInput = document.getElementById("dialogue-input");
|
| 99 |
-
const summaryText = document.getElementById("summary-text");
|
| 100 |
-
const submitButton = e.target.querySelector("button");
|
| 101 |
-
|
| 102 |
-
const dialogue = dialogueInput.value.trim();
|
| 103 |
-
if (!dialogue) return;
|
| 104 |
-
|
| 105 |
-
summaryText.innerText = "Processing..."; // Show processing message
|
| 106 |
-
submitButton.disabled = true;
|
| 107 |
-
|
| 108 |
-
try {
|
| 109 |
-
const response = await fetch("/summarize/", {
|
| 110 |
-
method: "POST",
|
| 111 |
-
headers: { "Content-Type": "application/json" },
|
| 112 |
-
body: JSON.stringify({ dialogue }),
|
| 113 |
-
});
|
| 114 |
-
|
| 115 |
-
if (!response.ok) {
|
| 116 |
-
throw new Error(`Server error: ${response.status}`);
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
const data = await response.json();
|
| 120 |
-
summaryText.innerText = data.summary || "No summary returned.";
|
| 121 |
-
} catch (err) {
|
| 122 |
-
|
| 123 |
-
summaryText.innerText = `Error: ${err.message}`;
|
| 124 |
-
} finally {
|
| 125 |
-
|
| 126 |
-
submitButton.disabled = false;
|
| 127 |
-
}
|
| 128 |
-
});
|
| 129 |
-
</script>
|
| 130 |
-
</body>
|
| 131 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|