Merged in bugfix/exhibit-header-detection (pull request #518)

Bugfix/exhibit header detection

* set up testing

* Increased context length, changed prompt to investment_prompts from preprocessing_prompts

* extracting the header

* minor changes

* Merged main into bugfix/exhibit-header-detection

* cleanup prints and tests


Approved-by: Alex Galarce
This commit is contained in:
Katon Minhas
2025-05-07 16:18:02 +00:00
committed by Alex Galarce
parent 0bf14b5182
commit 806bd9b3bb
2 changed files with 31 additions and 3 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import re
from src.prompts import preprocessing_prompts
from src.prompts import investment_prompts
import src.utils.llm_utils as llm_utils
import src.utils.string_utils as string_utils
from src import config, keywords
@@ -225,9 +225,9 @@ def get_exhibit_pages(text_dict: dict[str, str], filename: str) -> list[str]:
exhibit_pages.append(page_num)
first_page = False
else:
prompt = preprocessing_prompts.EXHIBIT_CHECK(page[0:100])
prompt = investment_prompts.EXHIBIT_CHECK(page[0:200])
claude_answer_raw = llm_utils.invoke_claude(
prompt, config.MODEL_ID_CLAUDE3_HAIKU, filename, max_tokens=10 # TODO: low priority, try increasing max_tokens and maybe pass multiple pages in to reduce overall calls
prompt, config.MODEL_ID_CLAUDE3_HAIKU, filename, max_tokens=100 # TODO: low priority, try increasing max_tokens and maybe pass multiple pages in to reduce overall calls
)
claude_answer_extracted = string_utils.extract_text_from_delimiters(
claude_answer_raw, Delimiter.PIPE