Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,11 +27,13 @@ def predict(text):
|
|
| 27 |
df_sum=pd.DataFrame(pred1)
|
| 28 |
|
| 29 |
df_sum
|
|
|
|
| 30 |
df_sum2=pd.DataFrame(pred2)
|
| 31 |
-
|
| 32 |
df_sum2
|
| 33 |
|
| 34 |
df_sum3= pd.DataFrame(pred3)
|
|
|
|
| 35 |
|
| 36 |
# # join the two dataframes on token do outer join
|
| 37 |
|
|
@@ -42,14 +44,14 @@ def predict(text):
|
|
| 42 |
df_join['sum_sequence']=df_join['sequence_x'].fillna(df_join['sequence_y'])
|
| 43 |
df_join['sum_sequence']=df_join['sum_sequence'].fillna(df_join['sequence'])
|
| 44 |
df_join=df_join.fillna(0)
|
| 45 |
-
df_join['
|
| 46 |
|
| 47 |
-
df_join=df_join.sort_values(by='
|
| 48 |
df_join=df_join.reset_index(drop=True)
|
| 49 |
# df_join=df_join.dropna()
|
| 50 |
# df_join=df_join.fillna(0)
|
| 51 |
df=df_join.copy()
|
| 52 |
-
df_join=df_join[['
|
| 53 |
|
| 54 |
# gr.Interface(fn=lambda: df_join, inputs=None, outputs=gr.Dataframe(headers=df_join.columns)).launch()
|
| 55 |
|
|
@@ -69,9 +71,9 @@ demo = gr.Interface(
|
|
| 69 |
|
| 70 |
# outputs=gr.Dataframe(headers=['title', 'author', 'text']), allow_flagging='never')
|
| 71 |
|
| 72 |
-
title="Filling Missing
|
| 73 |
examples=[ ['The high blood pressure was due to [MASK] which is critical.'],
|
| 74 |
-
['The [MASK]
|
| 75 |
],
|
| 76 |
description="This application fills any missing words in the medical domain",
|
| 77 |
# fn=lambda: df, inputs=None, outputs=gr.Dataframe(headers=df_join.columns)
|
|
|
|
| 27 |
df_sum=pd.DataFrame(pred1)
|
| 28 |
|
| 29 |
df_sum
|
| 30 |
+
df_sum['score_finetuned_CBERT']=df_sum['score']
|
| 31 |
df_sum2=pd.DataFrame(pred2)
|
| 32 |
+
df_sum2['score_Bio_CBERT']=df_sum2['score']
|
| 33 |
df_sum2
|
| 34 |
|
| 35 |
df_sum3= pd.DataFrame(pred3)
|
| 36 |
+
df_sum3['score_CBERT']=df_sum3['score']
|
| 37 |
|
| 38 |
# # join the two dataframes on token do outer join
|
| 39 |
|
|
|
|
| 44 |
df_join['sum_sequence']=df_join['sequence_x'].fillna(df_join['sequence_y'])
|
| 45 |
df_join['sum_sequence']=df_join['sum_sequence'].fillna(df_join['sequence'])
|
| 46 |
df_join=df_join.fillna(0)
|
| 47 |
+
df_join['score_average']=(df_join['score_finetuned_CBERT']+df_join['score_Bio_CBERT']+df_join['score_CBERT'])/3
|
| 48 |
|
| 49 |
+
df_join=df_join.sort_values(by='score_average',ascending=False)
|
| 50 |
df_join=df_join.reset_index(drop=True)
|
| 51 |
# df_join=df_join.dropna()
|
| 52 |
# df_join=df_join.fillna(0)
|
| 53 |
df=df_join.copy()
|
| 54 |
+
df_join=df_join[['score_finetuned_CBERT','score_Bio_CBERT','score_CBERT','score_average','token_str']]
|
| 55 |
|
| 56 |
# gr.Interface(fn=lambda: df_join, inputs=None, outputs=gr.Dataframe(headers=df_join.columns)).launch()
|
| 57 |
|
|
|
|
| 71 |
|
| 72 |
# outputs=gr.Dataframe(headers=['title', 'author', 'text']), allow_flagging='never')
|
| 73 |
|
| 74 |
+
title="Filling Missing Clinical/Medical Data ",
|
| 75 |
examples=[ ['The high blood pressure was due to [MASK] which is critical.'],
|
| 76 |
+
['The patient is suffering from throat infection causing [MASK] and cough.']
|
| 77 |
],
|
| 78 |
description="This application fills any missing words in the medical domain",
|
| 79 |
# fn=lambda: df, inputs=None, outputs=gr.Dataframe(headers=df_join.columns)
|