girishwangikar commited on
Commit
872ca85
·
verified ·
1 Parent(s): 3968ab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -6
app.py CHANGED
@@ -161,16 +161,33 @@ example_text = """The Apollo 11 mission, launched by NASA in July 1969, was the
161
  with gr.Blocks() as iface:
162
  with gr.Row():
163
  with gr.Column():
164
- input_text = gr.Textbox(label="Input Text")
165
- question = gr.Textbox(label="Question")
166
- example_box = gr.Markdown(f"### Example Paragraph\n\n{example_text}")
167
  graph_viz = gr.Image(label="Graph Visualization", type="filepath")
168
  with gr.Column():
169
- answer = gr.Textbox(label="Answer")
170
- relations_table = gr.Dataframe(label="Relations Table")
171
- summary = gr.Textbox(label="Summary")
172
  generated_image = gr.Image(label="Generated Image", type="filepath")
173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  gr.Button("Run").click(ui_function, inputs=[input_text, question], outputs=[answer, graph_viz, relations_table, summary, generated_image])
175
 
176
  footer_text = """
@@ -181,4 +198,5 @@ with gr.Blocks() as iface:
181
  </footer>
182
  """
183
  gr.Markdown(footer_text)
 
184
  iface.launch()
 
161
  with gr.Blocks() as iface:
162
  with gr.Row():
163
  with gr.Column():
164
+ input_text = gr.Textbox(label="Input Text", lines=6, placeholder="Enter your text here...")
165
+ question = gr.Textbox(label="Question", lines=1, placeholder="Ask a question about the text...")
166
+ example_box = gr.Markdown(f"### Example Paragraph\n\nUse the following paragraph as a sample input:\n\n{example_text}")
167
  graph_viz = gr.Image(label="Graph Visualization", type="filepath")
168
  with gr.Column():
169
+ answer = gr.Textbox(label="Answer", lines=3, placeholder="The answer will appear here.")
170
+ relations_table = gr.Dataframe(label="Relations Table", headers=["Node 1", "Node 2", "Relation"], interactive=False)
171
+ summary = gr.Textbox(label="Summary", lines=2, placeholder="Summary of the input text will appear here.")
172
  generated_image = gr.Image(label="Generated Image", type="filepath")
173
 
174
+ gr.Markdown("""
175
+ ### Instructions to Use the App:
176
+
177
+ 1. **Input Text:** Enter the text you want to analyze in the "Input Text" field.
178
+ 2. **Ask a Question:** Enter a question related to the text in the "Question" field.
179
+ 3. **Run the Analysis:** Click the "Run" button to analyze the text.
180
+ 4. **View Results:**
181
+ - The "Answer" field will display the response to your question.
182
+ - The "Graph Visualization" will show a graphical representation of entities and their relationships in the text.
183
+ - The "Relations Table" will display extracted relationships in tabular form.
184
+ - The "Summary" field will provide a concise summary of the input text.
185
+ - The "Generated Image" will depict a visual representation based on the summarized text.
186
+
187
+ **Example:** Use the provided example paragraph for a quick demo of the app.
188
+
189
+ """)
190
+
191
  gr.Button("Run").click(ui_function, inputs=[input_text, question], outputs=[answer, graph_viz, relations_table, summary, generated_image])
192
 
193
  footer_text = """
 
198
  </footer>
199
  """
200
  gr.Markdown(footer_text)
201
+
202
  iface.launch()