dwb2023 commited on
Commit
34cd34c
·
1 Parent(s): 7e89f4c

update layout

Browse files
Files changed (1) hide show
  1. main.py +26 -17
main.py CHANGED
@@ -27,23 +27,32 @@ theme = gr.themes.Soft(
27
  secondary_hue="neutral",
28
  )
29
 
30
- # Create Gradio interface
31
- demo = gr.Interface(
32
- fn=process_input,
33
- inputs=[
34
- gr.Textbox(
35
- label="Event Text",
36
- placeholder="Enter text to analyze (e.g., 'John from Tech Corp. is attending the meeting in Washington, DC tomorrow at 14:30 #tech')",
37
- lines=3
38
- )
39
- ],
40
- outputs=gr.HTML(),
41
- title="Event Analysis System",
42
- description="Analyze text to extract entities, assess confidence, and identify key event information with relationship tracking.",
43
- css=css,
44
- theme=theme,
45
- examples=EXAMPLES
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()