Spaces:
Sleeping
Sleeping
Consoli Sergio
commited on
Commit
·
4e0f84b
1
Parent(s):
66b8c66
correcrted minor bug
Browse files
nerBio.py
CHANGED
@@ -2109,24 +2109,24 @@ def process_row4Linking(row, text_splitter, args, key_geonames, cache_map_geonam
|
|
2109 |
|
2110 |
elif row['IsBio'] == 1:
|
2111 |
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
|
2131 |
else:
|
2132 |
if row['model'] == "Forced":
|
|
|
2109 |
|
2110 |
elif row['IsBio'] == 1:
|
2111 |
|
2112 |
+
# Check if '@id' column exists in df_Extract
|
2113 |
+
iiid = None
|
2114 |
+
# Check if the '@id' exists in the Series
|
2115 |
+
if '@id' in row:
|
2116 |
+
# Check if the value is not None or NaN
|
2117 |
+
if row['@id'] is not None and not pd.isna(row['@id']):
|
2118 |
+
# Assign the value to the variable iiid
|
2119 |
+
iiid = row['@id']
|
2120 |
+
iiiALLURIScontextFromNCBO = None
|
2121 |
+
if 'ALLURIScontextFromNCBO' in row:
|
2122 |
+
if row['ALLURIScontextFromNCBO'] is not None and isinstance(row['ALLURIScontextFromNCBO'], list): #and not pd.isna(row['ALLURIScontextFromNCBO']):
|
2123 |
+
iiiALLURIScontextFromNCBO=row['ALLURIScontextFromNCBO']
|
2124 |
+
iiiALLURIScontextFromNCBO = list(set(iiiALLURIScontextFromNCBO))
|
2125 |
|
2126 |
+
if strtobool(args.debug):
|
2127 |
+
print(f"\n----- isBio COMPUTING ... {row['word']} IN THE TEXT:")
|
2128 |
+
print(row[args.source_column])
|
2129 |
+
result, ALLURIScontext, singleContext, globalContext, singleTriples, globalTriples, cache_map_virtuoso, load_map_query_input_output = virtuoso_api_call(row['word'], text_splitter, args, key_virtuoso, cache_map_virtuoso, load_map_query_input_output, id=iiid, iALLURIScontextFromNCBO=iiiALLURIScontextFromNCBO, UseBioportalForLinking=True, questionText=row[args.source_column])
|
2130 |
|
2131 |
else:
|
2132 |
if row['model'] == "Forced":
|