大更新,1投稿系统参考文献的类型增加功能,,,2官网数据库功能

This commit is contained in:
wangjinlei
2026-07-08 11:15:45 +08:00
parent 6df8cae940
commit a9409de4f9
3 changed files with 361 additions and 2 deletions

View File

@@ -105,7 +105,10 @@ class ProductionArticleRefer
$update_a['author'] = $authorCitation !== '' ? $authorCitation . '.' : '';
$update_a['joura'] = $jouraRaw;
$update_a['dateno'] = $dateno;
$update_a['refer_type'] = "journal";
// CrossRef 的 type 最权威,据此确定参考文献类型,未命中回退 journal
$crossrefType = isset($summary['raw']['type']) ? $summary['raw']['type'] : '';
$mappedType = (new ReferenceTypeClassifier())->mapCrossrefType($crossrefType);
$update_a['refer_type'] = $mappedType !== '' ? $mappedType : "journal";
$update_a['is_ja'] = 1;
$update_a['doilink'] = $doilink;
$update_a['cs'] = 1;
@@ -126,7 +129,13 @@ class ProductionArticleRefer
$res = myGet($url);
$frag = trim(substr($res, strpos($res, '.') + 1));
if(empty($frag)){
$aUpdate = ['refer_frag' => $aRefer['refer_content'],'refer_type' => 'other','is_deal' => 1,'update_time' => time()];
// 依据作者原文识别类型;仅在识别出具体非期刊类型时覆盖,否则保持 other
$referType = 'other';
$typeInfo = (new ReferenceTypeClassifier())->classify((string)$aRefer['refer_content']);
if (in_array($typeInfo['type'], ['book','conference','thesis','web'], true)) {
$referType = $typeInfo['type'];
}
$aUpdate = ['refer_frag' => $aRefer['refer_content'],'refer_type' => $referType,'is_deal' => 1,'update_time' => time()];
$aWhere = ['p_refer_id' => $iPReferId];
$result = Db::name('production_article_refer')->where($aWhere)->limit(1)->update($aUpdate);
//写入通过AI获取参考文献详情队列
@@ -139,6 +148,11 @@ class ProductionArticleRefer
if (mb_substr_count($frag, '.') != 3){
$f = $frag . " Available at: " . PHP_EOL . "https://doi.org/" . $aRefer['refer_doi'];
$update['refer_type'] = "other";
// 依据作者原文识别类型;仅在识别出具体非期刊类型时覆盖
$typeInfo = (new ReferenceTypeClassifier())->classify((string)$aRefer['refer_content']);
if (in_array($typeInfo['type'], ['book','conference','thesis','web'], true)) {
$update['refer_type'] = $typeInfo['type'];
}
$update['refer_frag'] = $f;
$update['cs'] = 1;
//写入通过AI获取参考文献详情队列
@@ -155,6 +169,11 @@ class ProductionArticleRefer
if ($joura == trim($bj[0])) {
}
$update['refer_type'] = "journal";
// 依据作者原文的强特征识别更精确的类型(禁用 LLM仅规则强命中才覆盖
$ruleType = (new ReferenceTypeClassifier(['use_llm' => false]))->classifyByRule((string)$aRefer['refer_content']);
if ($ruleType['confidence'] >= 0.8 && !in_array($ruleType['type'], ['journal','other'], true)) {
$update['refer_type'] = $ruleType['type'];
}
$update['is_ja'] = $joura == trim($bj[0]) ? 0 : 1;
$update['dateno'] = str_replace(' ', '', str_replace('-', '', trim($bj[1])));
//新增处理 期卷页码 20251127 start