Update app.py
Browse files
app.py
CHANGED
|
@@ -248,23 +248,27 @@ if submit and len(x) != 0:
|
|
| 248 |
edcrecep = []
|
| 249 |
hormrecep = []
|
| 250 |
hormcan = []
|
| 251 |
-
|
| 252 |
for e in edccanbis:
|
| 253 |
-
if e[-1]== ["B-EDC","B-CANCER"]:
|
| 254 |
edccann += [[e[0],e[1],e[2]]]
|
|
|
|
| 255 |
|
| 256 |
-
|
| 257 |
-
elif e[-1]== ["B-EDC","B-HORMONE"]:
|
| 258 |
edchorm += [[e[0],e[1],e[2]]]
|
|
|
|
| 259 |
|
| 260 |
-
elif e[-1]== ["B-EDC","B-RECEPTOR"]:
|
| 261 |
edcrecep += [[e[0],e[1],e[2]]]
|
|
|
|
| 262 |
|
| 263 |
-
elif e[-1]== ["B-HORMONE","B-RECEPTOR"]:
|
| 264 |
hormrecep += [[e[0],e[1],e[2]]]
|
|
|
|
| 265 |
|
| 266 |
-
elif e[-1]== ["B-HORMONE","B-CANCER"]:
|
| 267 |
hormcan += [[e[0],e[1],e[2]]]
|
|
|
|
| 268 |
|
| 269 |
|
| 270 |
edcrecepdf = pd.DataFrame(edcrecep, columns=["EDC", "RECEPTOR", "RELATION"])
|
|
@@ -281,8 +285,7 @@ if submit and len(x) != 0:
|
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
-
|
| 285 |
-
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
| 286 |
|
| 287 |
edccandf = pd.DataFrame(edccan, columns= ["Sentence", "Entity 1", "Entity 2", "Relation"] )
|
| 288 |
|
|
|
|
| 248 |
edcrecep = []
|
| 249 |
hormrecep = []
|
| 250 |
hormcan = []
|
| 251 |
+
|
| 252 |
for e in edccanbis:
|
| 253 |
+
if e[-1]== ["B-EDC","B-CANCER"] and e[2] in ["CAUSE","INCREASE_RISK","SPEED_UP","NO_ASSOCIATION"]:
|
| 254 |
edccann += [[e[0],e[1],e[2]]]
|
| 255 |
+
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
| 256 |
|
| 257 |
+
elif e[-1]== ["B-EDC","B-HORMONE"] and e[2] in ["ALTER", "INCREASE", "DECREASE", "MIMIC", "INCREASE_ACTIVITY","DECREASE_ACTIVITY"]:
|
|
|
|
| 258 |
edchorm += [[e[0],e[1],e[2]]]
|
| 259 |
+
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
| 260 |
|
| 261 |
+
elif e[-1]== ["B-EDC","B-RECEPTOR"] and e[2] in ["BLOCK", "ACTIVATE", "INTERFER"] :
|
| 262 |
edcrecep += [[e[0],e[1],e[2]]]
|
| 263 |
+
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
| 264 |
|
| 265 |
+
elif e[-1]== ["B-HORMONE","B-RECEPTOR"] and e[2] in ["BIND"] :
|
| 266 |
hormrecep += [[e[0],e[1],e[2]]]
|
| 267 |
+
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
| 268 |
|
| 269 |
+
elif e[-1]== ["B-HORMONE","B-CANCER"] and e[2] in ["DEVELOP"]:
|
| 270 |
hormcan += [[e[0],e[1],e[2]]]
|
| 271 |
+
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
| 272 |
|
| 273 |
|
| 274 |
edcrecepdf = pd.DataFrame(edcrecep, columns=["EDC", "RECEPTOR", "RELATION"])
|
|
|
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
+
|
|
|
|
| 289 |
|
| 290 |
edccandf = pd.DataFrame(edccan, columns= ["Sentence", "Entity 1", "Entity 2", "Relation"] )
|
| 291 |
|