ragas评测
url:/ragas
method: POST
请求参数:
|参数名|参数类型|非空|参数说明|
|-|-|-|-|
|questions|list[string]|True|用户准备的问题列表|
|answers|list[string]|True|用户准备的答案列表|
|embedding_model_name_list|list[string]|False|知识库设置的embdding模型名称|
|collection_name_list|list[string]|False|知识库id列表|
|top_k|string|False|取前n个文档|
|threshold_score|string|False|知识库相似度阈值|
|reranking_name|string|False|重排序模型名称
|llm_name|string|True|对话模型名称|
|api_key_config|string|True|api密钥配置|
|temperature|folat|False|模型温度(0~1,越大越发散),默认为0.95|
返回参数:
|参数名|参数类型|参数说明|
|-|-|-|
|error|string|是否出现错误|
|result|list[string]|文档片段(取前10个分段)|
请求参数示例:
```language
{
"temperature": 0.7,
"questions": ["你好", "你是谁"],
"answers": ["你好呀", "我是机器人。"],
"llm_name": "ERNIE-Bot-4",
"api_key_config": {
"qianfan_ak": "xxxx",
"qianfan_sk": "xxxx",
"openai_api_key": "xxxxxx"
}
}
```
返回参数示例:
```language
{
"question": {
"0": "How many employees does Google have?",
"1": "When was Facebook founded?",
"2": "Who is the CEO of Amazon?"
},
"answer": {
"0": "Google has more than 100,000 employees.",
"1": "Facebook was founded in 2004.",
"2": "The CEO of Amazon is Jeff Bezos."
},
"ground_truth": {
"0": "More than 100,000",
"1": "2004",
"2": "Jeff Bezos"
},
"answer_relevancy": {
"0": 1.0,
"1": 1.0,
"2": 1.0
},
"context_precision": {
"0": 0.0,
"1": 0.0,
"2": 0.0
},
"faithfulness": {
"0": 0.0,
"1": 1.0,
"2": 0.0
},
"context_recall": {
"0": 0.0,
"1": 0.0,
"2": 0.0
}
}
```