Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -186,11 +186,11 @@ def main():
|
|
186 |
|
187 |
final_list = pd.DataFrame(
|
188 |
{'Id': sent_id,
|
189 |
-
'
|
190 |
'Component': class_list,
|
191 |
-
'
|
192 |
-
'
|
193 |
-
'
|
194 |
})
|
195 |
s = final_list['Component'].shift(-1)
|
196 |
m = s.str.startswith('##', na=False)
|
@@ -212,12 +212,12 @@ def main():
|
|
212 |
.query("_merge == 'left_only'") \
|
213 |
.drop("_merge",axis=1)
|
214 |
|
215 |
-
#df = df3.groupby(['Id','
|
216 |
#st.write(df)
|
217 |
|
218 |
#df = df3
|
219 |
df3["CauseOrEffect"].replace({"C": "cause", "E": "effect"}, inplace=True)
|
220 |
-
df_final = df3[df3['
|
221 |
df3['New string'] = df_final['Component'].replace(r'[##]+', ' ', regex=True)
|
222 |
|
223 |
df_final = df_final.drop("Component",axis=1)
|
|
|
186 |
|
187 |
final_list = pd.DataFrame(
|
188 |
{'Id': sent_id,
|
189 |
+
'Fullsentence': sentence_pred,
|
190 |
'Component': class_list,
|
191 |
+
'causeOrEffect': entity_list,
|
192 |
+
'Labellevel1': level0,
|
193 |
+
'Labellevel2': pred_val
|
194 |
})
|
195 |
s = final_list['Component'].shift(-1)
|
196 |
m = s.str.startswith('##', na=False)
|
|
|
212 |
.query("_merge == 'left_only'") \
|
213 |
.drop("_merge",axis=1)
|
214 |
|
215 |
+
#df = df3.groupby(['Id','Fullsentence','causeOrEffect', 'Labellevel1', 'Labellevel2'])['Component'].apply(', '.join).reset_index()
|
216 |
#st.write(df)
|
217 |
|
218 |
#df = df3
|
219 |
df3["CauseOrEffect"].replace({"C": "cause", "E": "effect"}, inplace=True)
|
220 |
+
df_final = df3[df3['causeOrEffect'] != 'CT']
|
221 |
df3['New string'] = df_final['Component'].replace(r'[##]+', ' ', regex=True)
|
222 |
|
223 |
df_final = df_final.drop("Component",axis=1)
|