Retrieval processing method and related equipment
By identifying and semantic expansion of target words in the target field and optimizing query statements, the problem of low quality of query statements in the prior art resulting in poor optimization effect is solved, and a higher search accuracy and recall rate is achieved.
Patent Information
- Application Number
- CN202411009595.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2025-02-28
AI Technical Summary
When optimizing the original query statements entered by users, the prior art faces the problem of low quality of query statements leading to poor optimization results, especially in some scenarios that the application effect is not good.
By identifying the target words belonging to the target field in the query statement and semantically expanding these target words, more extended words are obtained. Based on these extended words, the original query statement is optimized and optimized query statements are generated to improve the search accuracy.
Through semantic expansion and optimization processing, the quality and professionalism of query statements are improved, the search accuracy and recall rate in the target field are improved, and the search effect of content in the target field is enhanced.
Smart Images

Figure CN119537672A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a retrieval processing method and related equipment. Background Art
[0002] With the development of artificial intelligence technology, artificial intelligence models for processing various data have emerged. Large Language Model (LLM) (a large-scale artificial intelligence model designed to understand and generate human language) has been a hot research object in recent years and has demonstrated powerful calculation and reasoning capabilities. Users ask questions to the large language model by entering a query (i.e., a query statement), and then search based on the query, automatically generate and give answers. In order to improve the accuracy and recall rate of retrieval, the original query statement entered by the user can be optimized, but the current optimization method faces the problem of poor optimization effect when the quality of the original query statement is low, and poor application effect in some scenarios. Summary of the invention
[0003] The embodiments of the present application provide a retrieval processing method and related equipment, which can improve the optimization quality of query statements from the source and improve the retrieval accuracy.
[0004] On the one hand, an embodiment of the present application provides a retrieval processing method, the method comprising:
[0005] Obtaining a first query statement to be retrieved;
[0006] Identifying a target word belonging to the target domain from the first query sentence, and performing semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain;
[0007] Optimizing the first query statement based on at least one expanded word to obtain at least one optimized query statement;
[0008] At least one optimized query statement is used for retrieval processing.
[0009] On the one hand, an embodiment of the present application provides a retrieval processing device, the device comprising:
[0010] An acquisition unit, used for acquiring a first query statement to be searched;
[0011] A processing unit is used to identify a target word belonging to a target domain from a first query statement, and perform semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain; optimize the first query statement based on the at least one expanded word to obtain at least one optimized query statement; and use the at least one optimized query statement for retrieval processing.
[0012] In one aspect, an embodiment of the present application provides a computer device, the computer device comprising:
[0013] a processor suitable for executing a computer program;
[0014] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned retrieval processing method is implemented.
[0015] On the one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded by a processor and executes the above-mentioned retrieval processing method.
[0016] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the above-mentioned retrieval processing method is implemented.
[0017] In an embodiment of the present application, by identifying the target word belonging to the target field in the first query statement, it is possible to focus on specific words belonging to the target field in the first query statement, thereby avoiding the illusion problem during optimization. The target word is semantically expanded, and the first query statement is optimized based on at least one expanded word obtained by the expansion. Since these expanded words are proprietary words belonging to the target field, the enhancement effect of the proprietary words belonging to the target field can be achieved, and the optimization quality of the query statement and the query professionalism can be improved. Retrieval processing based on at least one optimized query statement can improve the application effect in scenarios related to the target field and improve the accuracy of retrieving the content of the target field. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is an architecture diagram of a retrieval processing system provided by an exemplary embodiment of the present application;
[0020] Figure 2 It is a flowchart of a search processing method provided by an exemplary embodiment of the present application;
[0021] Figure 3 This is a schematic diagram of a retrieval process in a market consultation scenario provided by an exemplary embodiment of the present application;
[0022] Figure 4 is a flowchart of another retrieval processing method provided by an exemplary embodiment of the present application;
[0023] Figure 5 is a schematic diagram of a flow chart of generating a second query statement provided by an exemplary embodiment of the present application;
[0024] Figure 6 is a flowchart of another retrieval processing method provided by an exemplary embodiment of the present application;
[0025] Figure 7 is a structural schematic diagram of a retrieval processing device provided by an exemplary embodiment of the present application;
[0026] Figure 8 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] The present application proposes a retrieval processing scheme, which relates to a retrieval processing system, method and related equipment. In the scheme: a computer device can obtain a first query statement to be retrieved, and identify a target word belonging to a target field from the obtained first query statement. The target word is a word with professionalism in the target field. Thus, through the word recognition of the target field, it is possible to focus on specific words belonging to the target field in the first query statement, avoid illusion problems during optimization, improve optimization accuracy, and solve problems affecting retrieval quality in the first query statement. By performing semantic expansion processing on the target word, at least one expansion word belonging to the target field can be obtained. These expansion words and the target word belong to the same field, and the expansion word is also a proprietary word in the target field, with a higher degree of standardization. Using these expansion words for the optimization processing of the first query statement is conducive to improving the accuracy of the proprietary words in the target field, standardizing the words belonging to the target field in the first query statement, and having a good optimization effect. The optimized query statement obtained by optimization can supplement the proprietary words in the target field to improve integrity because the expansion words belonging to the target field are added. At least one optimized query statement is used for retrieval processing. Even if the quality of the first query statement is low, by optimizing the query statement, the effect of the query statement for retrieving the content in the target field can be improved, the retrieval accuracy can be improved, and good application effects can be achieved in the target field.
[0029] The first query statement refers to the original query statement input by the user (which can be recorded as the original query) or the original query statement extracted based on the user input. The first query statement can be a question content, and the first query statement can be used to indicate the user's question intention. For example, the first query statement is the following text content: "Can I still buy it at 00700?" It should be noted that the terms "first", "second", etc. in this application are used to distinguish between the same or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", and there is no limitation on the quantity and execution order.
[0030] The first query statement may include a target word belonging to the target domain. The so-called target domain refers to a field in at least one field; the target domain may include but is not limited to any of the following: financial field, medical field, textile field, game field, education field, scientific research field, etc. The target word may be an entity word or an alias of an entity word. For example, the target word belonging to the target domain in the first query statement of the above example is 00700, which is an alias of a standardized entity name in the financial field. It is understood that the term "at least one" in this application means one or more, and the meaning of "multiple" means two or more; for example: at least one extended word refers to the one, two or more extended words. Both the extended word and the target word belong to the target domain, and the extended word and the target word are semantically related. For example, the extended word is an implicit entity word of the target word. As a proprietary word in the target domain, the extended word has a standardized name, and the extended word can be used to describe the entity object; and for a certain entity object, its corresponding extended word can change, and the standardization degree of the extended word can be higher than the standardization degree of the target word.
[0031] The retrieval processing scheme provided in this application can be applied to market consultation scenarios, various search scenarios (such as web search, e-commerce search, advertising search, etc.), various retrieval tasks in the target field, and various question-and-answer scenarios. For example, in a question-and-answer scenario based on a large language model, in order to solve problems such as accuracy and timeliness in practical applications, the retrieval-augmented generation (RAG) technology can be used to improve the accuracy of the answer in the process of generating answers using a large model. The RAG technology aims to retrieve relevant information from an external knowledge base before answering questions using a large language model LLM, where a knowledge base is a system for storing and organizing knowledge, which can be a database, document collection, website, or other form of information storage medium. The knowledge in the knowledge base can be structured (such as tabular data in a relational database) or unstructured (such as text files, web page content). The knowledge base can store knowledge in at least one field, including but not limited to: knowledge in the fields of finance, medicine, textiles, education, scientific research, and so on. The retrieved relevant information and the query statement are used together to generate answers for the model. Before the user enters the query statement and searches the knowledge base based on the query statement, the query statement entered by the user can be optimized through the retrieval processing method provided by this application. The optimized query statement can be applied to the process of searching the knowledge base in the RAG technology to improve the accuracy of subsequent retrieval results. For example, in a market consultation scenario, after the user enters the query statement, the original query statement can be used as the first query statement according to the logic of this solution and target word recognition, target word expansion and optimization processing can be performed on it in turn to obtain an optimized query statement. The optimized query statement is used to retrieve relevant knowledge from the knowledge base, and then the corresponding answer is output based on the retrieved knowledge. For another example, in a web search scenario, when an Internet user uses the web search function, he or she can enter the search content in the search bar. Through the present application, the search content can be used as the first query statement, thereby identifying the target words belonging to the target field in the search content and performing semantic expansion. The expanded words obtained by the expansion can optimize the search content. The optimized search content can be used as a supplement to the original search content, and work together with the original search content to recall relevant documents. Then, the correlation between the recalled relevant documents and the original search content can be determined, and the relevant documents can be output in sequence on the web page according to the correlation from high to low.
[0032] The architecture of the retrieval processing system provided in the embodiment of the present application will be introduced below in conjunction with the accompanying drawings.
[0033] See also Figure 1 , Figure 1 is an architecture diagram of a retrieval processing system provided by an exemplary embodiment of the present application. Figure 1As shown, the retrieval processing system includes a terminal device 101 and a server 102; the terminal device 101 can establish a communication connection with the server 102 by wired or wireless means. Among them, the terminal devices include but are not limited to: smart phones, tablet computers, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, vehicle-mounted terminals, smart cameras, virtual reality devices and other devices, and this application does not limit this. This application does not limit the number of terminal devices. Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but is not limited to this. This application does not limit the number of servers.
[0034] The retrieval processing method provided in the present application may be executed by one or both of the terminal device 101 and the server 102. The following takes the server 102 executing the method provided in the present application as an example to introduce the general process of the method.
[0035] (1) The server 102 may obtain a first query statement to be retrieved. In one implementation, the first query statement may be a query statement input by a user through the terminal device 101. After receiving the first query statement, the terminal device 101 may send it to the server. For example, an intelligent platform is installed on the terminal device, and the user may ask questions in the intelligent dialog box of the intelligent platform. The question content is the first query statement. The first query statement may be displayed in the interface of the intelligent platform and sent to the server 102 via the terminal device. In another implementation, the first query statement may be obtained by the server 102 from a database. The database is used to store various query statements to be retrieved. These query statements may be sent to the database by different terminal devices and queued for processing.
[0036] (2) The server 102 can identify a target word belonging to the target field from the first query statement. For example, if the first query statement includes entity words in the financial field, then the identified target word is the entity word in the financial field. After identifying the target word, the server 102 can perform semantic expansion on the target word to obtain an expanded word belonging to the target field, which is semantically related to the target word and belongs to the same field. For example, when an entity word in the financial field is identified, other aliases of the entity object described by the entity word can be used as the expanded word during expansion.
[0037] (3) The server 102 optimizes the first query statement based on the expanded word, and specifically, may rewrite the first query statement or expand the first query statement to obtain at least one optimized query statement.
[0038] (4) At least one optimized query statement is used for retrieval processing. The retrieval results obtained through the retrieval processing can be returned by the server 102 to the terminal device 101. The terminal device 101 can directly display the retrieval results or display them after processing the retrieval results.
[0039] It should be noted that when the solution provided by the present application is jointly executed by the terminal device 101 and the server 102, in one implementation, the terminal device 101 can obtain the first query statement to be retrieved, and send the first query statement to the server 102, and the server 102 is responsible for the identification of the target word in the target field, the expansion of the target word, and the optimization and retrieval processing of the first query statement. In another implementation, the terminal device 101 can be responsible for the acquisition of the first query statement, the identification of the target word, and the first query statement and the identified target word are sent to the server 102, and the server 102 is responsible for the optimization of the first query statement and the content of the retrieval processing. This can reduce the processing pressure of the server 102 and improve the optimization efficiency.
[0040] The retrieval processing system provided by the present application can identify the target words belonging to the target field in the first query statement, and semantically expand the target words to obtain more extended words belonging to the target field. Since these extended words are proprietary words in the target field, the first query statement is optimized based on these extended words, which can improve the completeness of the proprietary words in the target field contained in the query statement used for retrieval and enhance the proprietary words in the target field. Moreover, for content retrieval in a highly professional target field, no matter what quality of the first query statement is obtained, the quality of the original query statement can be improved from the source. The optimized query statement has a more professional retrieval dimension, which can improve the accuracy and recall rate of retrieval in the target field.
[0041] The term "module" or "unit" in this application refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0042] Next, the retrieval processing method provided in the embodiment of the present application is introduced.
[0043] See also Figure 2, is a flowchart of a search processing method provided by an exemplary embodiment of the present application. The search processing method can be performed by a computer device (such as Figure 1 The retrieval processing method may include the contents shown in S201-S204.
[0044] S201: Obtain a first query statement to be searched.
[0045] In a specific implementation, the computer device can determine the question / question (query) input by the user as the first query statement to be retrieved, and the first query statement can be recorded as q or called the original query. For example, in a consulting scenario based on an intelligent platform, the user can enter the question content in the dialog box, and the question content is used as the first query statement to be retrieved. The first query statement can be obtained in a target scenario, and the target scenario is a scenario related to the target field. For example, the target field is the financial field, and the target scenario can be a financial advisor scenario, a digital asset consulting scenario, and so on. Because in the real scenario, the first query statement has typos, unclear references, low quality and other problems, which have a great impact on the accuracy and recall rate of the retrieval. Therefore, before using the first query statement directly for retrieval, it is necessary to optimize the first query statement and use the optimized query statement for retrieval to improve the retrieval accuracy.
[0046] S202: Identify a target word belonging to a target domain from the first query statement, and perform semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain.
[0047] In a specific implementation, the first query statement includes a target word belonging to the target domain, and the computer device can perform recognition processing on the first query statement to obtain at least one target word belonging to the target domain in the first query statement. Optionally, the recognized at least one target word can be stored in a target word list, and the target word list can be recorded as w:{w1,w2,……,w n}, n∈[1,N], N is a positive integer, that is, the target word list includes N target words belonging to the target domain.
[0048] In one embodiment, the recognition process can be performed by calling a first language model by a computer device. The first language model has the function of extracting words belonging to any field, and therefore, can also be called a word extraction model. The first language model can be a large language model (denoted as LLM). entity) or non-large language models. Among them, the large language model is a large-scale artificial intelligence model designed to understand and generate human language. The billions of parameters it contains can effectively solve complex natural language processing tasks such as text summarization, text translation, and sentiment analysis through training with massive data; non-large language models are, for example, other traditional models, such as the BERT model.
[0049] Since the target words identified as belonging to the target domain are all in the original first query statement, they may not be standardized, nor have synonyms and related words been expanded. In order to further improve the optimization performance of the first query statement, for any target word w in the target word list, n , the computer equipment can be used to target word w n Perform semantic expansion processing to obtain at least one expanded word. The at least one expanded word and the target word w n Corresponding, and each expansion word corresponds to the target word w n There is semantic relevance between them, where semantic relevance includes semantic identity and semantic similarity. Optionally, at least one expansion word belonging to the target domain can also be stored in an expansion word list, which can be recorded as For example, if two target words are identified (respectively target word a1 and target word a2), then by semantically expanding each target word, three expansion words corresponding to target word a1 and two expansion words corresponding to target word a2 can be obtained. However, for the convenience of description and understanding, this application takes one target word as an example for exemplary description.
[0050] In one implementation, semantic expansion processing may include normalization processing and expansion processing. Normalization processing refers to replacing the target word with a standard expression through synonyms, and expansion processing may include mining high-frequency co-occurrence words related to the target word through association rules, retrieving words similar to the target word based on similarity, and so on. In this way, each expanded word obtained through semantic expansion processing is also a standardized entity word in the target field. For example, the standardized entity names commonly used in research reports and financial reports corresponding to "Company A" include "Company A Holdings", "SH00700", etc., and the aliases include 00700, etc. The target word belonging to the target field can be a word that describes an entity object in the target field, and supports changes with the content of the entity object. For example, as digital assets in the financial field change frequently, entity words and their aliases also change accordingly.
[0051] In one embodiment, a computer device can call a word expansion model to perform one or more of the following processes: ① replace a target word with a synonym to obtain a replaced synonym; ② perform word meaning expansion processing on the target word to obtain an expanded related word. Based on the processing content of ① and ② executed, one or a combination of the replaced synonym and the expanded related word can be determined as at least one expanded word belonging to the target domain. Among them, the word expansion model can be a large language model or other models. The word expansion model can be obtained by training the initial word expansion model through training data. The training data includes at least one phrase pair belonging to the target domain, and each phrase pair includes a sample word belonging to the target domain and one or more reference words; the sample word and the reference word are both words belonging to the target domain. The reference word is obtained by expanding the sample word, and the reference word and the sample word are semantically related. In this way, the semantic expansion of the target word through the word expansion model can automatically and quickly generate expanded words related to the target word, which is efficient.
[0052] S203: Optimize the first query statement based on at least one expanded word to obtain at least one optimized query statement.
[0053] In one implementation, since the first query statement may not be standard and affect subsequent recall, the first query statement may be rewritten and / or expanded in combination with the expanded extended words to obtain at least one optimized query statement, which is recorded as Where k is a positive integer. The optimization processing of the first query statement includes but is not limited to one or more of the following: rewriting the first query statement and expanding the first query statement. Among them, the logic of rewriting the first query statement can be: keeping the semantics of the first query statement unchanged, adding the expansion word to the original first query statement, and obtaining an optimized query statement. The logic of expanding the first query statement can be: taking the first query statement as the subject, expanding the search dimension of the first query statement based on the expansion word, and realizing the supplement of the search dimension.
[0054] In step S202, the number of extended words obtained through semantic expansion is M, where M is a positive integer; each optimized query statement obtained after optimization processing includes one or more extended words among the M extended words, that is, one optimized query statement includes some or all extended words; the retrieval dimension of the optimized query statement is greater than that of the first query statement, so that the retrieval dimension of the optimized query statement is clearer and richer, and the addition of extended words can also provide a supplementary basis for retrieval. For example, in the financial investment consulting scenario, the target word is Company A, the extended word is 00700, the first query statement is "How is Company A?", and the optimized query statement is "Please evaluate Company A from the aspects of company valuation level, profitability, main business, etc., 00700". It can be seen that compared with the first query statement, the optimized query statement has added extended words and has a more detailed retrieval dimension, and detailed questions and supplements are asked around the subject content of the first query statement. Compared with using the first query statement to retrieve knowledge bases such as research reports and financial reports, using the optimized query statement for knowledge base retrieval can obtain more accurate retrieval results and improve the recall rate and accuracy of the retrieval.
[0055] Rewriting and expanding the first query statement based on the extended words has the following benefits: ① Users often do not directly enter the standardized entity name in the original query statement, but abbreviations, aliases or even typos. Some query statements without obvious entities actually contain implicit entities, such as the following question: "How is entity A recently?" The implicit entities of "entity A" should include nouns such as "entity B" and "entity C". The extended words obtained by expanding the target words are to fully mine some target words with corresponding implicit entity words. Rewriting the first query statement based on the addition of these implicit entity words can improve the completeness of the proprietary words in the original query statement, effectively utilize the proprietary words in the target field, and cover more retrieval dimensions. ② Since there are many proprietary words in the target field, by identifying the target words belonging to the target field in the first query statement and supplementing them through expansion, and then rewriting the query statement through the extended words, this pays attention to the proprietary words belonging to the target field, greatly reducing the probability of hallucinations and errors during rewriting.
[0056] In one embodiment, the optimization process may be performed by the computer device calling the second language model, and the second language model may be a large language model (denoted as LLM query ) or other language models (such as BERT model). Since the second language model has the function of optimizing the original query sentence, based on the optimization processing, it can be one or more of rewriting and expansion, and the second language model can be called a sentence rewriting and expansion model.
[0057] It is worth noting that if the first query statement includes target words in one or more fields, then the target words belonging to each field can be identified through the above steps, and the extended words corresponding to the target words in each field can be expanded. The first query statement is optimized based on these extended words, and the extended words included in the obtained optimized query statement can correspond to the target words in different fields respectively. For example, the target words belonging to the financial field and the target words belonging to the medical field in the first query statement are identified, then the target words belonging to the financial field can be semantically extended to obtain the extended words belonging to the financial field, and the target words belonging to the medical field can be semantically extended to obtain the extended words belonging to the medical field; then the first query statement is optimized based on the extended words belonging to the financial field and the extended words belonging to the medical field, and the obtained optimized query statement can include the extended words belonging to the financial field and the extended words belonging to the medical field.
[0058] S204: Use at least one optimized query statement to perform retrieval processing.
[0059] In a specific implementation, at least one optimized query statement may be directly used for retrieval processing, or at least one optimized query statement may be post-processed (eg, concatenated) to obtain a new query statement q ′ , and then perform retrieval processing based on the new query statement. In this way, the new query statement obtained by post-processing is the query used for retrieval. During the retrieval process, the optimized query statement or the new query statement can be used as the retrieval basis to search from the knowledge base. The retrieved knowledge can be directly output or sorted before output. For example, the relevance of the retrieved knowledge and the query statement used for retrieval is calculated, and the knowledge is sorted according to the relevance and then output. The specific presentation form of this knowledge can be documents, images, etc., and the knowledge belongs to the target field and can be used as the answer content of the first query statement.
[0060] In order to better understand the above content, take the method provided in this application as an example of applying it to the market consultation scenario of the relevant financial platform. Figure 3The flowchart of the retrieval process shown in the figure is used as an example. Specifically, the relevant financial platform can provide customer service, and users can ask questions in the customer service dialog box, consult about changes in the financial market, and obtain investment advice. For example, the user enters the original query statement query, the specific content of which is: "How is Company A". According to this solution, the original query statement is used as the first query statement, and the first query statement can be optimized to obtain an optimized query statement. The optimization here can be a query statement modification and expansion. The specific content of the optimized query statement is: "Please analyze 00700.hk, Company A from the aspects of main business, industry status, and profitability". The optimized query statement is then used to retrieve relevant knowledge in the knowledge base. The retrieved relevant knowledge and the optimized query statement can be merged, and the answer can be generated and output through the language model. The specific content of the answer output by the large model based on the retrieved knowledge is: "Hello, Company A mainly engages in games, audio and video and other businesses. It is one of the top 10 companies in the industry. Last year's financial report showed that the net profit reached 30%".
[0061] The retrieval processing method provided in the embodiment of the present application identifies the target words belonging to the target field in the first query statement, and semantically expands the target words to obtain more extended words belonging to the target field. Since these extended words are proprietary words in the target field, the first query statement is optimized based on these extended words, which can improve the completeness of the proprietary words in the target field contained in the query statement used for retrieval and enhance the proprietary words in the target field. Moreover, for content retrieval in a target field with high professionalism, no matter what quality of the first query statement is obtained, the quality of the original query statement can be improved from the source. The optimized query statement has a more professional retrieval dimension, which can improve the accuracy and recall rate of retrieval in the target field.
[0062] The retrieval processing scheme provided in this application involves artificial intelligence (AI) technology, which is a comprehensive discipline involving a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model is also called a large model or a basic model, which can be widely used in downstream tasks in various major directions of artificial intelligence after fine-tuning. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. This application is particularly related to natural language processing (NLP) technology. Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing involves natural language, that is, the language used by people in daily life, and is closely related to linguistic research; it also involves computer science and mathematics, and important technologies for model training in the field of artificial intelligence. The pre-trained model is developed from the large language model (Large Language Model) in the field of NLP. After fine-tuning, the large language model can be widely used in downstream tasks. For example, the above-mentioned identification of target words belonging to the target field in the first query sentence and optimization of the first query sentence can be executed by calling the relevant language model, which can be the fine-tuned large language model.
[0063] See also Figure 4 , is a flowchart of another retrieval processing method provided by an exemplary embodiment of the present application. The retrieval processing method can be performed by a computer device (such as Figure 1 The retrieval processing method may include the contents shown in S401-S405.
[0064] S401: Obtain a first query statement to be searched.
[0065] S402: Identify a target word belonging to a target domain from the first query statement, and perform semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain.
[0066] In one embodiment, when the computer device identifies the target word belonging to the target domain from the first query statement, it can specifically perform the following steps 1.1 to 1.3.
[0067] Step 1.1, get the extraction task prompt information.
[0068] In one implementation, the computer device can obtain the extraction task prompt information from the system setting (system prompt), or the user can select a model to play a role and select a corresponding task to automatically generate the extraction task prompt information. The user can also directly input the extraction task prompt information, for example, a document that records the extraction task prompt information can be directly imported from the local computer.
[0069] The extraction task prompt information is used to indicate the word extraction rules; optionally, the word extraction rules may specify the entity words in the target field to be extracted and the content that is prohibited from being extracted. Exemplarily, the extraction task prompt information is shown in Table 1 below:
[0070] Table 1 Extraction task prompt information
[0071]
[0072]
[0073] As shown in Table 1 above, the word extraction rule indicated by the extraction task prompt information stipulates that only financial nouns are extracted without extracting common words and verbs. In addition, the extraction task prompt information also includes role information "senior financial editor" and the output format requirements of the target words, that is, "2. ... Use Chinese commas to separate the output...". Through this extraction task prompt information, guidance and direction can be provided for the first language model to extract the target words belonging to the target field in the first query statement.
[0074] Step 1.2: Call the first language model, perform word extraction processing on the first query statement according to the word extraction rule indicated by the extraction task prompt information, and obtain at least one entity word belonging to the target domain.
[0075] In a specific implementation, the first language model may be a large language model LLM and may be denoted as LLM entity . Since LLM has powerful reasoning ability and world knowledge, selecting LLM can more accurately extract the target words belonging to the target field in the first query statement. To further improve performance, an LLM with a smaller parameter amount (for example, the parameter amount is less than the preset parameter amount) can be selected, such as selecting an open source model with a parameter amount of 7B ("B" means 1 billion). In addition, the extraction task prompt information can be input into the model as a prompt, and the first query statement will also be input into the model; the computer device calls the first language model, and according to the word prompt rule, at least one entity word belonging to the target field in the first query statement can be extracted, and these entity words are the target words. For example, the input query is: "Is A or B better?", and the extraction result of LLM is "A, B".
[0076] In one implementation, the first language model may be a language model obtained through pre-training. In another implementation, in order to further improve the application effect in the target field, the first language model is obtained by training a reference language model under a first training task using first scene annotation data, and the reference language model is a language model obtained through pre-training. The first scene annotation data includes at least one reference query statement, each reference query statement carries a corresponding first category label, and the first category label is used to indicate the words in the corresponding reference query statement that belong to the target field; the task content of the first training task is indicated by the first prompt information.
[0077] Optionally, the reference language model can be a pre-trained large language model, and the first language model is a large language model that is fine-tuned based on the reference language model based on specific data (i.e., the first scene annotation data); by constructing the first scene annotation data as training data to perform supervised fine-tuning on the reference language model, the scene application effect can be improved. The first scene annotation data can be obtained by manual annotation, and the form of the first scene annotation data is shown in Table 2 below:
[0078] Table 2 Annotated data for the first scene
[0079]
[0080] As shown in Table 2 above, the first-scenario annotation data includes a reference query statement query, specifically: "Can 00700 still be bought?", and the corresponding first category label is the word "00700" belonging to the target field in the reference query statement. In the fine-tuning stage, the first prompt information and the first-scenario annotation data can be input into the model together, and the input of the first prompt information can guide the fine-tuning of the reference language model. Each reference query statement uses the same first prompt information. For example, the specific content of the first prompt information in the table above is: You are a senior financial editor, please follow the following requirements to extract financial nouns in [query]: 1. Only extract financial nouns, do not extract common words (such as "expert", "business") and verbs (such as "buy", "sell") 2. If there are multiple financial nouns, please use Chinese commas to separate the output. If not, please output "none".
[0081] In another implementation, if the first language model is not a large language model, the first language model can be directly called to perform word extraction processing on the first query sentence to obtain at least one entity word belonging to the target domain. The first language model has the ability to directly identify the entity words in the target domain without providing prompt information for guidance.
[0082] Step 1.3: Determine at least one entity word belonging to the target domain as a target word belonging to the target domain. All entity words belonging to the target domain identified by the model can be used as target words belonging to the target domain, so that the target words belonging to the target domain include at least one entity word belonging to the target domain.
[0083] The recognition logic shown in the above steps 1.1 to 1.3 is also a kind of word extraction logic, which can accurately and completely identify the target words belonging to the target domain in the first query statement through the language model with powerful inference ability and world knowledge. Optionally, the above recognition processing can be performed by a target word extraction module in the computer device, and the target word extraction module can call a smaller language model (such as a 7B parameter LLM) trained with the first scene annotation data to extract the target words belonging to the target domain in the first query statement, so as to achieve accurate and fast extraction of the target words.
[0084] In one embodiment, when the computer device performs semantic expansion processing on the target word and obtains at least one expanded word belonging to the target domain, it can be specifically executed according to the following steps 2.1 to 2.2.
[0085] Step 2.1: Determine the target vocabulary based on the target domain to which the target word belongs.
[0086] The target vocabulary is a vocabulary used to store standard words belonging to the target field; the target vocabulary stores one or more standard words belonging to the target field. Among them, standard words can also be called proprietary words, which refer to standardized professional terms / entity words in the target field; the target vocabulary is adapted to the target field. For example, if the target field is the financial field, then the target vocabulary is a financial proprietary vocabulary, that is, it stores proprietary words in the financial field; if the target field is the medical field, then the target vocabulary is a medical proprietary vocabulary, that is, it stores proprietary words in the medical field; if the target field is the textile field, then the target vocabulary is a textile proprietary vocabulary, that is, it stores proprietary words in the textile field.
[0087] In one implementation, a vocabulary for storing proprietary words belonging to a corresponding field can be pre-built. Each vocabulary carries a corresponding field label, which is used to indicate a field that is adapted to the vocabulary. The computer device can determine a vocabulary carrying a target field label from at least one vocabulary according to the target field, and the vocabulary carrying the target field label is the target vocabulary; wherein the target field label is used to indicate that the field adapted to the vocabulary is the target field. Through the adaptation between the field label and the field, the target vocabulary can be determined quickly and accurately to improve the expansion efficiency.
[0088] Step 2.2: Search the target word in the target word library to obtain at least one extended word belonging to the target field.
[0089] In a specific implementation, the standard words and search words belonging to the target field are stored in association in the target word library, and the target word is used as a search basis. The target word and the search word can be compared, and at least one standard word associated with the target word can be retrieved from the target word library, and then the at least one retrieved standard word is determined as at least one extended word belonging to the target field. By retrieving the extended word associated with the target word from the target word library, the target word is expanded.
[0090] In one embodiment, the target word library stores standard words in the target field through a predefined word list; the predefined word list includes at least one search group, each search group includes a search word and at least one standard word. The search word and the extended word can be stored in association through the search group, and this associated storage method can correspond to the search method of the inverted index, that is, the key is the search word, the value is the standard word expanded from the search word, and the value is obtained based on the key search. Exemplarily, the content of the predefined word list in the target word library is shown in Table 3 below.
[0091] Table 3 Predefined vocabulary
[0092] Entries Extension word 00700 00700.hk, Company A Holdings, Company A Nvidia NVDA, NVIDIA Asset Object B entity, C entity …… ……
[0093] As shown in Table 3 above, the field value corresponding to the entry field is the search term, and the field value corresponding to the extended term field is the standard term. A search term and related standard terms can constitute a search group, such as {asset object, B entity, C entity}, which includes a search term and two standard terms.
[0094] Based on this, when executing the above steps, the computer device can perform the following contents shown in ①-②: ① According to the target word, query the predefined word table to obtain a candidate search group. ② Determine at least one standard word included in the candidate search group as at least one extended word belonging to the target field.
[0095] In the specific implementation, for the target word w n , M extended words can be retrieved from the predefined vocabulary, denoted as Since the target word and the standard word are stored in association, the candidate search group can be queried from the predefined word list according to the matching degree between the target word and the search word. The search word included in the candidate search group is the target word, and then the standard words included in the candidate search group can be determined as extended words. For example, if the target word is 00700, then with 00700 as the search basis, the retrieved standard words include: 00700.hk, A Company Holdings, A Company. These standard words are extended words related to the target word.
[0096] It can be understood that if the number of target words in the first query statement that belong to the target domain is N, then for the target word list w: {w1, w2, ..., w n For each target word in}, the corresponding expansion word can be retrieved from the predefined word list in the above manner. Specifically, the predefined word list can be retrieved one by one based on the inverted index to obtain a normalized and expanded expansion word list.
[0097] The above steps 2.1-2.2 perform semantic expansion processing on the target word based on the target word library, which can be executed by a semantic expansion module in the computer device, and the semantic expansion module can be used to achieve normalization and expansion. If the words in the target field (such as industry sectors, product names, etc.) are relatively closed, by constructing a predefined word list in the target field, the extracted target words can be standardized and modified and synonyms expanded.
[0098] S403: Optimize the first query statement based on at least one expanded word to obtain at least one optimized query statement.
[0099] In one embodiment, the specific implementation of step S403 includes the following steps 3.1 to 3.4.
[0100] Step 3.1, obtain optimization task prompt information.
[0101] In one implementation, the computer device can obtain the optimization task prompt information from the system setting (system prompt), or the optimization task prompt information can be automatically generated after the user selects a model to play a role and selects a corresponding task. The user can also directly input the optimization task prompt information, for example, a document containing the optimization task prompt information can be directly imported from the local computer.
[0102] The optimization task prompt information is used to indicate the optimization rules, and the optimization rules include preprocessing rules and rewriting rules. The preprocessing rules specify the way to preprocess the first query statement, and the rewriting rules specify the direction to optimize the first query statement. Exemplarily, the optimization task prompt information is shown in Table 4 below.
[0103] Table 4 Optimization task prompt information
[0104]
[0105] As shown in Table 4 above, the preprocessing rules indicated by the optimization task prompt information include: "1. Combined with Chinese language... 2. Remove q... all semantic information". In addition, the optimization rules indicated by the optimization task prompt information stipulate the optimization method and optimization quantity, namely: "3. Combined with given... standard and comprehensive". In addition, the optimization task prompt information also stipulates the output format of the optimized query statement. The optimization task prompt information, at least one extended word and the first query statement can all be used as model inputs; the optimization task prompt information can be used to provide guidance for the model to optimize the first query statement, and the at least one extended word and the first query statement are the data to be processed by the model.
[0106] Step 3.2: Call the second language model, and preprocess the first query statement according to the preprocessing rules indicated by the optimization task prompt information to obtain a preprocessed first query statement.
[0107] In the specific implementation, preprocessing includes but is not limited to: anomaly detection processing, redundancy removal processing, conversion processing (such as full-width and half-width, uppercase and lowercase, simplified and traditional Chinese conversion), removal processing (such as meaningless symbol removal, over-length truncation, etc.). The specific content of preprocessing can be specified in the preprocessing rules.
[0108] In one implementation, based on the preprocessing rules indicated by the optimization task prompt information, any one or more of the following preprocessing can be performed: ① Performing anomaly detection processing on the first query statement, and correcting the detected abnormal characters to obtain a corrected first query statement. The anomaly detection processing here specifically detects whether there are abnormal characters in the first query statement, and the abnormal characters include but are not limited to: typos, incorrect entity names, etc. If abnormal characters are detected, the detected abnormal characters can be corrected to normal characters, and the corrected first query statement does not include the abnormal characters. ② Performing redundancy removal processing on the first query statement to obtain a first query statement after redundancy removal. Here, the redundancy removal processing can be removing redundant expressions in the first query statement while retaining all the semantic information of the first query statement, so that the information difference between the semantic information of the first query statement after redundancy removal and the semantic information of the first query statement is less than the preset information difference, and the preset information difference is used to ensure that the semantics between the first query statement after redundancy removal and the first query statement are in line with expectations, such as being close to or completely the same. Based on the above ① and ②, the computer device can determine the corrected first query statement as the preprocessed first query statement, or determine the first query statement after redundancy removal as the preprocessed first query statement, and the preprocessed first query statement includes one or more of the following: the corrected first query statement and the first query statement after redundancy removal. Furthermore, the first query statement can also be subjected to anomaly detection processing and redundancy removal processing in sequence. For example, after the first query statement is subjected to redundancy removal processing, the first query statement after redundancy removal is subjected to anomaly detection processing to obtain the preprocessed first query statement.
[0109] Step 3.3: rewrite the preprocessed first query statement using at least one expansion word according to the rewriting rule indicated by the optimization task prompt information through the second language model to obtain at least one rewritten first query statement.
[0110] In one implementation, the rewriting rules include at least one reference rewriting direction. For example, the rewriting rule indicated by the optimization task prompt information is: Please expand the query from one or more dimensions such as main business, industry status, profitability, valuation level, development prospects, and investment value. For example, the above-mentioned "main business, industry status, profitability, valuation level, development prospects, and investment value" are reference rewriting directions. The reference rewriting direction can be determined based on the semantics of the first query statement. For example, the first query statement is: How about Company A. Then the reference rewriting direction can be different questioning dimensions / retrieval dimensions determined around Company A. The number of extended words is M, and M is a positive integer. Based on this, when the computer device executes the above step 3.3, it specifically executes the following steps 3.3.1-3.3.2.
[0111] Step 3.3.1. Determine at least one target rewriting direction based on the reference rewriting directions included in the rewriting rules. Specifically, at least one reference rewriting direction may be randomly arranged and combined to obtain at least one target rewriting direction, each target rewriting direction including one or more reference rewriting directions. For example, the above-mentioned "main business and industry status" may be a target rewriting direction, and "valuation level and development prospects" may be a target rewriting direction. Optionally, the rewriting rules may also specify the number of rewritings, and the number of target rewriting directions may be equal to the number of rewritings, so as to obtain a rewriting query statement with a specified number of rewritings.
[0112] Step 3.3.2: According to at least one target rewriting direction, one or more of the M expansion words are used to modify the preprocessed first query statement to obtain at least one rewritten first query statement.
[0113] Each rewritten first query statement corresponds to a target rewriting direction, and different rewritten first query statements correspond to different target rewriting directions. For example, if the target rewriting direction is: "Main business, industry status and profitability", the first query statement is: "Can 00700 still be bought?", and the extended words include: "00700.hk, A Company Holdings, A Company", then the query statement obtained after the first query statement is expanded using some extended words is: "Please analyze 00700.hk, A Company from the aspects of main business, industry status, profitability, etc.". If the target rewriting direction is: "Investment value", then the query statement obtained after the first query statement is expanded using all extended words is: "A Company, A Company Holdings, what is the investment value of 00700". It can be seen that in the process of rewriting based on the target rewriting direction and extended words, the target rewriting direction can be specifically combined with the extended words to combine a query statement with extended semantics as the expanded first query statement. Based on this, the rewritten first query statement is semantically related to the first query statement, and the rewritten first query statement can be used as a supplement to the first query statement. For example, the first query statement in the example is: "Is 00700 still worth buying?" The rewritten first query statement combines different new query statements from the main business, industry status, profitability, valuation level, development prospects, etc. These new query statements can be used to query relevant content from multiple dimensions in order to give an accurate answer to whether 00700 is worth buying.
[0114] In one implementation, the second language model may be a language model obtained through pre-training, such as a large language model after pre-training. In another implementation, the second language model is obtained by training the reference language model under the second training task through the second scene annotation data; the reference language model is a language model obtained through pre-training. Among them, the second scene annotation data includes at least one group of annotation data, each group of annotation data includes a reference query statement and at least one reference expansion word related to the reference query statement; each group of annotation data carries a second category label, and the second category label is used to indicate multiple reference optimized query statements, each reference query statement is optimized based on at least one related reference expansion word to obtain a corresponding reference query statement; the task content of the second training task is indicated by the second prompt information.
[0115] Similarly, in order to improve the scene application effect, the second scene annotation data can be constructed. The second scene annotation data can be obtained by manual annotation. Each group of annotation data included in the second scene annotation data includes a reference query statement and at least one reference expansion word. These reference expansion words can also be obtained by semantic expansion based on the words belonging to the target field identified from the reference query statement. The second category label carried by the second scene annotation data can be a reference optimized query statement or an identifier (such as a code) of the reference optimized query statement. Exemplarily, the second scene annotation data is shown in Table 5 below.
[0116] Table 5: Annotated data for the second scene
[0117]
[0118]
[0119] The second scenario annotation data shown in Table 5 above includes relevant financial terms and the original query, and also includes the carried second category label, specifically including the specific content of the three modified and expanded query statements; each annotation data in the second scenario annotation data uses the same second prompt information, and the second prompt information and the second scenario annotation data can be input into the model together, wherein the second scenario annotation data can be used as training data for supervised fine-tuning of the reference language model, and the second prompt information can provide guidance for the fine-tuning of the reference language model. Specifically, the second language model can rewrite and expand the reference query statement included therein based on the given reference expansion words in the second scenario annotation data based on the indication of the second prompt information, and obtain a predicted query statement, and the difference between the predicted query statement and the reference optimized query statement can be used to adjust the reference language model. The second prompt information is used to indicate the task content of the second training task, and the task content of the second training task includes optimizing the reference query statement in the second scenario annotation data in combination with the given reference expansion words.
[0120] Step 3.4: determine at least one rewritten first query statement as an optimized query statement.
[0121] The optimized query statement obtained after the optimization process includes at least one rewritten first query statement.
[0122] The optimization processing logic shown in the above steps 3.1 to 3.4 can specifically be a rewriting and expansion logic. Optionally, the optimization processing can be performed by a rewriting and expansion module in a computer device, which rewrites and expands the first query statement by using a smaller-scale language model (such as a 7B-scale large language model LLM) trained with the second scene annotation data, and combines normalized proprietary words and expanded synonyms to enhance the professionalism of the entity words belonging to the target field in the original first query statement, thereby achieving the refinement of the first query statement and expressing the meaning of the first query statement from more dimensions.
[0123] S404: reorganize the query statements according to the at least one optimized query statement to obtain a second query statement, and search from the knowledge base according to the second query statement to obtain a search result.
[0124] In one implementation, when the computer device reorganizes the query statement according to at least one optimized query statement to obtain the second query statement, it can specifically execute any one of the following contents (1)-(4).
[0125] (1) Concatenate at least one optimized query statement to obtain a second query statement.
[0126] Specifically, after the above optimization process obtains multiple optimized query statements, the multiple optimized query statements can be directly concatenated to obtain a second query statement. That is, the second query statement is obtained by concatenating at least one optimized query statement, and the second query statement q′=concat(q e ), where concat means concatenation, q e Represents a list of optimized query statements. The specific optimized query statements can be expressed as
[0127] (2) Concatenate at least one optimized query statement with the first query statement to obtain a second query statement.
[0128] Specifically, no matter one or more optimized query statements are obtained through optimization, the obtained optimized query statement can be concatenated and merged with the first query statement, that is, the second query statement q′=concat(q,q e ), where concat represents concatenation, q represents the first query statement, and q eRepresents a list of optimized query statements. The specific optimized query statements can be expressed as
[0129] For example, assuming that the first query statement is: "Is 00700 still worth buying?", after optimization processing, three optimized query statements can be obtained, namely, modification and expansion 1: "Please analyze 00700.hk, A Company Holdings, from the aspects of main business, industry status, and profitability." Modification and expansion 2: "Please analyze Company A, Company A Holdings, the valuation level and development prospects of 00700." Modification and expansion 3: "Company A, Company A Holdings, what is the investment value of 00700?", according to the logic of (2) above, the first query statement is spliced with each optimized query statement to obtain the second query statement q', which is specific: "Is 00700 still worth buying? Please analyze 00700.hk, A Company Holdings, from the aspects of main business, industry status, and profitability. Please analyze Company A, Company A Holdings, the valuation level and development prospects of 00700. Company A, Company A Holdings, what is the investment value of 00700?". The second query statement is obtained by concatenating at least one optimized query statement and the first query statement. In this way, the first query statement can be supplemented by at least one optimized query statement, thereby performing a more comprehensive retrieval.
[0130] (3) Retrieve relevant documents from the knowledge base according to at least one optimized query statement, call a content generation model, perform content generation according to the retrieved relevant documents and at least one optimized query statement, and obtain a second query statement.
[0131] In a specific implementation, relevant documents can be retrieved from the knowledge base based on at least one optimized query statement. In another specific implementation, a merged query statement can be first obtained based on at least one optimized query statement, specifically by directly concatenating at least one optimized query statement using the above method (1), or by concatenating at least one optimized query statement with the first query statement using the method (2). The merged query statement is not used as the second query statement, but as an input for retrieving relevant documents. Based on the merged query statement, a search can be first performed on the knowledge base, and the retrieved relevant documents can be used as reference content. The relevant documents refer to documents related to the merged query statement, that is, answers to questions, and can also be virtual documents. The retrieved relevant documents are input into a content generation model together with each optimized query statement; the content generation model is used to generate a new query statement based on at least one optimized query statement and the retrieved relevant documents. Exemplarily, a recall is first performed using the merged query statement, and based on the recalled 10 documents and the merged query statement, the model can generate 5 answers, and then the 5 answers are combined to obtain a new query and then a recall is performed to obtain a retrieval result.
[0132] This method is a method of combining an optimized query statement with a pseudo relevance feedback (PRF) method to obtain a second query statement. In addition, since the quality of the optimized query statement is higher than that of the first query statement, the quality of the relevant documents obtained by searching the knowledge base can be improved. The query statement is further optimized in combination with the model, so that the quality of the query statement used for retrieval is further improved.
[0133] (4) Based on the at least one optimized query statement, a text processing model is called to generate relevant documents, and information of the relevant documents is merged with the at least one optimized query statement to obtain a second query statement.
[0134] In one specific implementation, based on at least one optimized query statement, a text processing model can be called to generate the corresponding related documents respectively. In another specific implementation, a merged query statement can be first obtained based on at least one optimized query statement, and then the above-mentioned method (1) or (2) can be used for splicing processing to obtain a merged query statement. Then the text processing model is called to generate at least one related document based on the merged query statement. After obtaining the related documents, the implementation method of information merging can be: merge at least one optimized query statement and at least one related document to obtain a merged query statement. Then the merged query statement is determined as the second query statement for searching the knowledge base.
[0135] This method is a method of combining the optimization query statement with the Generative Relevance Feedback (GRF) method to obtain the second query statement. Since it does not rely on the quality of the first search and makes full use of the endogenous knowledge of the large language model, when the quality of the optimized query statement is already good, the quality of the generated pseudo-document will also be improved, thereby effectively improving the retrieval accuracy.
[0136] Based on the contents shown in (3) and (4) above, the following can be provided: Figure 5 The flowchart of the exemplary generation of the second query statement is shown. In the process combined with pseudo-relevance feedback PRF, the optimized query statement can be used to retrieve relevant documents from the knowledge base first, and then the retrieved relevant documents and the optimized query statement are combined, and the content generation model is called to process the content obtained by the information combination, and a new query statement is generated by the content generation model, and the new query statement is used as the second query statement. In the process combined with the generation of relevant feedback GRF, the text processing model can be called to generate relevant documents based on the optimized query statement, and the generated relevant documents and the optimized query statement are combined to obtain a new query statement, and the new query statement is used as the second query statement. The obtained second query statement is used to search the knowledge base, and the retrieved knowledge is the retrieval result.
[0137] Optionally, the processing of sentence reorganization can be performed by a post-processing module in a computer device. In the above method, the combined query statement obtained by concatenation can be used as the second query statement q', so that the combined query statement is directly used for knowledge base retrieval, or the combined query statement obtained by concatenation can be used as the input of the GRF and PRF modules to obtain the second query statement for retrieving the knowledge base.
[0138] S405: Search from the knowledge base according to at least one optimized query statement to obtain search results.
[0139] In a specific implementation, a search is performed from the knowledge base according to at least one optimized query statement to obtain the knowledge corresponding to each optimized query statement, and the knowledge corresponding to each optimized query statement is combined to obtain a search result. Specifically, if the number of optimized query statements is one, then the corresponding knowledge can be retrieved from the knowledge base according to the optimized query statement, and the retrieved knowledge is determined as the search result. If the number of optimized query statements is multiple, then the corresponding knowledge can be retrieved according to each optimized query statement, and then the knowledge is combined into a search result. For the execution of S404 or S405, an execution can be selected based on the user's selection of a corresponding search strategy, and the search strategy includes a separate search strategy and a combined search strategy. If a separate search strategy is selected, S404 is executed; if a combined search strategy is selected, S405 is executed.
[0140] The retrieval processing method provided in the embodiment of the present application can call the first language model to identify the target words belonging to the target field in the first query statement, and can also call the second language model to rewrite, expand, and other optimization processes on the first query statement based on the extended words, so as to obtain the modified and expanded query statement, and then obtain the second query statement for retrieval based on any selected retrieval strategy, such as a combined retrieval strategy, a separate retrieval strategy, etc., and perform retrieval processing based on the second query statement to obtain the retrieval result. Through such a retrieval processing flow, the quality of the query statement used for retrieval can be improved from the source, and there can be multiple ways to use the optimized query statement, which can further improve the accuracy and recall rate of the retrieval.
[0141] The content provided in the above S401-S405 embodiments is exemplified by taking the target field as the financial field. The first query statement is recorded as the original query. Figure 6The whole process is summarized as follows. ① The financial terms in the first query statement (i.e., the original query) are identified through the scenario-fine-tuned word extraction model (i.e., the first language model, such as LLM). In the specific implementation, the list of financial terms in the first query statement can be extracted through the word extraction model. In order to improve the accuracy of the extraction, the reference language model is fine-tuned in a supervised manner using the training data collected from the financial scenario and manually annotated to obtain the scenario-fine-tuned word extraction model, which is closer to the application requirements. The specific content of the first query statement is: "Can 00700 still be bought?", and the identified financial terms are: 00700. ② The financial terms in the first query statement are normalized and expanded through the predefined vocabulary. The financial terms extracted from the first query statement face problems such as non-standard and incomplete writing. Therefore, the target word library can be combined with the predefined standard financial word list in the word library to normalize and expand the financial proprietary words extracted from the first query statement. Normalization and expansion include normalization and expansion, wherein normalization refers to replacing financial proprietary words with standard expressions through synonyms and the like; expansion refers to adding synonyms that are semantically related to financial proprietary words. The 00700 related words obtained through normalization and expansion include: Company A Holdings, Company A. ③ Through the scenario-fine-tuned sentence rewriting and expansion model (i.e., the second language model, such as LLM), the first query statement is rewritten and expanded in combination with the expanded financial proprietary words. In addition to the non-standard financial proprietary words in the first query statement, there are also problems such as colloquial expressions, typos, and unclear references that affect the retrieval quality. This application combines the normalized and expanded financial proprietary words obtained in ② to rewrite and expand the first query statement, which can further improve the effect of the query statement when used for retrieval. In addition, the sentence rewriting and expansion model is also to improve the accuracy of extraction. It is obtained by fine-tuning the pre-trained model in a supervised manner using training data collected from financial scenarios and manually annotated. The rewritten query statements include the following two: Rewriting 1: Please analyze 00700.hk, A Company Holdings from the aspects of main business, industry status, and profitability. Rewriting 2: Please analyze the valuation level and development prospects of A Company, A Company Holdings, 00700. ④ Fusion with other query rewriting methods to achieve enhanced effects. The modified and expanded query statements obtained through ③ can be used in the following ways: one is to use them directly alone, and use the modified and expanded query statements for knowledge base retrieval respectively; the other is a merging strategy. Based on the merging strategy, the modified and expanded query statements can be directly spliced to obtain the second query statement, or the modified and expanded query statement can be merged with the first query statement to obtain the second query statement. The second query statement is directly used for knowledge base retrieval; another method is to combine it with the pseudo-relevance feedback PRF method, or combine it with the generated relevance feedback GRF type method to regenerate a new query statement as the second query statement, and then use the second query statement for knowledge base retrieval, which can further enhance the retrieval effect.
[0142] It can be seen that the above exemplary content is a query rewriting and expansion scheme based on a large model and enhanced proprietary words in the target field, and the above scheme can strengthen the proprietary words and entity words in the target field. In this way, when optimizing the query statement, it is possible to focus on the standardized words in the target field and improve the optimization quality of the query statement.
[0143] In one embodiment, the search results obtained by the search process include at least one piece of knowledge. For example, if the optimized query statement includes the following medical term "diabetes", the knowledge obtained through the search may include: the definition, classification, cause, symptoms, treatment, preventive measures and the latest research progress of diabetes. The second query statement is obtained by sentence reorganization based on at least one optimized query. The computer device can determine the correlation between each piece of knowledge in the search result and the second query statement, and then sort the various pieces of knowledge according to the correlation in a preset arrangement order to obtain a sorting result, and output one or more pieces of knowledge in the at least one piece of knowledge based on the sorting result.
[0144] Among them, the correlation between the knowledge and the second query statement refers to whether the knowledge conforms to the question content of the second query statement. The preset sorting order can be a sorting order from high to low or from low to high. For example, the preset sorting order is a sorting order from high to low. After obtaining the correlation between each piece of knowledge and the second query statement, each piece of knowledge can be sorted in order from high to low based on the correlation. When outputting knowledge, all knowledge included in the search results can be output according to the sorting result, or part of the knowledge can be output according to the sorting result, such as only outputting the knowledge with the highest correlation, or only outputting knowledge with a correlation greater than a preset correlation threshold.
[0145] Based on the correlation between the knowledge and the second query statement, the knowledge related to the second query statement (regarded as 1) and the knowledge irrelevant to the second query statement (regarded as 0) can be determined. This application can use the same ndcg@5 and recall@5 indicators in HyDE (an improved retrieval method) to measure the effect of this solution, where 5 represents the selection of the top 5 most similar entries from the knowledge base, ndcg represents the normalized discounted cumulative gain, and recall represents the recall rate. The test results are shown in Table 6.
[0146] Table 6 Test results
[0147]
[0148]
[0149] Among them, direct retrieval represents directly using the first query statement to retrieve the knowledge base, and HyDE represents an improved retrieval method. It first generates a hypothetical document that can answer the query through a zero-shot prompt by LLM, and then retrieves the knowledge base based on this hypothetical document to obtain real similar documents. LameR represents another improved retrieval method. It first uses the original query to perform a recall, feeds the model based on the 10 recalled documents, and allows the model to generate 5 answers. Then use the answer generated by the model to make a new query and perform another recall to obtain the final result. Ours represents the retrieval processing method provided in this application, after obtaining the optimized query statement, using at least one optimized query statement and the first query statement to splice and retrieve the knowledge base. Since this application can be combined with GRF and PRF methods when using at least one optimized query statement for retrieval processing, it is combined with the representative method HyDE of the GRF class (i.e. HyDE+ours) and the PRF class method LameR (i.e. LameR+ours) and tested. It can be seen from the test results that the retrieval processing method provided in this application has achieved good results compared with other methods, and after being combined with the existing query rewriting method, its effect can be further improved.
[0150] See also Figure 7 , Figure 7 It is a structural diagram of a retrieval processing device provided by an exemplary embodiment of the present application. The retrieval processing device can be set in the computer device provided by the embodiment of the present application. Figure 7 The retrieval processing device shown may be a computer program (including program code) running in a computer device, and the retrieval processing device may be used to execute Figure 2 or Figure 4 Some or all of the steps in the method embodiment shown. Figure 7 , the retrieval processing device may include the following units:
[0151] An acquisition unit 701 is used to acquire a first query statement to be searched;
[0152] The processing unit 702 is used to identify a target word belonging to the target domain from the first query statement, and perform semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain; optimize the first query statement based on the at least one expanded word to obtain at least one optimized query statement; and use the at least one optimized query statement for retrieval processing.
[0153] In one embodiment, the processing unit 702 is specifically used to: obtain extraction task prompt information, where the extraction task prompt information is used to indicate a word extraction rule; call the first language model to perform word extraction processing on the first query statement according to the word extraction rule indicated by the extraction task prompt information to obtain at least one entity word belonging to the target domain; and determine the at least one entity word belonging to the target domain as a target word belonging to the target domain.
[0154] In one embodiment, the first language model is obtained by training a reference language model under a first training task using first scene annotation data; the first scene annotation data includes at least one reference query sentence, each reference query sentence carries a corresponding first category label, and the first category label is used to indicate words in the corresponding reference query sentence that belong to the target field; the task content of the first training task is indicated by first prompt information; the reference language model is a language model obtained through pre-training.
[0155] In one embodiment, the processing unit 702 is specifically used to: determine a target vocabulary according to the target domain to which the target word belongs, the target vocabulary storing one or more standard words belonging to the target domain; and search the target vocabulary according to the target word to obtain at least one extended word belonging to the target domain.
[0156] In one embodiment, the target word library stores standard words in the target field through a predefined word list; the predefined word list includes at least one search group, each search group includes a search word and at least one standard word; the processing unit 702 is specifically used to: according to the target word, query the predefined word list to obtain a candidate search group; the search word included in the candidate search group is the target word; and at least one standard word included in the candidate search group is determined as at least one extended word belonging to the target field.
[0157] In one embodiment, the processing unit 702 is specifically used to: obtain optimization task prompt information, where the optimization task prompt information is used to indicate optimization rules, and the optimization rules include preprocessing rules and rewriting rules; call the second language model to preprocess the first query statement according to the preprocessing rules indicated by the optimization task prompt information to obtain a preprocessed first query statement; use the second language model to rewrite the preprocessed first query statement according to the rewriting rules indicated by the optimization task prompt information using at least one expansion word to obtain at least one rewritten first query statement; and determine at least one rewritten first query statement as an optimized query statement.
[0158] In one embodiment, the rewriting rule includes at least one reference rewriting direction; the number of expansion words is M, where M is a positive integer; the processing unit 702 is specifically used to: determine at least one target rewriting direction according to the reference rewriting direction included in the rewriting rule; and modify the preprocessed first query statement using one or more expansion words among the M expansion words according to at least one target rewriting direction to obtain at least one rewritten first query statement.
[0159] In one embodiment, the processing unit 702 is specifically used for at least one of the following: performing anomaly detection processing on the first query statement and correcting the detected abnormal characters to obtain a corrected first query statement; or performing redundancy removal processing on the first query statement to obtain a redundancy-free first query statement.
[0160] In one embodiment, the second language model is obtained by training the reference language model under the second training task through the second scene annotation data; the second scene annotation data includes at least one group of annotation data, each group of annotation data includes a reference query statement and at least one reference expansion word related to the reference query statement; each group of annotation data carries a second category label, and the second category label is used to indicate multiple reference optimized query statements, each reference query statement is obtained by optimizing the corresponding reference query statement based on at least one related reference expansion word; the task content of the second training task is indicated by the second prompt information; the reference language model is a language model obtained through pre-training.
[0161] In one embodiment, at least one optimized query statement is used for retrieval processing, including: reorganizing statements according to at least one optimized query statement to obtain a second query statement, and searching from a knowledge base according to the second query statement to obtain retrieval results; or, searching from the knowledge base according to at least one optimized query statement to obtain retrieval results.
[0162] In one embodiment, the processing unit 702 is specifically used to: concatenate at least one optimized query statement to obtain a second query statement; or concatenate at least one optimized query statement with the first query statement to obtain a second query statement; or retrieve relevant documents from the knowledge base according to at least one optimized query statement, and call a content generation model to generate content according to the retrieved relevant documents and at least one optimized query statement to obtain a second query statement; or, call a text processing model to generate relevant documents according to at least one optimized query statement, and merge information between the relevant documents and at least one optimized query statement to obtain a second query statement.
[0163] In one embodiment, the retrieval result includes at least one knowledge; the processing unit 702 is also used to: determine the correlation between each knowledge in the retrieval result and the second query statement; sort each knowledge according to a preset sorting direction based on the correlation to obtain a sorting result; and, based on the sorting result, output one or more knowledge in at least one knowledge.
[0164] It is understandable that the specific functions of each unit of the retrieval processing device described in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment, and its specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
[0165] Next, the computer device provided in the embodiment of the present application is described.
[0166] An exemplary embodiment of the present application also provides a schematic diagram of the structure of a computer device. The schematic diagram of the structure of the computer device can be found in Figure 8 The computer device may include: a processor 801, an input device 802, an output device 803 and a memory 804. The processor 801, the input device 802, the output device 803 and the memory 804 are connected via a bus. The memory 804 is used to store a computer-readable storage medium, the computer-readable storage medium includes a computer program, and the processor 801 is used to execute the computer program stored in the memory 804.
[0167] In one embodiment, the processor 801 performs the following operations by running the computer program in the memory 804: obtaining a first query statement to be retrieved; identifying a target word belonging to a target domain from the first query statement, and performing semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain; optimizing the first query statement based on the at least one expanded word to obtain at least one optimized query statement; and using the at least one optimized query statement for retrieval processing.
[0168] In one embodiment, the processor 801 is specifically used to: obtain extraction task prompt information, where the extraction task prompt information is used to indicate a word extraction rule; call the first language model to perform word extraction processing on the first query statement according to the word extraction rule indicated by the extraction task prompt information to obtain at least one entity word belonging to the target domain; and determine the at least one entity word belonging to the target domain as a target word belonging to the target domain.
[0169] In one embodiment, the first language model is obtained by training a reference language model under a first training task using first scene annotation data; the first scene annotation data includes at least one reference query sentence, each reference query sentence carries a corresponding first category label, and the first category label is used to indicate words in the corresponding reference query sentence that belong to the target field; the task content of the first training task is indicated by first prompt information; the reference language model is a language model obtained through pre-training.
[0170] In one embodiment, the processor 801 is specifically used to: determine a target vocabulary according to the target domain to which the target word belongs, the target vocabulary storing one or more standard words belonging to the target domain; and search the target vocabulary according to the target word to obtain at least one extended word belonging to the target domain.
[0171] In one embodiment, the target word library stores standard words of the target domain through a predefined word list; the predefined word list includes at least one search group, each search group includes a search word and at least one standard word; the processor 801 is specifically used to: according to the target word, query the predefined word list to obtain a candidate search group; the search word included in the candidate search group is the target word; and at least one standard word included in the candidate search group is determined as at least one extended word belonging to the target domain.
[0172] In one embodiment, the processor 801 is specifically used to: obtain optimization task prompt information, where the optimization task prompt information is used to indicate optimization rules, and the optimization rules include preprocessing rules and rewriting rules; call the second language model, and preprocess the first query statement according to the preprocessing rules indicated by the optimization task prompt information to obtain a preprocessed first query statement; rewrite the preprocessed first query statement using at least one expansion word according to the rewriting rules indicated by the optimization task prompt information through the second language model to obtain at least one rewritten first query statement; and determine at least one rewritten first query statement as an optimized query statement.
[0173] In one embodiment, the rewriting rule includes at least one reference rewriting direction; the number of expansion words is M, where M is a positive integer; the processor 801 is specifically used to: determine at least one target rewriting direction according to the reference rewriting direction included in the rewriting rule; and modify the preprocessed first query statement using one or more expansion words among the M expansion words according to at least one target rewriting direction to obtain at least one rewritten first query statement.
[0174] In one embodiment, the processor 801 is specifically used for at least one of the following: performing anomaly detection processing on the first query statement and correcting the detected abnormal characters to obtain a corrected first query statement; or performing redundancy removal processing on the first query statement to obtain a redundancy-free first query statement.
[0175] In one embodiment, the second language model is obtained by training the reference language model under the second training task through the second scene annotation data; the second scene annotation data includes at least one group of annotation data, each group of annotation data includes a reference query statement and at least one reference expansion word related to the reference query statement; each group of annotation data carries a second category label, and the second category label is used to indicate multiple reference optimized query statements, each reference query statement is obtained by optimizing the corresponding reference query statement based on at least one related reference expansion word; the task content of the second training task is indicated by the second prompt information; the reference language model is a language model obtained through pre-training.
[0176] In one embodiment, at least one optimized query statement is used for retrieval processing, including: reorganizing statements according to at least one optimized query statement to obtain a second query statement, and searching from a knowledge base according to the second query statement to obtain retrieval results; or, searching from the knowledge base according to at least one optimized query statement to obtain retrieval results.
[0177] In one embodiment, the processor 801 is specifically used to: concatenate at least one optimized query statement to obtain a second query statement; or concatenate at least one optimized query statement with a first query statement to obtain a second query statement; or retrieve relevant documents from a knowledge base according to at least one optimized query statement, and call a content generation model to generate content according to the retrieved relevant documents and at least one optimized query statement to obtain a second query statement; or, call a text processing model to generate relevant documents according to at least one optimized query statement, and merge information between the relevant documents and at least one optimized query statement to obtain a second query statement.
[0178] In one embodiment, the retrieval result includes at least one knowledge; the processor 801 is also used to: determine the correlation between each knowledge in the retrieval result and the second query statement; sort each knowledge according to a preset sorting direction based on the correlation to obtain a sorting result; and, based on the sorting result, output one or more knowledge in at least one knowledge.
[0179] It should be understood that the computer device described in the embodiments of the present application can execute the description of the retrieval processing method in the corresponding embodiments above, and can also execute the description of the retrieval processing device in the corresponding embodiments above, which will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated.
[0180] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the processor executes the above program instructions, it can execute the above Figure 2 and Figure 4 The method in the corresponding embodiment will therefore not be described in detail here.
[0181] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device can perform the above Figure 2 and Figure 4 The method in the corresponding embodiment will therefore not be described in detail here.
[0182] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0183] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiment and equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A search processing method, characterized in that: The method comprises: Obtaining a first query statement to be retrieved; Identifying a target word belonging to a target domain from the first query statement, and performing semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain; Optimizing the first query statement based on the at least one expanded word to obtain at least one optimized query statement; The at least one optimized query statement is used to perform retrieval processing.
2. The method according to claim 1, characterized in that The step of identifying a target word belonging to a target domain from the first query statement includes: Acquire extraction task prompt information, where the extraction task prompt information is used to indicate a word extraction rule; Calling the first language model, performing word extraction processing on the first query statement according to the word extraction rule indicated by the extraction task prompt information, and obtaining at least one entity word belonging to the target domain; The at least one entity word belonging to the target domain is respectively determined as a target word belonging to the target domain.
3. The method according to claim 2, characterized in that The first language model is obtained by training a reference language model under a first training task using first scenario labeled data; The first scene annotation data includes at least one reference query sentence, each reference query sentence carries a corresponding first category label, and the first category label is used to indicate a word in the corresponding reference query sentence that belongs to the target field; The task content of the first training task is indicated by first prompt information; The reference language model is a language model obtained through pre-training.
4. The method according to claim 1, characterized in that The semantic expansion processing of the target word to obtain at least one expanded word belonging to the target domain includes: Determining a target word library according to the target domain to which the target word belongs, wherein the target word library stores one or more standard words belonging to the target domain; The target word is searched in the target word library to obtain at least one extended word belonging to the target field.
5. The method according to claim 4, characterized in that The target word library stores the standard words of the target field through a predefined word list; the predefined word list includes at least one search group, each of which includes a search word and at least one standard word; The step of searching the target word in the target word library to obtain at least one extended word belonging to the target field includes: According to the target word, a candidate search group is obtained by searching in the predefined word list; the search words included in the candidate search group are the target words; At least one standard word included in the candidate search group is determined as at least one extended word belonging to the target field.
6. The method according to claim 1, characterized in that The step of optimizing the first query statement based on the at least one expanded word to obtain at least one optimized query statement includes: Obtaining optimization task prompt information, where the optimization task prompt information is used to indicate optimization rules, and the optimization rules include preprocessing rules and rewriting rules; Calling the second language model to preprocess the first query statement according to the preprocessing rule indicated by the optimization task prompt information to obtain a preprocessed first query statement; rewriting the preprocessed first query statement using the at least one expanded word according to the rewriting rule indicated by the optimization task prompt information through the second language model to obtain at least one rewritten first query statement; The at least one rewritten first query statement is respectively determined as an optimized query statement.
7. The method according to claim 6, characterized in that The preprocessing of the first query statement according to the preprocessing rule indicated by the optimization task prompt information to obtain the preprocessed first query statement includes at least one of the following: Performing anomaly detection processing on the first query statement, and correcting the detected abnormal characters to obtain a corrected first query statement; or, De-redundancy processing is performed on the first query statement to obtain a first query statement after de-redundancy.
8. The method according to claim 6, characterized in that The rewriting rule includes at least one reference rewriting direction; the number of the expansion words is M, where M is a positive integer; the rewriting process of rewriting the preprocessed first query statement using the at least one expansion word according to the rewriting rule indicated by the optimization task prompt information to obtain at least one rewritten first query statement includes: Determining at least one target rewriting direction according to the reference rewriting direction included in the rewriting rule; According to the at least one target rewriting direction, one or more expansion words among the M expansion words are used to modify the preprocessed first query statement to obtain at least one rewritten first query statement.
9. The method according to claim 1, characterized in that The second language model is obtained by training the reference language model under a second training task using the second scene labeled data; The second scene annotation data includes at least one group of annotation data, each group of annotation data includes a reference query sentence and at least one reference expansion word related to the reference query sentence; Each group of annotated data carries a second category label, and the second category label is used to indicate a plurality of reference optimized query statements, each of which is obtained by optimizing a corresponding reference query statement based on at least one related reference expansion word; The task content of the second training task is indicated by second prompt information; The reference language model is a language model obtained through pre-training.
10. The method according to claim 1, characterized in that The using the at least one optimized query statement to perform retrieval processing includes: Reorganize the query statements according to the at least one optimized query statement to obtain a second query statement, and search from the knowledge base according to the second query statement to obtain a search result; or Search from the knowledge base according to the at least one optimized query statement to obtain search results.
11. The method according to claim 10, characterized in that The step of reorganizing the query statement according to the at least one optimized query statement to obtain a second query statement includes: concatenate the at least one optimized query statement to obtain a second query statement; or, concatenate the at least one optimized query statement with the first query statement to obtain a second query statement; or, Retrieving relevant documents from the knowledge base according to the at least one optimized query statement, and calling the content generation model to generate content according to the retrieved relevant documents and the at least one optimized query statement to obtain a second query statement; or, According to the at least one optimized query statement, a text processing model is called to generate relevant documents, and information of the relevant documents is merged with the at least one optimized query statement to obtain a second query statement.
12. The method according to claim 10, characterized in that The search result includes at least one piece of knowledge; the method further includes: Determine the correlation between each piece of knowledge in the search result and the second query statement; According to the correlation, sorting each piece of knowledge according to a preset sorting direction to obtain a sorting result; and, Based on the ranking result, one or more pieces of knowledge among the at least one piece of knowledge are output.
13. A search processing device, characterized in that: include: An acquisition unit, used for acquiring a first query statement to be retrieved; a processing unit, configured to identify a target word belonging to a target domain from the first query statement, and perform semantic expansion processing on the target word to obtain at least one expanded word belonging to the target domain; The first query statement is optimized based on the at least one expanded word to obtain at least one optimized query statement; and the at least one optimized query statement is used for retrieval processing.
14. A computer device, characterized in that: include: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the retrieval processing method according to any one of claims 1 to 12 is executed.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the retrieval processing method according to any one of claims 1 to 12 is executed.
16. A computer program product, characterized in that The computer program product comprises a computer program or a computer instruction, and the computer program or the computer instruction is executed by a processor to implement the retrieval processing method according to any one of claims 1 to 12.
Citation Information
Cited By
Human-computer interaction method and system, server, storage medium and program product
CN119988569A
Data processing method and device, computer equipment, readable storage medium and program product
CN120448439A
Hierarchical semantic processing label automatic generation method and system oriented to network content
CN121412433A