|
@@ -113,6 +113,14 @@ class GeoQuestionRes extends Command |
|
@@ -113,6 +113,14 @@ class GeoQuestionRes extends Command |
|
113
|
}
|
113
|
}
|
|
114
|
// 命中文案
|
114
|
// 命中文案
|
|
115
|
$hit_data[] = $result['text'];
|
115
|
$hit_data[] = $result['text'];
|
|
|
|
116
|
+
|
|
|
|
117
|
+ if(!empty($result['annotations'])){
|
|
|
|
118
|
+ $url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
|
|
|
|
119
|
+ $title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
|
|
|
|
120
|
+ $hit_data = array_merge($url, $title, $hit_data);
|
|
|
|
121
|
+ }
|
|
|
|
122
|
+ $hit = 0;
|
|
|
|
123
|
+ //todo::与预期结果是否复合
|
|
116
|
if(!empty($taskInfo['expect_result'])){
|
124
|
if(!empty($taskInfo['expect_result'])){
|
|
117
|
$str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否";
|
125
|
$str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否";
|
|
118
|
$strResult = $geo_service->getChatResult($str, 'gpt-4o-mini');
|
126
|
$strResult = $geo_service->getChatResult($str, 'gpt-4o-mini');
|
|
@@ -120,6 +128,7 @@ class GeoQuestionRes extends Command |
|
@@ -120,6 +128,7 @@ class GeoQuestionRes extends Command |
|
120
|
switch ($strResult['text']){
|
128
|
switch ($strResult['text']){
|
|
121
|
case '是':
|
129
|
case '是':
|
|
122
|
$is_match = 1;
|
130
|
$is_match = 1;
|
|
|
|
131
|
+ $hit++;
|
|
123
|
break;
|
132
|
break;
|
|
124
|
case '否':
|
133
|
case '否':
|
|
125
|
$is_match = 2;
|
134
|
$is_match = 2;
|
|
@@ -130,12 +139,6 @@ class GeoQuestionRes extends Command |
|
@@ -130,12 +139,6 @@ class GeoQuestionRes extends Command |
|
130
|
}
|
139
|
}
|
|
131
|
}
|
140
|
}
|
|
132
|
}
|
141
|
}
|
|
133
|
- if(!empty($result['annotations'])){
|
|
|
|
134
|
- $url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
|
|
|
|
135
|
- $title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
|
|
|
|
136
|
- $hit_data = array_merge($url, $title, $hit_data);
|
|
|
|
137
|
- }
|
|
|
|
138
|
- $hit = 0;
|
|
|
|
139
|
$hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data);
|
142
|
$hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data);
|
|
140
|
if (!empty($hit_keyword['keywords'])) {
|
143
|
if (!empty($hit_keyword['keywords'])) {
|
|
141
|
$hit++;
|
144
|
$hit++;
|