Skip to content

Commit 02f4ba8

Browse files
committed
Logger fixes
1 parent 5e314ee commit 02f4ba8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/evaluation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The options are:
6464
* `numquestions`: The number of questions to generate. We suggest at least 200.
6565
* `numsearchdocs`: The number of documents (chunks) to retrieve from your search index. You can leave off the option to fetch all documents, but that will significantly increase time it takes to generate ground truth data. You may want to at least start with a subset.
6666
* `kgfile`: An existing RAGAS knowledge base JSON file, which is usually `ground_truth_kg.json`. You may want to specify this if you already created a knowledge base and just want to tweak the question generation steps.
67+
* `groundtruthfile`: The file to write the generated ground truth answwers. By default, this is `evals/ground_truth.jsonl`.
6768

6869
🕰️ This may take a long time, possibly several hours, depending on the size of the search index.
6970

evals/generate_ground_truth.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ def get_search_documents(azure_credential, num_search_documents=None) -> str:
4141
)
4242
all_documents = []
4343
if num_search_documents is None:
44+
logger.info("Fetching all document chunks from Azure AI Search")
4445
num_search_documents = 100000
46+
else:
47+
logger.info("Fetching %d document chunks from Azure AI Search", num_search_documents)
4548
response = search_client.search(search_text="*", top=num_search_documents).by_page()
4649
for page in response:
4750
page = list(page)
@@ -87,10 +90,9 @@ def generate_ground_truth_ragas(num_questions=200, num_search_documents=None, kg
8790
kg = KnowledgeGraph.load(full_path_to_kg)
8891
else:
8992
# Make a knowledge_graph from Azure AI Search documents
90-
logger.info("Fetching %d document chunks from Azure AI Search", num_search_documents)
9193
search_docs = get_search_documents(azure_credential, num_search_documents)
9294

93-
logger.info("Creating a RAGAS knowledge graph with based off of %d search documents", len(search_docs))
95+
logger.info("Creating a RAGAS knowledge graph based off of %d search documents", len(search_docs))
9496
nodes = []
9597
for doc in search_docs:
9698
content = doc["content"]
@@ -106,7 +108,7 @@ def generate_ground_truth_ragas(num_questions=200, num_search_documents=None, kg
106108

107109
kg = KnowledgeGraph(nodes=nodes)
108110

109-
logger.info("Using RAGAS to apply transforms to knowledge graph", len(search_docs))
111+
logger.info("Using RAGAS to apply transforms to knowledge graph")
110112
transforms = default_transforms(
111113
documents=[LCDocument(page_content=doc["content"]) for doc in search_docs],
112114
llm=generator_llm,

0 commit comments

Comments
 (0)