Files changed (1) hide show
  1. index.html +85 -17
index.html CHANGED
@@ -1,19 +1,87 @@
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Medical Report Summarizer</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ background-color: #f4f4f4;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ height: 100vh;
15
+ margin: 0;
16
+ }
17
+ .container {
18
+ background: white;
19
+ padding: 20px;
20
+ border-radius: 8px;
21
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
22
+ width: 400px;
23
+ }
24
+ h1 {
25
+ text-align: center;
26
+ margin-bottom: 20px;
27
+ }
28
+ input[type="file"] {
29
+ width: 100%;
30
+ margin-bottom: 20px;
31
+ }
32
+ button {
33
+ width: 100%;
34
+ padding: 10px;
35
+ background-color: #007bff;
36
+ color: white;
37
+ border: none;
38
+ border-radius: 5px;
39
+ cursor: pointer;
40
+ }
41
+ button:hover {
42
+ background-color: #0056b3;
43
+ }
44
+ .result {
45
+ margin-top: 20px;
46
+ padding: 10px;
47
+ background: #e9ecef;
48
+ border-radius: 5px;
49
+ display: none;
50
+ }
51
+ </style>
52
+ </head>
53
+ <body>
54
+ <div class="container">
55
+ <h1>Medical Report Summarizer</h1>
56
+ <form id="reportForm" enctype="multipart/form-data">
57
+ <input type="file" id="report" name="report" accept=".pdf,.doc,.docx" required />
58
+ <button type="submit">Summarize Report</button>
59
+ </form>
60
+ <div class="result" id="summaryResult"></div>
61
+ </div>
62
+
63
+ <script>
64
+ document.getElementById('reportForm').onsubmit = async function (event) {
65
+ event.preventDefault();
66
+ const formData = new FormData();
67
+ const fileInput = document.getElementById('report');
68
+
69
+ formData.append('report', fileInput.files[0]);
70
+
71
+ const response = await fetch('/summarize', { // Adjust the endpoint based on your backend
72
+ method: 'POST',
73
+ body: formData
74
+ });
75
+
76
+ if (response.ok) {
77
+ const summary = await response.text(); // Assuming the backend returns a plain text summary
78
+ const resultDiv = document.getElementById('summaryResult');
79
+ resultDiv.textContent = summary;
80
+ resultDiv.style.display = 'block';
81
+ } else {
82
+ alert('Error summarizing the report.');
83
+ }
84
+ };
85
+ </script>
86
+ </body>
87
  </html>