|
...
|
...
|
@@ -113,6 +113,14 @@ class GeoQuestionRes extends Command |
|
|
|
}
|
|
|
|
// 命中文案
|
|
|
|
$hit_data[] = $result['text'];
|
|
|
|
|
|
|
|
if(!empty($result['annotations'])){
|
|
|
|
$url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
|
|
|
|
$title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
|
|
|
|
$hit_data = array_merge($url, $title, $hit_data);
|
|
|
|
}
|
|
|
|
$hit = 0;
|
|
|
|
//todo::与预期结果是否复合
|
|
|
|
if(!empty($taskInfo['expect_result'])){
|
|
|
|
$str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否";
|
|
|
|
$strResult = $geo_service->getChatResult($str, 'gpt-4o-mini');
|
|
...
|
...
|
@@ -120,6 +128,7 @@ class GeoQuestionRes extends Command |
|
|
|
switch ($strResult['text']){
|
|
|
|
case '是':
|
|
|
|
$is_match = 1;
|
|
|
|
$hit++;
|
|
|
|
break;
|
|
|
|
case '否':
|
|
|
|
$is_match = 2;
|
|
...
|
...
|
@@ -130,12 +139,6 @@ class GeoQuestionRes extends Command |
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!empty($result['annotations'])){
|
|
|
|
$url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
|
|
|
|
$title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
|
|
|
|
$hit_data = array_merge($url, $title, $hit_data);
|
|
|
|
}
|
|
|
|
$hit = 0;
|
|
|
|
$hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data);
|
|
|
|
if (!empty($hit_keyword['keywords'])) {
|
|
|
|
$hit++;
|
...
|
...
|
|