Fix regex to match multiline content in extraction parsing
• Remove non-greedy quantifier • Add DOTALL flag for multiline matching • Apply to both parsing functions • Enable cross-line content extraction
This commit is contained in:
parent
7baeb186c6
commit
8bbf307aeb
1 changed files with 2 additions and 2 deletions
|
|
@ -835,7 +835,7 @@ async def _parse_extraction_result(
|
||||||
[context_base["record_delimiter"], context_base["completion_delimiter"]],
|
[context_base["record_delimiter"], context_base["completion_delimiter"]],
|
||||||
)
|
)
|
||||||
for record in records:
|
for record in records:
|
||||||
record = re.search(r"\((.*?)\)", record)
|
record = re.search(r"\((.*)\)", record, re.DOTALL)
|
||||||
if record is None:
|
if record is None:
|
||||||
continue
|
continue
|
||||||
record = record.group(1)
|
record = record.group(1)
|
||||||
|
|
@ -1749,7 +1749,7 @@ async def extract_entities(
|
||||||
)
|
)
|
||||||
|
|
||||||
for record in records:
|
for record in records:
|
||||||
record = re.search(r"\((.*?)\)", record)
|
record = re.search(r"\((.*)\)", record, re.DOTALL)
|
||||||
if record is None:
|
if record is None:
|
||||||
continue
|
continue
|
||||||
record = record.group(1)
|
record = record.group(1)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue