ikraamkb commited on
Commit
3aa8146
·
verified ·
1 Parent(s): aaad936

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +28 -39
templates/index.html CHANGED
@@ -3,49 +3,38 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>AI Question Answering | Ask Questions on Documents and Images</title>
7
- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
8
- <link href="/static/styles.css" rel="stylesheet"> <!-- Linking CSS file -->
9
  </head>
10
  <body>
11
- <div class="container">
12
- <h1 class="text-center my-5">AI Question Answering</h1>
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- <form action="/question-answering-doc" method="POST" enctype="multipart/form-data">
15
- <div class="mb-3">
16
- <label for="file" class="form-label">Choose Document (PDF, DOCX, PPTX)</label>
17
- <input type="file" class="form-control" name="file" required>
18
- </div>
19
- <div class="mb-3">
20
- <label for="question" class="form-label">Enter Your Question</label>
21
- <input type="text" class="form-control" name="question" required>
22
- </div>
23
- <button type="submit" class="btn btn-primary">Submit Question</button>
24
- </form>
25
 
26
- <form action="/question-answering-image" method="POST" enctype="multipart/form-data" class="mt-5">
27
- <div class="mb-3">
28
- <label for="image" class="form-label">Choose Image (JPG, PNG)</label>
29
- <input type="file" class="form-control" name="image_file" required>
30
- </div>
31
- <div class="mb-3">
32
- <label for="image-question" class="form-label">Enter Your Question</label>
33
- <input type="text" class="form-control" name="question" required>
34
- </div>
35
- <button type="submit" class="btn btn-primary">Submit Question</button>
36
- </form>
37
 
38
- <div class="mt-4">
39
- {% if answer %}
40
- <h3>Answer:</h3>
41
- <p>{{ answer }}</p>
42
- {% endif %}
43
-
44
- {% if image_text %}
45
- <h3>Image Text (OCR Result):</h3>
46
- <p>{{ image_text }}</p>
47
- {% endif %}
48
- </div>
49
- </div>
50
  </body>
51
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AI-powered QA</title>
 
 
7
  </head>
8
  <body>
9
+ <h1>Ask a Question!</h1>
10
+
11
+ <form action="/question-answering-doc" method="post" enctype="multipart/form-data">
12
+ <label for="question">Question:</label>
13
+ <input type="text" id="question" name="question" required><br><br>
14
+
15
+ <label for="file">Upload a Document:</label>
16
+ <input type="file" id="file" name="file" accept=".pdf,.docx,.pptx" required><br><br>
17
+
18
+ <button type="submit">Submit</button>
19
+ </form>
20
+
21
+ <form action="/question-answering-image" method="post" enctype="multipart/form-data">
22
+ <label for="image_question">Question:</label>
23
+ <input type="text" id="image_question" name="question" required><br><br>
24
 
25
+ <label for="image_file">Upload an Image:</label>
26
+ <input type="file" id="image_file" name="image_file" accept="image/*" required><br><br>
 
 
 
 
 
 
 
 
 
27
 
28
+ <button type="submit">Submit</button>
29
+ </form>
 
 
 
 
 
 
 
 
 
30
 
31
+ {% if answer %}
32
+ <h2>Answer: {{ answer }}</h2>
33
+ {% endif %}
34
+
35
+ {% if image_text %}
36
+ <h3>Extracted Text from Image:</h3>
37
+ <p>{{ image_text }}</p>
38
+ {% endif %}
 
 
 
 
39
  </body>
40
  </html>