jattokatarratto commited on
Commit
9eefd88
·
verified ·
1 Parent(s): dffdac2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -248,6 +248,10 @@ def process_row_BioPortal_api(args, key_bioportal, row):
248
  try:
249
  data = response.json()
250
 
 
 
 
 
251
  dff = pd.DataFrame(data)
252
  dff = dff.drop(columns=['hierarchy', 'mappings'])
253
 
@@ -1090,6 +1094,10 @@ def getUrlBioAndAllOtherBioConcepts(word, args, key_virtuoso, cache_map_virtuoso
1090
  try:
1091
  data = response.json()
1092
 
 
 
 
 
1093
  dff = pd.DataFrame(data)
1094
  dff = dff.drop(columns=['hierarchy', 'mappings'])
1095
 
@@ -2148,7 +2156,7 @@ def nerBio(text, ModelsSelection, CategoriesSelection, ScoreFilt, EntityLinking,
2148
  condition = missing_sentence_refs & quoted_context
2149
 
2150
  # Select rows from df_ToAnnotate that meet the condition
2151
- rows_to_add = df_ToAnnotate[condition]
2152
 
2153
  rows_to_add['model'] = "Forced"
2154
  rows_to_add['entity_group'] = "MISC"
 
248
  try:
249
  data = response.json()
250
 
251
+ if not data:
252
+ # nothing found from Bioportal
253
+ return pd.DataFrame()
254
+
255
  dff = pd.DataFrame(data)
256
  dff = dff.drop(columns=['hierarchy', 'mappings'])
257
 
 
1094
  try:
1095
  data = response.json()
1096
 
1097
+ if not data:
1098
+ # nothing found from Bioportal
1099
+ return None, None, None, None, None, cache_map_virtuoso
1100
+
1101
  dff = pd.DataFrame(data)
1102
  dff = dff.drop(columns=['hierarchy', 'mappings'])
1103
 
 
2156
  condition = missing_sentence_refs & quoted_context
2157
 
2158
  # Select rows from df_ToAnnotate that meet the condition
2159
+ rows_to_add = df_ToAnnotate[condition].copy()
2160
 
2161
  rows_to_add['model'] = "Forced"
2162
  rows_to_add['entity_group'] = "MISC"