mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-07 03:50:42 +00:00
feat: (0.6)New UI (#1855)
Co-authored-by: 夏姜 <wenfengjiang.jwf@digital-engine.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: wb-lh513319 <wb-lh513319@alibaba-inc.com> Co-authored-by: csunny <cfqsunny@163.com>
This commit is contained in:
@@ -34,12 +34,14 @@ class RetrieverSimilarityMetric(RetrieverEvaluationMetric):
|
||||
self,
|
||||
prediction: List[str],
|
||||
contexts: Optional[Sequence[str]] = None,
|
||||
query: Optional[str] = None,
|
||||
) -> BaseEvaluationResult:
|
||||
"""Compute the evaluation metric.
|
||||
|
||||
Args:
|
||||
prediction(List[str]): The retrieved chunks from the retriever.
|
||||
contexts(Sequence[str]): The contexts from dataset.
|
||||
query:(Optional[str]) The query text.
|
||||
|
||||
Returns:
|
||||
BaseEvaluationResult: The evaluation result.
|
||||
@@ -81,12 +83,14 @@ class RetrieverMRRMetric(RetrieverEvaluationMetric):
|
||||
self,
|
||||
prediction: List[str],
|
||||
contexts: Optional[Sequence[str]] = None,
|
||||
query: Optional[str] = None,
|
||||
) -> BaseEvaluationResult:
|
||||
"""Compute MRR metric.
|
||||
|
||||
Args:
|
||||
prediction(Optional[List[str]]): The retrieved chunks from the retriever.
|
||||
contexts(Optional[List[str]]): The contexts from dataset.
|
||||
query:(Optional[str]) The query text.
|
||||
Returns:
|
||||
BaseEvaluationResult: The evaluation result.
|
||||
The score is the reciprocal rank of the first relevant chunk.
|
||||
@@ -119,12 +123,14 @@ class RetrieverHitRateMetric(RetrieverEvaluationMetric):
|
||||
self,
|
||||
prediction: List[str],
|
||||
contexts: Optional[Sequence[str]] = None,
|
||||
query: Optional[str] = None,
|
||||
) -> BaseEvaluationResult:
|
||||
"""Compute HitRate metric.
|
||||
|
||||
Args:
|
||||
prediction(Optional[List[str]]): The retrieved chunks from the retriever.
|
||||
contexts(Optional[List[str]]): The contexts from dataset.
|
||||
query:(Optional[str]) The query text.
|
||||
Returns:
|
||||
BaseEvaluationResult: The evaluation result.
|
||||
"""
|
||||
|
Reference in New Issue
Block a user