计算机科学 ›› 2026, Vol. 53 ›› Issue (11): 242-248.doi: 10.11896/jsjkx.251000112
李伦兴1,2,5, 郭祥雨1,2, 付立军1,3,4
LI Lunxing1,2,5, GUO Xiangyu1,2, FU Lijun1,3,4
摘要: 查询改写是提升信息检索和自然语言理解系统性能的关键技术。针对现有查询改写方法在处理垂直领域中多样化、非规范化用户输入时面临的挑战,提出了一种基于专家范例与动态少样本的查询改写框架。该框架的核心思想是构建一个专家级改写范例库,在接收到用户查询时,动态检索与查询意图最相似的若干范例,并将其作为上下文提示注入大型语言模型(LLM),从而引导模型生成更精准、更贴合领域术语的查询。为进一步提升范例选择的针对性,引入基于元学习的范例重排序模块,根据范例对模型生成特定查询的贡献度进行加权,优化了提示的内部结构。为了验证该方法的有效性,额外实现两种基线方法作为对比:基于领域词表嵌入的同义词替换方法和将领域知识作为静态知识库与LLM结合的方法。在一个真实的计算机应用场景(运动心理知识服务)数据集上进行的对比实验表明,虽然所有方法均能提升查询质量,但所提动态少样本方法在处理复杂、模糊查询时表现最优,其生成的改写在BLEU-4和ROUGE-L指标上分别达到了0.78和0.81,并将下游任务的答案检索成功率提升至94.2%。实验验证了该方法在运动心理领域语义改写中的适用性与推广潜力,对优化搜索引擎、智能问答等应用具有重要的参考价值。
中图分类号:
| [1] CARPINETO C,ROMANO G.A survey of query reformula-tions:A framework for evaluation[J].ACM Computing Surveys,2012,44(1):1-50. [2] WANG Z,CUN Y,YU D.Query2doc:A Simple and Effective Method for Query-to-Document Expansion[C]//Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.Singapore:Association for Computational Linguistics,2023:10234-10246. [3] DEVLIN J,CHANG M W,LEE K,et al.BERT:Pre-training of Deep Bidirectional Transformers for Language Understanding[C]//Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics:Human Language Technologies.Minneapolis,Minnesota:Association for Computational Linguistics,2019:4171-4186. [4] ZHAO Y X,WANG Y,WANG S H,et al.RewriteGen:Autonomous query optimization for retrieval-augmented large language models via reinforcement learning[J].Journal of Nanjing University(Natural Science),2025,61(6):908-916. [5] TU X H,GUO C,ZONG Y H.Information retrieval reranking method based on bidirectional text expansion[J].Journal of South China University of Technology(Natural Science Edition),2025,53(9):59-67. [6] MIKOLOV T,CHEN K,CORRADO G,et al.Efficient Estimation of Word Representations in Vector Space[C]//Proceedings of the 1st International Conference on Learning Representations,Workshop Track.2013. [7] PENNINGTON J,SOCHER R,MANNING C D.Glove:Global Vectors for Word Representation[C]//Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing(EMNLP).Doha,Qatar:Association for Computational Linguistics,2014:1532-1543. [8] PANG X L,YUAN R F,HUANG J T,et al.Query rewriting technology based on an extractive-generative fusion model[J].Network Security Technology & Application,2023(9):44-46. [9] LENG L X.Semantic rewriting techniques for general structural retrieval in large model retrieval[J].China Sciencepaper,2025,20(10):856-863. [10] BROWN T,MANN B,RYDER N,et al.Language Models are Few-Shot Learners[C]//Advances in Neural Information Processing Systems 33.Vancouver,Canada:Curran Associates,Inc.,2020:1877-1901. [11] LI A,TU X H,YAO B,et al.ChatGPT query rewriting for do-cument retrieval[J].Journal of Chinese Information Processing,2025,39(8):107-116,138. [12] CHEN B,LI Y,ZHAO W,et al.Query Rewriting for Retrieval-Augmented Generation in Domain-Specific QA[C]//Findings of the Association for Computational Linguistics:ACL 2023.Toronto,Canada:Association for Computational Linguistics,2023:887-900. [13] LEWIS P,PEREZ E,PIKTUS A,et al.Retrieval-AugmentedGeneration for Knowledge-Intensive NLP Tasks[C]//Advances in Neural Information Processing Systems 33.Vancouver,Canada:Curran Associates,Inc.,2020:9459-9474. [14] ASAI A,KOMEILI M,HAJISHIRZI H.Selfrag:Learning toRetrieve,Generate,and Critique Through Self-Reflection[C]//Proceedings of the 12th International Conference on Learning Representations(ICLR).Vienna,Austria:OpenReview.net,2024. [15] DENG P C,HEI Y H,WEI B S,et al.Query rewriting model based on knowledge graph construction and entity correction[J].Application Research of Computers,2025,42(9):2752-2757. [16] LIU J,SHEN D,ZHANG Y,et al.What makes good in-context examples for GPT-3?[C]//Proceedings of the 60th Annual Meeting of the ACL.Dublin,Ireland:Association for Computational Linguistics,2022:4139-4146. [17] SHE L L,XIONG L Y,LU X S.Research on knowledge concept extraction method based on few-shot learning and chain-of-thought prompting[J].Big Data Research,2026,12(2):97-110. [18] MA L K,YUAN M T.Financial relation extraction based on large language model with few-shot demonstration[J].Software Guide,2026,25(7):103-110. [19] LYU M H,YU L H,HU S W,et al.Prompt-based Two-stage few-shot named entity recognition[J].Computer and Modernization,2026(6):19-24. [20] HE T,YUAN M,HE M.A fusion algorithm for few-shot relation extraction based on prompt enhancement[J].Journal of Yunnan University(Natural Sciences Edition),2025. [21] RUBIN O,HERZIG J,BERANT J.Learning to Retrieve Promptsfor In-Context Learning[C]//Proceedings of the 2022 Confe-rence of the NAACL.Seattle,United States:Association for Computational Linguistics,2022:247-261. [22] PAPINENI K,ROUKOS S,WARD T,et al.Bleu:A Method for Automatic Evaluation of Machine Translation[C]//Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics.Philadelphia,Pennsylvania:Association for Computational Linguistics,2002:311-318. [23] LIN C Y.Rouge:A package for automatic evaluation of summaries[C]//Proceedings of the Workshop on Text Summarization Branches Out.Barcelona,Spain:Association for Computational Linguistics,2004:74-81. [24] BAI X,LIU Z,CHEN J,et al.BGE Embeddings:Baichuan General Embeddings for Chinese Semantic Representation[C]//Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.Singapore:Association for Computational Linguistics,2023. [25] JOHNSON J,DOUZE M,JÉGOU H.Billion-scale similaritysearch with GPUs[J].IEEE Transactions on Big Data,2021,7(3):535-547. |
|
||