Spaces:
Sleeping
Sleeping
update layout
Browse files
main.py
CHANGED
|
@@ -27,23 +27,32 @@ theme = gr.themes.Soft(
|
|
| 27 |
secondary_hue="neutral",
|
| 28 |
)
|
| 29 |
|
| 30 |
-
# Create Gradio interface
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
if __name__ == "__main__":
|
| 49 |
demo.launch()
|
|
|
|
| 27 |
secondary_hue="neutral",
|
| 28 |
)
|
| 29 |
|
| 30 |
+
# Create Gradio interface with custom layout
|
| 31 |
+
with gr.Blocks(theme=theme, css=css, title="Event Analysis System") as demo:
|
| 32 |
+
gr.Markdown("# Event Analysis System")
|
| 33 |
+
gr.Markdown("Analyze text to extract entities, assess confidence, and identify key event information with relationship tracking.")
|
| 34 |
+
|
| 35 |
+
with gr.Row():
|
| 36 |
+
with gr.Column(scale=2):
|
| 37 |
+
input_box = gr.Textbox(
|
| 38 |
+
label="Event Text",
|
| 39 |
+
placeholder="Enter text to analyze (e.g., 'John from Tech Corp. is attending the meeting in Washington, DC tomorrow at 14:30 #tech')",
|
| 40 |
+
lines=3
|
| 41 |
+
)
|
| 42 |
+
gr.Examples(
|
| 43 |
+
examples=EXAMPLES,
|
| 44 |
+
inputs=[input_box],
|
| 45 |
+
label="Example Inputs",
|
| 46 |
+
examples_per_page=6
|
| 47 |
+
)
|
| 48 |
+
submit_btn = gr.Button("Submit", variant="primary")
|
| 49 |
+
|
| 50 |
+
with gr.Column(scale=3):
|
| 51 |
+
output = gr.HTML(label="Analysis Results")
|
| 52 |
+
|
| 53 |
+
# Event handlers
|
| 54 |
+
submit_btn.click(fn=process_input, inputs=input_box, outputs=output)
|
| 55 |
+
input_box.submit(fn=process_input, inputs=input_box, outputs=output)
|
| 56 |
|
| 57 |
if __name__ == "__main__":
|
| 58 |
demo.launch()
|