add embeding w/ code w/o reranking case
Browse files
src/know_lang_bot/evaluation/chatbot_evaluation.py
CHANGED
@@ -373,6 +373,9 @@ async def main():
|
|
373 |
)
|
374 |
summary_list.append(eval_summary)
|
375 |
|
|
|
|
|
|
|
376 |
except Exception:
|
377 |
console.print_exception()
|
378 |
|
|
|
373 |
)
|
374 |
summary_list.append(eval_summary)
|
375 |
|
376 |
+
import time
|
377 |
+
time.sleep(5) # Sleep for 5 seconds to avoid rate limiting
|
378 |
+
|
379 |
except Exception:
|
380 |
console.print_exception()
|
381 |
|
src/know_lang_bot/evaluation/chatbot_evaluation_visualize.py
CHANGED
@@ -10,7 +10,8 @@ from know_lang_bot.evaluation.chatbot_evaluation import EvalSummary
|
|
10 |
class RetrievalMethod(str, Enum):
|
11 |
EMBEDDING = "embedding"
|
12 |
EMBEDDING_RERANKING = "embedding_reranking"
|
13 |
-
EMBEDDING_WITH_CODE = "
|
|
|
14 |
|
15 |
class ResultAnalyzer:
|
16 |
def __init__(self, base_dir: Path, baseline_method: RetrievalMethod = RetrievalMethod.EMBEDDING):
|
@@ -21,7 +22,8 @@ class ResultAnalyzer:
|
|
21 |
self.method_dirs = {
|
22 |
RetrievalMethod.EMBEDDING: self.base_dir / RetrievalMethod.EMBEDDING.value,
|
23 |
RetrievalMethod.EMBEDDING_RERANKING: self.base_dir / RetrievalMethod.EMBEDDING_RERANKING.value,
|
24 |
-
RetrievalMethod.EMBEDDING_WITH_CODE: self.base_dir / RetrievalMethod.EMBEDDING_WITH_CODE.value
|
|
|
25 |
}
|
26 |
|
27 |
def load_results(self, file_path: Path) -> List[EvalSummary]:
|
|
|
10 |
class RetrievalMethod(str, Enum):
|
11 |
EMBEDDING = "embedding"
|
12 |
EMBEDDING_RERANKING = "embedding_reranking"
|
13 |
+
EMBEDDING_WITH_CODE = "embedding_with_code"
|
14 |
+
EMBEDDING_RERANKING_WITH_CODE = "embedding_reranking_with_code"
|
15 |
|
16 |
class ResultAnalyzer:
|
17 |
def __init__(self, base_dir: Path, baseline_method: RetrievalMethod = RetrievalMethod.EMBEDDING):
|
|
|
22 |
self.method_dirs = {
|
23 |
RetrievalMethod.EMBEDDING: self.base_dir / RetrievalMethod.EMBEDDING.value,
|
24 |
RetrievalMethod.EMBEDDING_RERANKING: self.base_dir / RetrievalMethod.EMBEDDING_RERANKING.value,
|
25 |
+
RetrievalMethod.EMBEDDING_WITH_CODE: self.base_dir / RetrievalMethod.EMBEDDING_WITH_CODE.value,
|
26 |
+
RetrievalMethod.EMBEDDING_RERANKING_WITH_CODE: self.base_dir / RetrievalMethod.EMBEDDING_RERANKING_WITH_CODE.value,
|
27 |
}
|
28 |
|
29 |
def load_results(self, file_path: Path) -> List[EvalSummary]:
|