Sasidhar commited on
Commit
b8d77bb
1 Parent(s): 0a71207

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -117
app.py CHANGED
@@ -96,124 +96,7 @@ pipeline_qa = init_qa_pipeline()
96
 
97
  st.header("Intelligent Document Automation")
98
 
99
- def get_paragraphs_for_summaries():
100
- paras =[]
101
- paras.append("""Stephen is a 53 year old gentleman who does general duties police work. He is married and has an
102
- 18 year old daughter at home. He is right hand dominant. Cigarettes nil, alcohol rare, allergies nil.
103
- DVTe nil. Past medical history hyperlipidemia and reflux testicular cancer in 2000 and right knee
104
- reconstruction in 1987. Medications include Nexium and Crestor.""")
105
- paras.append("""History presenting complaint: Right knee and right elbow injuries. On 12 January 2020, while at work
106
- he was trying to apprehend a stolen vehicle. The deployed some road spikes onto the road. The
107
- stolen vehicle went over the road spikes. He was attempting to retrieve the spikes to prevent
108
- damage to civilian and police vehicles and while he was doing that, he was hit by a police vehicle
109
- coming from behind. The police vehicle was approximately doing 50 km/hr. The headlight of the
110
- police car stuck him on the lateral aspect of the right knee. He jumped in the air and flicked in the air
111
- with his right elbow also hitting the police car before he flung over a barrier. He was able to mobilise
112
- afterwards when the adrenaline was taking effect. After he cooled down that night he developed
113
- significant pain in both the elbow and the knee. The elbow seemed to have settled with time but he
114
- has got slight discomfort on the lateral epicondyle of the right elbow but otherwise no instability,
115
- clicking, locking or catching of the elbow.""")
116
- paras.append("""His knee has medial sided pain. It is an annoying type of pain that is present at rear and with activity.
117
- It feels like it is getting slightly better but his main problem is that he cannot still fully flex his knee as
118
- he used to do before the accident. He has noticed some clicking ad a little bit of swelling in the knee.
119
- He has had no instability but he is still a little bit stiff when he first gets up. He has been treated with
120
- 4 sessions of physiotherapy. He has had two operations on this knee before when it was
121
- reconstructed which was an open procedure and an anthroscopy later to shave off the cartilage. He
122
- never got back to playing rugby after his reconstruction but he was able to do martial arts and all his
123
- policing duties without any problem.""")
124
- paras.append("""He is mildly overweight, normal gait and no effusion in the knee and a range of motion of 0 to 110
125
- degrees which cannot be improved passively. His right elbow has full range of motion and is stable.
126
- He has had an Xray on right elbow showing no fracture and an xray of knee showed early medial
127
- compartment osteoarthritis. He has got new clicking in his knee and has been advised to get an MRI
128
- scan.""")
129
- paras.append("""As far as his right elbow is concerned, he should reduce weight lifting activity and any repetitive right
130
- upper limb activity that causes any discomfort. His right knee requires an MRI scan to look for any
131
- loose bodies and I will see him with the results of the scan. In the meantime, he can continue with
132
- his general policing duties which he has anyways been doing since the accident""")
133
- return paras
134
-
135
- def get_paragraphs_for_entities():
136
- paras =[]
137
- paras.append("""18 February2020
138
- Dr Christine Fowler""")
139
- paras.append("""Dear Christine,
140
- Re: Stephen Parrot""")
141
- paras.append("""Stephen is a 53 year old gentleman who does general duties police work. He is married and has an
142
- 18 year old daughter at home. He is right hand dominant. Cigarettes nil, alcohol rare, allergies nil.
143
- DVTe nil. Past medical history hyperlipidemia and reflux testicular cancer in 2000 and right knee
144
- reconstruction in 1987. Medications include Nexium and Crestor.""")
145
- paras.append("""History presenting complaint: Right knee and right elbow injuries. On 12 January 2020, while at work
146
- he was trying to apprehend a stolen vehicle. The deployed some road spikes onto the road. The
147
- stolen vehicle went over the road spikes. He was attempting to retrieve the spikes to prevent
148
- damage to civilian and police vehicles and while he was doing that, he was hit by a police vehicle
149
- coming from behind. The police vehicle was approximately doing 50 km/hr. The headlight of the
150
- police car stuck him on the lateral aspect of the right knee. He jumped in the air and flicked in the air
151
- with his right elbow also hitting the police car before he flung over a barrier. He was able to mobilise
152
- afterwards when the adrenaline was taking effect. After he cooled down that night he developed
153
- significant pain in both the elbow and the knee. The elbow seemed to have settled with time but he
154
- has got slight discomfort on the lateral epicondyle of the right elbow but otherwise no instability,
155
- clicking, locking or catching of the elbow.""")
156
- paras.append("""His knee has medial sided pain. It is an annoying type of pain that is present at rear and with activity.
157
- It feels like it is getting slightly better but his main problem is that he cannot still fully flex his knee as
158
- he used to do before the accident. He has noticed some clicking ad a little bit of swelling in the knee.
159
- He has had no instability but he is still a little bit stiff when he first gets up. He has been treated with
160
- 4 sessions of physiotherapy. He has had two operations on this knee before when it was
161
- reconstructed which was an open procedure and an anthroscopy later to shave off the cartilage. He
162
- never got back to playing rugby after his reconstruction but he was able to do martial arts and all his
163
- policing duties without any problem.""")
164
- paras.append("""He is mildly overweight, normal gait and no effusion in the knee and a range of motion of 0 to 110
165
- degrees which cannot be improved passively. His right elbow has full range of motion and is stable.
166
- He has had an Xray on right elbow showing no fracture and an xray of knee showed early medial
167
- compartment osteoarthritis. He has got new clicking in his knee and has been advised to get an MRI
168
- scan.""")
169
- paras.append("""As far as his right elbow is concerned, he should reduce weight lifting activity and any repetitive right
170
- upper limb activity that causes any discomfort. His right knee requires an MRI scan to look for any
171
- loose bodies and I will see him with the results of the scan. In the meantime, he can continue with
172
- his general policing duties which he has anyways been doing since the accident""")
173
- paras.append("""Kind regards,
174
- Dr Jason Sanders""")
175
- return paras
176
-
177
- def get_text_from_ocr_engine():
178
 
