Seetha commited on
Commit
a4ae85b
1 Parent(s): dce9799

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -197,8 +197,10 @@ def main():
197
  .query("_merge == 'left_only'") \
198
  .drop("_merge",axis=1)
199
 
200
- df = df3.groupby(['Id','Full_sentence','CauseOrEffect', 'Label_level1', 'Label_level2'])['Component'].apply(', '.join).reset_index()
201
  #st.write(df)
 
 
202
  df["CauseOrEffect"].replace({"C": "cause", "E": "effect"}, inplace=True)
203
  df_final = df[df['CauseOrEffect'] != 'CT']
204
  df['New string'] = df_final['Component'].replace(r'[##]+', ' ', regex=True)
@@ -206,6 +208,7 @@ def main():
206
  df_final = df_final.drop("Component",axis=1)
207
  df_final.insert(2, "Component", df['New string'], True)
208
 
 
209
  df_final.to_csv('predictions.csv')
210
 
211
  # buffer = io.BytesIO()
 
197
  .query("_merge == 'left_only'") \
198
  .drop("_merge",axis=1)
199
 
200
+ #df = df3.groupby(['Id','Full_sentence','CauseOrEffect', 'Label_level1', 'Label_level2'])['Component'].apply(', '.join).reset_index()
201
  #st.write(df)
202
+
203
+ df = df3
204
  df["CauseOrEffect"].replace({"C": "cause", "E": "effect"}, inplace=True)
205
  df_final = df[df['CauseOrEffect'] != 'CT']
206
  df['New string'] = df_final['Component'].replace(r'[##]+', ' ', regex=True)
 
208
  df_final = df_final.drop("Component",axis=1)
209
  df_final.insert(2, "Component", df['New string'], True)
210
 
211
+ st.write(df_final[df_final['Component'].str.len() != 1])
212
  df_final.to_csv('predictions.csv')
213
 
214
  # buffer = io.BytesIO()