Spaces:
Running
Running
Update index.html
Browse files- index.html +68 -18
index.html
CHANGED
|
@@ -1,19 +1,69 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 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>IPC Prediction App</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
background-color: #f4f4f4;
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 20px;
|
| 13 |
+
}
|
| 14 |
+
.container {
|
| 15 |
+
max-width: 600px;
|
| 16 |
+
margin: auto;
|
| 17 |
+
background: white;
|
| 18 |
+
padding: 20px;
|
| 19 |
+
border-radius: 5px;
|
| 20 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
| 21 |
+
}
|
| 22 |
+
input {
|
| 23 |
+
width: 100%;
|
| 24 |
+
padding: 10px;
|
| 25 |
+
margin: 10px 0;
|
| 26 |
+
border: 1px solid #ccc;
|
| 27 |
+
border-radius: 5px;
|
| 28 |
+
}
|
| 29 |
+
button {
|
| 30 |
+
padding: 10px 15px;
|
| 31 |
+
background-color: #4CAF50;
|
| 32 |
+
color: white;
|
| 33 |
+
border: none;
|
| 34 |
+
border-radius: 5px;
|
| 35 |
+
cursor: pointer;
|
| 36 |
+
}
|
| 37 |
+
.response {
|
| 38 |
+
margin-top: 20px;
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
</head>
|
| 42 |
+
<body>
|
| 43 |
+
<div class="container">
|
| 44 |
+
<h1>IPC Prediction App</h1>
|
| 45 |
+
<input type="text" id="input-text" placeholder="Enter legal text here">
|
| 46 |
+
<button onclick="predictIPC()">Predict</button>
|
| 47 |
+
<div class="response" id="response"></div>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<script>
|
| 51 |
+
async function predictIPC() {
|
| 52 |
+
const inputText = document.getElementById('input-text').value;
|
| 53 |
+
const responseDiv = document.getElementById('response');
|
| 54 |
+
|
| 55 |
+
// Call the Hugging Face API (replace 'your-space-url' with your actual Space URL)
|
| 56 |
+
const response = await fetch('https://your-space-url/predict', {
|
| 57 |
+
method: 'POST',
|
| 58 |
+
headers: {
|
| 59 |
+
'Content-Type': 'application/json'
|
| 60 |
+
},
|
| 61 |
+
body: JSON.stringify({ text: inputText })
|
| 62 |
+
});
|
| 63 |
+
|
| 64 |
+
const result = await response.json();
|
| 65 |
+
responseDiv.innerHTML = `<strong>Predicted Section:</strong> ${result.predicted_section}<br><strong>Description:</strong> ${result.description}`;
|
| 66 |
+
}
|
| 67 |
+
</script>
|
| 68 |
+
</body>
|
| 69 |
</html>
|