179
- return """18 February2020
180
- Dr Christine Fowler
181
- Dear Christine,
182
- Re: Stephen Parrot
183
- Stephen is a 53 year old gentleman who does general duties police work. He is married and has an
184
- 18 year old daughter at home. He is right hand dominant. Cigarettes nil, alcohol rare, allergies nil.
185
- DVTe nil. Past medical history hyperlipidemia and reflux testicular cancer in 2000 and right knee
186
- reconstruction in 1987. Medications include Nexium and Crestor.
187
- History presenting complaint: Right knee and right elbow injuries. On 12 January 2020, while at work
188
- he was trying to apprehend a stolen vehicle. The deployed some road spikes onto the road. The
189
- stolen vehicle went over the road spikes. He was attempting to retrieve the spikes to prevent
190
- damage to civilian and police vehicles and while he was doing that, he was hit by a police vehicle
191
- coming from behind. The police vehicle was approximately doing 50 km/hr. The headlight of the
192
- police car stuck him on the lateral aspect of the right knee. He jumped in the air and flicked in the air
193
- with his right elbow also hitting the police car before he flung over a barrier. He was able to mobilise
194
- afterwards when the adrenaline was taking effect. After he cooled down that night he developed
195
- significant pain in both the elbow and the knee. The elbow seemed to have settled with time but he
196
- has got slight discomfort on the lateral epicondyle of the right elbow but otherwise no instability,
197
- clicking, locking or catching of the elbow.
198
- His knee has medial sided pain. It is an annoying type of pain that is present at rear and with activity.
199
- It feels like it is getting slightly better but his main problem is that he cannot still fully flex his knee as
200
- he used to do before the accident. He has noticed some clicking ad a little bit of swelling in the knee.
201
- He has had no instability but he is still a little bit stiff when he first gets up. He has been treated with
202
- 4 sessions of physiotherapy. He has had two operations on this knee before when it was
203
- reconstructed which was an open procedure and an anthroscopy later to shave off the cartilage. He
204
- never got back to playing rugby after his reconstruction but he was able to do martial arts and all his
205
- policing duties without any problem.
206
- He is mildly overweight, normal gait and no effusion in the knee and a range of motion of 0 to 110
207
- degrees which cannot be improved passively. His right elbow has full range of motion and is stable.
208
- He has had an Xray on right elbow showing no fracture and an xray of knee showed early medial
209
- compartment osteoarthritis. He has got new clicking in his knee and has been advised to get an MRI
210
- scan.
211
- As far as his right elbow is concerned, he should reduce weight lifting activity and any repetitive right
212
- upper limb activity that causes any discomfort. His right knee requires an MRI scan to look for any
213
- loose bodies and I will see him with the results of the scan. In the meantime, he can continue with
214
- his general policing duties which he has anyways been doing since the accident.
215
- Kind regards,
216
- Dr Jason Sanders"""
217
 
218
  with st.sidebar:
219
  selected_menu = option_menu("Select Option",
 
96
 
97
  st.header("Intelligent Document Automation")
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  with st.sidebar:
102
  selected_menu = option_menu("Select Option",