Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/IlyaRice/RAG-Challenge-2
/ functions
Functions
158 in github.com/IlyaRice/RAG-Challenge-2
⨍
Functions
158
◇
Types & classes
45
↓ 12 callers
Function
build_system_prompt
(instruction: str="", example: str="", pydantic_schema: str="")
src/prompts.py:7
↓ 5 callers
Method
_block_ends_with_colon
Check if block text ends with colon for relevant block types.
src/parsed_reports_merging.py:181
↓ 4 callers
Method
count_tokens
(self, string: str, encoding_name="o200k_base")
src/text_splitter.py:62
↓ 3 callers
Method
parse_and_export
(self, input_doc_paths: List[Path] = None, doc_dir: Path = None)
src/pdf_parsing.py:156
↓ 3 callers
Method
send_message
Routes the send_message call to the appropriate processor. The underlying processor's send_message method is responsible for handling
src/api_requests.py:380
↓ 2 callers
Method
_calculate_statistics
Calculate statistics about processed questions.
src/questions_processing.py:213
↓ 2 callers
Method
_create_answer_detail_ref
Create a reference ID for answer details and store the details
src/questions_processing.py:200
↓ 2 callers
Method
_get_table_context
(self, json_report, target_table_index)
src/tables_serialization.py:50
↓ 2 callers
Method
_get_unique_filepath
Helper method to get unique filepath
src/api_requests.py:475
↓ 2 callers
Method
_process_text_reference
Helper method to process text references and create content items. Args: ref_num (int): Reference number for the text ite
src/pdf_parsing.py:325
↓ 2 callers
Method
_save_progress
(self, processed_questions: List[dict], output_path: Optional[str], submission_file: bool = False, team_email:
src/questions_processing.py:415
↓ 2 callers
Function
append_to_jsonl
Append a json payload to the end of a jsonl file.
src/api_request_parallel_processor.py:362
↓ 2 callers
Method
get_answer_for_company
(self, company_name: str, question: str, schema: str)
src/questions_processing.py:121
↓ 2 callers
Method
get_answer_from_rag_context
(self, question, rag_context, schema, model)
src/api_requests.py:408
↓ 2 callers
Function
process_messages
()
src/tables_serialization.py:28
↓ 2 callers
Method
process_report
Process a single report, returning a list of processed pages and printing a message if corrections were made.
src/parsed_reports_merging.py:47
↓ 1 callers
Method
_apply_formatting_rules
Transform blocks according to formatting rules.
src/parsed_reports_merging.py:189
↓ 1 callers
Method
_build_rag_context_prompts
Return prompts tuple for the given schema.
src/api_requests.py:422
↓ 1 callers
Method
_clean_text
Clean text using regex substitutions and count corrections.
src/parsed_reports_merging.py:118
↓ 1 callers
Method
_convert_json_to_csv_if_needed
Checks if subset.json exists in root dir and subset.csv is absent. If so, converts the JSON to CSV format.
src/pipeline.py:81
↓ 1 callers
Method
_create_document_converter
Creates and returns a DocumentConverter with default pipeline options.
src/pdf_parsing.py:69
↓ 1 callers
Method
_create_vector_db
(self, embeddings: List[float])
src/ingestion.py:82
↓ 1 callers
Method
_extract_companies_from_subset
Extract company names from a question by matching against companies in the subset file.
src/questions_processing.py:163
↓ 1 callers
Method
_extract_references
(self, pages_list: list, company_name: str)
src/questions_processing.py:69
↓ 1 callers
Method
_filter_blocks
Remove blocks of ignored types.
src/parsed_reports_merging.py:107
↓ 1 callers
Method
_format_retrieval_results
Format vector retrieval results into RAG context string
src/questions_processing.py:56
↓ 1 callers
Method
_generate_with_retry
Wrapper for generate_content with retry logic
src/api_requests.py:274
↓ 1 callers
Method
_get_embeddings
(self, text: Union[str, List[str]], model: str = "text-embedding-3-large")
src/ingestion.py:66
↓ 1 callers
Method
_get_next_available_filename
Returns the next available filename by adding a numbered suffix if the file exists. Example: If answers.json exists, returns answers_
src/pipeline.py:233
↓ 1 callers
Method
_get_page_data
Returns page dict for given page number, or None if not found.
src/parsed_reports_merging.py:99
↓ 1 callers
Method
_get_serialized_table_text
Convert serialized table format to text string. Args: table: Table object containing serialized data
src/parsed_reports_merging.py:392
↓ 1 callers
Method
_get_serialized_tables_by_page
Group serialized tables by page number
src/text_splitter.py:8
↓ 1 callers
Method
_get_table_by_id
Get table representation by ID from report data. Returns markdown or serialized text based on configuration.
src/parsed_reports_merging.py:382
↓ 1 callers
Method
_handle_processing_error
Handle errors during question processing. Log error details and return a dictionary containing error information.
src/questions_processing.py:322
↓ 1 callers
Method
_initialize_paths
Initialize paths configuration based on run config settings
src/pipeline.py:70
↓ 1 callers
Method
_load_dbs
(self)
src/retrieval.py:106
↓ 1 callers
Method
_load_questions
(self, questions_file_path: Optional[Union[str, Path]])
src/questions_processing.py:50
↓ 1 callers
Method
_normalize_page_sequence
Ensure that page numbers in content are sequential by filling gaps with empty pages.
src/pdf_parsing.py:125
↓ 1 callers
Method
_parse_csv_metadata
Parse CSV file and create a lookup dictionary with sha1 as key.
src/pdf_parsing.py:54
↓ 1 callers
Method
_parse_structured_response
(self, response_text, response_format)
src/api_requests.py:286
↓ 1 callers
Method
_post_process_submission_answers
Post-process answers for submission format: 1. Convert page indices from one-based to zero-based 2. Clear references for N/A
src/questions_processing.py:362
↓ 1 callers
Method
_process_picture_block
(self, picture, data)
src/pdf_parsing.py:523
↓ 1 callers
Method
_process_report
(self, report: dict)
src/ingestion.py:89
↓ 1 callers
Method
_process_single_question
(self, question_data: dict)
src/questions_processing.py:268
↓ 1 callers
Method
_render_list_group
Render list group with optional header, text and footnotes.
src/parsed_reports_merging.py:356
↓ 1 callers
Method
_render_table_group
Render table group with optional header, text and footnotes.
src/parsed_reports_merging.py:329
↓ 1 callers
Method
_reparse_response
(self, response, system_content)
src/api_requests.py:223
↓ 1 callers
Method
_reparse_response
Reparse invalid JSON responses using the model itself.
src/api_requests.py:298
↓ 1 callers
Method
_send_serialization_request
(self, table, context_before, context_after)
src/tables_serialization.py:106
↓ 1 callers
Method
_serialize_table
(self, json_report: dict, target_table_index: int)
src/tables_serialization.py:136
↓ 1 callers
Method
_set_up_llm
(self)
src/retrieval.py:87
↓ 1 callers
Method
_set_up_llm
(self)
src/ingestion.py:56
↓ 1 callers
Method
_set_up_llm
(self)
src/api_requests.py:245
↓ 1 callers
Method
_split_page
Split page text into chunks. The original text includes markdown tables.
src/text_splitter.py:70
↓ 1 callers
Method
_split_report
Split report into chunks, preserving markdown tables in content and optionally including serialized tables.
src/text_splitter.py:33
↓ 1 callers
Method
_table_to_md
(self, table)
src/pdf_parsing.py:472
↓ 1 callers
Method
_validate_page_references
Validate that all page numbers mentioned in the LLM's answer are actually from the retrieval results. If fewer than min_pages valid r
src/questions_processing.py:87
↓ 1 callers
Function
api_endpoint_from_url
Extract the API endpoint from the request URL.
src/api_request_parallel_processor.py:351
↓ 1 callers
Method
assemble_content
(self, data)
src/pdf_parsing.py:356
↓ 1 callers
Method
assemble_metainfo
(self, data)
src/pdf_parsing.py:266
↓ 1 callers
Method
assemble_pictures
(self, data)
src/pdf_parsing.py:497
↓ 1 callers
Method
assemble_report
Assemble the report using either normalized data or raw conversion result.
src/pdf_parsing.py:255
↓ 1 callers
Method
assemble_tables
(self, tables, data)
src/pdf_parsing.py:435
↓ 1 callers
Method
async_serialize_tables
Process all tables in the report asynchronously
src/tables_serialization.py:171
↓ 1 callers
Method
call_api
Calls the OpenAI API and saves results.
src/api_request_parallel_processor.py:284
↓ 1 callers
Method
chunk_reports
Split processed reports into smaller chunks for better processing.
src/pipeline.py:171
↓ 1 callers
Function
cli
Pipeline command line interface for processing PDF reports and questions.
main.py:6
↓ 1 callers
Method
convert_documents
(self, input_doc_paths: List[Path])
src/pdf_parsing.py:94
↓ 1 callers
Method
create_bm25_index
Create a BM25 index from a list of text chunks.
src/ingestion.py:20
↓ 1 callers
Method
create_vector_dbs
Create vector databases from chunked reports.
src/pipeline.py:186
↓ 1 callers
Method
debug_data
(self, data)
src/pdf_parsing.py:288
↓ 1 callers
Method
download_docling_models
()
src/pipeline.py:104
↓ 1 callers
Method
expand_groups
(self, body_children, groups)
src/pdf_parsing.py:297
↓ 1 callers
Method
export_reports_to_markdown
Export processed reports to markdown format for review.
src/pipeline.py:162
↓ 1 callers
Method
export_to_markdown
Export processed reports to markdown files. Args: reports_dir: Directory containing JSON report files output_
src/parsed_reports_merging.py:414
↓ 1 callers
Method
get_headers
(self)
src/reranking.py:14
↓ 1 callers
Method
get_rank_for_multiple_blocks
(self, query, retrieved_documents)
src/reranking.py:64
↓ 1 callers
Method
get_rank_for_single_block
(self, query, retrieved_document)
src/reranking.py:46
↓ 1 callers
Method
get_rephrased_questions
Use LLM to break down a comparative question into individual questions.
src/api_requests.py:455
↓ 1 callers
Method
merge_reports
Merge complex JSON reports into a simpler structure with a list of pages, where all text blocks are combined into a single string.
src/pipeline.py:153
↓ 1 callers
Function
num_tokens_consumed_from_request
Count the number of tokens in the request. Only supports completion and embedding requests.
src/api_request_parallel_processor.py:369
↓ 1 callers
Method
parse_and_export_parallel
Parse PDF files in parallel using multiple processes. Args: input_doc_paths: List of paths to PDF files to process
src/pdf_parsing.py:177
↓ 1 callers
Method
parse_pdf_reports
(self, parallel: bool = True, chunk_size: int = 2, max_workers: int = 10)
src/pipeline.py:204
↓ 1 callers
Method
parse_pdf_reports_parallel
Parse PDF reports in parallel using multiple processes. Args: chunk_size: Number of PDFs to process in each worker
src/pipeline.py:121
↓ 1 callers
Method
parse_pdf_reports_sequential
(self)
src/pipeline.py:109
↓ 1 callers
Method
prepare_page_text
Main method to process page blocks and return assembled string.
src/parsed_reports_merging.py:82
↓ 1 callers
Method
process_all_questions
(self, output_path: str = 'questions_with_answers.json', team_email: str = "79250515615@yandex.com", submissio
src/questions_processing.py:442
↓ 1 callers
Function
process_api_requests_from_file
Processes API requests in parallel, throttling to stay under rate limits.
src/api_request_parallel_processor.py:92
↓ 1 callers
Method
process_comparative_question
Process a question involving multiple companies in parallel: 1. Rephrase the comparative question into individual questions 2
src/questions_processing.py:453
↓ 1 callers
Method
process_directory_parallel
Process JSON files in parallel using thread pool. Args: input_dir: Path to directory containing JSON files ma
src/tables_serialization.py:263
↓ 1 callers
Method
process_documents
(self, conv_results: Iterable[ConversionResult])
src/pdf_parsing.py:98
↓ 1 callers
Method
process_parsed_reports
Process already parsed PDF reports through the pipeline: 1. Merge to simpler JSON structure 2. Export to markdown 3. Chunk the
src/pipeline.py:210
↓ 1 callers
Method
process_question
(self, question: str, schema: str)
src/questions_processing.py:184
↓ 1 callers
Method
process_questions
(self)
src/pipeline.py:254
↓ 1 callers
Method
process_questions_list
(self, questions_list: List[dict], output_path: str = None, submission_file: bool = False, team_email: str = "
src/questions_processing.py:233
↓ 1 callers
Method
process_reports
Process reports from a directory or list of paths, returning a list of processed reports and saving them to an output directory if s
src/parsed_reports_merging.py:17
↓ 1 callers
Method
process_reports
Process all reports and save individual BM25 indices. Args: all_reports_dir (Path): Directory containing the JSON report
src/ingestion.py:25
↓ 1 callers
Method
process_reports
(self, all_reports_dir: Path, output_dir: Path)
src/ingestion.py:95
↓ 1 callers
Method
process_structured_ouputs_requests
( self, model="gpt-4o-mini-2024-07-18", temperature=0.5, seed=None, sy
src/api_requests.py:486
↓ 1 callers
Method
rerank_documents
Rerank multiple documents using parallel processing with threading. Combines vector similarity and LLM relevance scores using weighte
src/reranking.py:88
next →
1–100 of 158, ranked by callers