Merge branch 'optimize-extraction' into return-data-only
This commit is contained in:
commit
b6eb2f1c82
1 changed files with 3 additions and 3 deletions
|
|
@ -320,7 +320,7 @@ async def _handle_single_entity_extraction(
|
|||
timestamp: int,
|
||||
file_path: str = "unknown_source",
|
||||
):
|
||||
if len(record_attributes) < 4 or "entity" not in record_attributes[0]:
|
||||
if len(record_attributes) != 4 or "entity" not in record_attributes[0]:
|
||||
if len(record_attributes) > 1 and "entity" in record_attributes[0]:
|
||||
logger.warning(
|
||||
f"{chunk_key}: extraction failed! only got {len(record_attributes)} feilds on entity `{record_attributes[1]}`"
|
||||
|
|
@ -391,7 +391,7 @@ async def _handle_single_relationship_extraction(
|
|||
timestamp: int,
|
||||
file_path: str = "unknown_source",
|
||||
):
|
||||
if len(record_attributes) < 5 or "relationship" not in record_attributes[0]:
|
||||
if len(record_attributes) != 5 or "relationship" not in record_attributes[0]:
|
||||
if len(record_attributes) > 1 and "relationship" in record_attributes[0]:
|
||||
logger.warning(
|
||||
f"{chunk_key}: extraction failed! only got {len(record_attributes)} fields on realtion `{record_attributes[1]}`"
|
||||
|
|
@ -885,7 +885,7 @@ async def _process_extraction_result(
|
|||
continue
|
||||
|
||||
# Fix various forms of tuple_delimiter corruption from the LLM output using the dedicated function
|
||||
delimiter_core = tuple_delimiter[2:-2] # Extract "SEP" from "<|SEP|>"
|
||||
delimiter_core = tuple_delimiter[2:-2] # Extract "S" from "<|S|>"
|
||||
record = fix_tuple_delimiter_corruption(record, delimiter_core, tuple_delimiter)
|
||||
# change delimiter_core to lower case, and fix again
|
||||
delimiter_core = delimiter_core.lower()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue