robertselvam commited on
Commit
34fed9c
1 Parent(s): eb826d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -21
app.py CHANGED
@@ -40,7 +40,7 @@ with gr.Blocks(css="style.css",theme='xiaobaiyuan/theme_land') as demo:
40
  summary_btn = gr.Button("Get Summary",elem_classes="uploadbutton")
41
 
42
  with gr.Row(elem_id = "col-container",scale=0.60):
43
- summary = gr.Textbox(label = "Summary")
44
 
45
  with gr.Row(elem_id = "col-container",scale=0.80):
46
  with gr.TabItem("Tags"):
@@ -50,46 +50,54 @@ with gr.Blocks(css="style.css",theme='xiaobaiyuan/theme_land') as demo:
50
 
51
  with gr.TabItem("Key Values"):
52
  with gr.Column(elem_id = "col-container",scale=0.80):
53
- key_value_btn = gr.Button("Key Value Extracter")
54
  key_value = gr.Textbox(label = "Key Value",lines=10)
55
 
56
 
57
  with gr.TabItem("Clauses"):
58
  with gr.Column(elem_id = "col-container",scale=0.80):
59
- clauses_btn = gr.Button("Clauses Extracter")
60
  clauses = gr.Textbox(label = "Clauses", lines=10)
61
 
62
  with gr.TabItem("pdf"):
63
  with gr.Column(elem_id = "col-container",scale=0.80):
64
- heading_btn = gr.Button("Clauses Extracter")
65
- heading = gr.Textbox(label = "Clauses", lines=10)
 
 
 
 
 
66
 
67
-
 
 
 
 
 
 
 
 
 
68
  extractor = Extractor()
69
  upload_button.upload(file_output_fn,upload_button,file_output)
70
  summary_btn.click( extractor._refine_summary,[upload_button],summary)
71
-
72
- ex= HeadingsExtractor()
73
- heading_btn.click(ex.extract_text,upload_button,heading)
74
-
75
  tags_btn.click(Tags.extract_tags,summary,tags)
76
  key_value_btn.click( KeyValue.extract_key_value_pair,summary,key_value)
77
  clauses_btn.click(Clauses.get_extracted_clauses,summary,clauses)
78
 
79
- with gr.TabItem("pdf"):
80
  ex= HeadingsExtractor()
81
- ex.gradio_interface()
82
-
83
- with gr.TabItem("Incorrect_Sentence"):
84
  inf= IncorrectSentenceFinder()
85
- inf.gradio_interface()
86
-
87
- with gr.TabItem("Incomplete Sentence"):
88
  inc= IncompleteSentenceFinder()
89
- inc.gradio_interface()
90
-
91
- with gr.TabItem("Aggressive Content"):
92
  agg= AggressiveContentFinder(overall_filepath)
93
- agg.gradio_interface()
94
 
95
  demo.launch(debug=True)
 
40
  summary_btn = gr.Button("Get Summary",elem_classes="uploadbutton")
41
 
42
  with gr.Row(elem_id = "col-container",scale=0.60):
43
+ summary = gr.Textbox(label = "Summary",lines=10)
44
 
45
  with gr.Row(elem_id = "col-container",scale=0.80):
46
  with gr.TabItem("Tags"):
 
50
 
51
  with gr.TabItem("Key Values"):
52
  with gr.Column(elem_id = "col-container",scale=0.80):
53
+ key_value_btn = gr.Button("Key Value Extractor")
54
  key_value = gr.Textbox(label = "Key Value",lines=10)
55
 
56
 
57
  with gr.TabItem("Clauses"):
58
  with gr.Column(elem_id = "col-container",scale=0.80):
59
+ clauses_btn = gr.Button("Clauses Extractor")
60
  clauses = gr.Textbox(label = "Clauses", lines=10)
61
 
62
  with gr.TabItem("pdf"):
63
  with gr.Column(elem_id = "col-container",scale=0.80):
64
+ heading_btn = gr.Button("Headings Extractor")
65
+ heading = gr.Textbox(label = "Headings", lines=10)
66
+
67
+ with gr.TabItem("Incorrect_Sentence"):
68
+ with gr.Column(elem_id = "col-container",scale=0.80):
69
+ incor_sen_btn = gr.Button("Incorrect Sentence Extractor")
70
+ incorrect_sentence = gr.Textbox(label = "Incorrect Sentence", lines=10)
71
 
72
+ with gr.TabItem("Incomplete Sentence"):
73
+ with gr.Column(elem_id = "col-container",scale=0.80):
74
+ incom_sen_btn = gr.Button("Incomplete Sentence Extractor")
75
+ incomplete_sentence = gr.Textbox(label = "Incomplete Sentence", lines=10)
76
+
77
+ with gr.TabItem("Aggressive Content"):
78
+ with gr.Column(elem_id = "col-container",scale=0.80):
79
+ aggres_sen_btn = gr.Button("Aggressive Content Extractor")
80
+ aggressive_sentence = gr.Textbox(label = "Aggressive Content", lines=10)
81
+
82
  extractor = Extractor()
83
  upload_button.upload(file_output_fn,upload_button,file_output)
84
  summary_btn.click( extractor._refine_summary,[upload_button],summary)
85
+
86
+
 
 
87
  tags_btn.click(Tags.extract_tags,summary,tags)
88
  key_value_btn.click( KeyValue.extract_key_value_pair,summary,key_value)
89
  clauses_btn.click(Clauses.get_extracted_clauses,summary,clauses)
90
 
 
91
  ex= HeadingsExtractor()
92
+ heading_btn.click(ex.extract_text,upload_button,heading)
93
+
 
94
  inf= IncorrectSentenceFinder()
95
+ incor_sen_btn.click(inf.get_incorrect_sentence,upload_button,incorrect_sentence)
96
+
 
97
  inc= IncompleteSentenceFinder()
98
+ incom_sen_btn.click(inc.get_incomplete_sentence,upload_button,incomplete_sentence)
99
+
 
100
  agg= AggressiveContentFinder(overall_filepath)
101
+ aggres_sen_btn.click(agg.get_aggressive_content,upload_button,aggressive_sentence)
102
 
103
  demo.launch(debug=True)