小bug修复
This commit is contained in:
@@ -33,7 +33,7 @@ class Auto extends Base
|
||||
|
||||
|
||||
public function incaptar(){
|
||||
$file = "D:/55.docx";
|
||||
$file = "D:/33.docx";
|
||||
$cc = docxReader($file);
|
||||
|
||||
// echo $cc;die;
|
||||
@@ -42,13 +42,13 @@ class Auto extends Base
|
||||
$content = "阅读下面内容,按照医生学者的标准总结。内容要求,要有疾病诊断、主要症状、六经辨证、药方、思想应用。如果某些内容没有请留空。这些内容可能有多个,比如患者多次求医的历史记录。都需要总结。不要带list符号,药方无需讲药理,直接列出,多版本的需要分别列出。最好以吴雄志的医疗思想去总结思想应用;";
|
||||
$content .= "内容开始:".$cc . " 内容结束";
|
||||
|
||||
echo $content;die;
|
||||
// echo $content;die;
|
||||
|
||||
|
||||
$data = [
|
||||
"model" => "llama3",
|
||||
"messages" => [
|
||||
["role"=>"system", "content"=> "你是一名医学学者,请将问题的答案分别回答"],
|
||||
["role"=>"system", "content"=> "你是一名医学学者,请将问题的答案分别回答。"],
|
||||
["role"=>"user", "content" => $content]],
|
||||
"stream" => false
|
||||
];
|
||||
@@ -64,9 +64,6 @@ class Auto extends Base
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
|
||||
|
||||
// return jsonSuccess($content);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,33 @@ class Preaccept extends Base
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
public function spiltContent(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"content"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$text = $data['content'];
|
||||
|
||||
$text = preg_replace('/(\d+)([a-zA-Z%℃°]+)/', '$1 $2', $text);
|
||||
|
||||
$text = preg_replace('/\s*%\s*/', '%', $text);
|
||||
|
||||
|
||||
$pattern_en_dash = '/(\d+)–(\d+)/';
|
||||
$text = preg_replace($pattern_en_dash, '$1-$2', $text);
|
||||
|
||||
|
||||
$pattern_em_dash = '/(\d+)—(\d+)/';
|
||||
$text = preg_replace($pattern_em_dash, '$1-$2', $text);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**清空引用文献
|
||||
* @return \think\response\Json
|
||||
* @throws \think\Exception
|
||||
|
||||
Reference in New Issue
Block a user