gabykim commited on
Commit
31e157d
·
1 Parent(s): 93668c2

evaluation output file name

Browse files
src/know_lang_bot/evaluation/chatbot_evaluation.py CHANGED
@@ -6,6 +6,8 @@ from know_lang_bot.config import AppConfig
6
  from know_lang_bot.utils.model_provider import create_pydantic_model
7
  from know_lang_bot.chat_bot.chat_graph import ChatResult, process_chat
8
  import asyncio
 
 
9
 
10
  class EvalMetric(str, Enum):
11
  CHUNK_RELEVANCE = "chunk_relevance"
@@ -375,7 +377,10 @@ async def main():
375
  console.print_exception()
376
 
377
  # Write the final JSON array to a file
378
- with open("evaluation_results.json", "w") as f:
 
 
 
379
  json_list = [summary.model_dump() for summary in summary_list]
380
  json.dump(json_list, f, indent=2)
381
 
 
6
  from know_lang_bot.utils.model_provider import create_pydantic_model
7
  from know_lang_bot.chat_bot.chat_graph import ChatResult, process_chat
8
  import asyncio
9
+ import datetime
10
+ from pathlib import Path
11
 
12
  class EvalMetric(str, Enum):
13
  CHUNK_RELEVANCE = "chunk_relevance"
 
377
  console.print_exception()
378
 
379
  # Write the final JSON array to a file
380
+
381
+ current_date = datetime.datetime.now().strftime("%Y%m%d")
382
+ file_name = Path("evaluations", f"transformers_{config.evaluator.model_provider}_evaluation_results_{current_date}.json")
383
+ with open(file_name, "w") as f:
384
  json_list = [summary.model_dump() for summary in summary_list]
385
  json.dump(json_list, f, indent=2)
386