Natural language query method and device
By performing intent recognition and query intent generation on natural language query sentences, generating query sentences and performing knowledge retrieval and sorting, the problem that the intelligent question and answer system cannot distinguish user intentions is solved, and intelligent and precise question and answer services are realized.
Patent Information
- Application Number
- CN202410746085.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing intelligent question and answer systems cannot effectively distinguish users' complex query intentions in different knowledge fields, making it difficult to provide intelligent and precise question and answer services.
By understanding user intentions from multiple dimensions, natural language query methods are used to identify and generate query intentions for natural language query sentences, generate multiple query sentences for knowledge retrieval, reorder candidate knowledge texts, and determine the target knowledge text sequence. , inputting a large language model to generate feedback information.
It realizes providing users with more intelligent and precise question and answer services, and improves the accuracy and relevance of question and answer through multi-dimensional understanding of user intentions and knowledge retrieval.
Smart Images

Figure CN118312604B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a natural language query method and device. Background Art
[0002] With the continuous development of artificial intelligence, intelligent question and answer has been widely used in all walks of life as a popular interactive method. At present, intelligent question and answer relies on large language models. Specifically, the existing intelligent question and answer system usually injects a large amount of knowledge text into the large language model, and the large language model uses the injected knowledge text to provide intelligent question and answer services to users. However, since the sources of the knowledge text injected into the large language model are wide and complex, and the large language model cannot effectively distinguish the user's complex query intentions in different knowledge fields, the existing intelligent question and answer is difficult to provide users with intelligent and precise question and answer services. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a natural language query method and device to understand user intentions from multiple dimensions and perform knowledge retrieval, and then a large language model gives user feedback based on the retrieved target knowledge text, thereby providing users with more intelligent and accurate question-and-answer services.
[0004] In a first aspect, an embodiment of the present invention provides a natural language query method, the method comprising:
[0005] Get natural language query statements;
[0006] Performing a first intent recognition on the natural language query statement to obtain an intent type, wherein the intent type includes knowledge retrieval and other intents;
[0007] In response to the intent type being knowledge retrieval, performing a second intent recognition on the natural language query statement to obtain at least one query intent, wherein the query intent is used to characterize the knowledge domain to which the knowledge retrieval content belongs;
[0008] For each of the query intentions, generating a corresponding plurality of query sentences according to the natural language query sentence and the query intention;
[0009] Performing knowledge retrieval in a preset knowledge base according to each query sentence to obtain multiple sets of candidate knowledge text sequences, each of which includes multiple candidate knowledge texts arranged in sequence;
[0010] Reordering the candidate knowledge texts in the plurality of groups of candidate knowledge text sequences to determine a target knowledge text sequence, wherein the target knowledge text sequence includes a plurality of target knowledge texts arranged in an order determined by the reordering;
[0011] The natural language query sentence and the plurality of target knowledge texts are input into a target large language model to generate feedback information through the target large language model.
[0012] In a second aspect, an embodiment of the present invention provides a natural language query device, the device comprising:
[0013] A query statement acquisition unit, used to acquire a natural language query statement;
[0014] A first intent recognition unit, configured to perform a first intent recognition on the natural language query statement to obtain an intent type, wherein the intent type includes knowledge retrieval and other intents;
[0015] A second intent recognition unit is used for, in response to the intent type being knowledge retrieval, performing a second intent recognition on the natural language query statement to obtain at least one query intent, wherein the query intent is used to characterize the knowledge field to which the knowledge retrieval content belongs;
[0016] A query sentence generating unit, configured to generate a plurality of corresponding query sentences for each query intent according to the natural language query sentence and the query intent;
[0017] A text sequence acquisition unit, used for performing knowledge retrieval in a preset knowledge base according to each query sentence to acquire multiple groups of candidate knowledge text sequences, each of which includes multiple candidate knowledge texts arranged in sequence;
[0018] A sorting unit, used for re-sorting the candidate knowledge texts in the plurality of groups of candidate knowledge text sequences to determine a target knowledge text sequence, wherein the target knowledge text sequence includes a plurality of target knowledge texts arranged in an order determined by the re-sorting;
[0019] The feedback information generating unit is used to input the natural language query sentence and the multiple target knowledge texts into a target large language model to generate feedback information through the target large language model.
[0020] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method as described in any one of the first aspects is implemented.
[0021] In a fourth aspect, an embodiment of the present invention provides an electronic device, the device comprising:
[0022] a memory for storing one or more computer program instructions;
[0023] A processor, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of the first aspects.
[0024] In a fifth aspect, an embodiment of the present invention provides a computer program product, which, when executed on a computer, enables the computer to execute the method as described in any one of the first aspects.
[0025] The embodiment of the present invention, after determining that the intent type of a natural language query statement is knowledge retrieval through a first intent recognition, performs a second intent recognition on the natural language query statement to obtain at least one query intent for characterizing the knowledge field to which the knowledge retrieval content belongs, rewrites the natural language query statement according to the query intent to obtain multiple query sentences, retrieves multiple candidate knowledge text sequences according to the multiple query sentences, reorders the candidate knowledge texts in the multiple candidate knowledge text sequences to determine a target knowledge text sequence, inputs the target knowledge text and the natural language query statement into a target large language model to obtain feedback information. Thus, by understanding the user intent from multiple dimensions and performing knowledge retrieval, and then giving the user feedback based on the retrieved target knowledge text, the implementation of the present invention can provide users with more intelligent and precise question-and-answer services. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0027] Figure 1 A schematic diagram of a natural language query system according to an embodiment of the present invention;
[0028] Figure 2 is a flow chart of a natural language query method according to an embodiment of the present invention;
[0029] Figure 3 A flowchart of a method for determining a candidate knowledge text sequence according to an embodiment of the present invention;
[0030] Figure 4 A flowchart of a method for determining a target knowledge text sequence according to an embodiment of the present invention;
[0031] Figure 5 A schematic diagram of a candidate knowledge text re-ranking process according to an embodiment of the present invention;
[0032] Figure 6 A schematic diagram of a natural language query process according to an embodiment of the present invention;
[0033] Figure 7 A schematic diagram of a natural language query device according to an embodiment of the present invention;
[0034] Figure 8 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.
[0036] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0037] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".
[0038] In the description of this application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.
[0039] The solutions described in this specification and in the examples, if they involve the processing of personal information, will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or being necessary for the performance of a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.
[0040] Figure 1 FIG. 1 is a schematic diagram of a natural language query system according to an embodiment of the present invention. Figure 1 As shown, the natural language query system includes a user terminal 11 and a server 12. The user terminal 11 is a terminal suitable for use by a user. The server 12 is a general computing device or a data processing device or a storage device. In this embodiment, the user terminal 11 and the server 12 can provide intelligent question and answer services to the user respectively, or the user terminal 11 and the server 12 can also provide intelligent question and answer services to the user by cooperating with each other.
[0041] Optionally, the user terminal 11 can be any terminal device capable of interacting with the user, including but not limited to a smart phone, a tablet computer, a smart wearable device, a laptop computer, a vehicle terminal, a smart speaker, an unmanned vehicle or a robot, etc., and this application does not limit this. The server 12 can be a single computer, a cluster consisting of multiple computers, or a cloud server that can flexibly adjust computing resources through cloud technology.
[0042] Optionally, in order to enable the user terminal 11 and the server 12 to provide intelligent question-and-answer services to the user through mutual cooperation, a target application corresponding to the server 12 may be run in the user terminal 11. Through the target application, the user terminal 11 can realize data interaction with the server 12. Further, the target application may be an independently running application (APP, Application), a small program running based on a platform program, a web page, a plug-in or a component, etc., and this application does not limit this. Furthermore, the user terminal 11 and the server 12 may be connected by a wireless communication network to realize data interaction between each other. The wireless communication network may include any one or combination of 5G mobile communication network technology (5th-Generation, 5G) system, long term evolution (long term evolution, LTE) system, Global System for Mobile Communication (Global System for Mobile Communication, GSM), Bluetooth (Bluetooth, BT), Wireless Fidelity (Wireless Fidelity, Wi-Fi), Code Division Multiple Access (Code Division Multiple Access, CDMA) network, wideband code division multiple access (wideband code division multiple access, WCDMA) network, long range wireless communication (Long Range, Lora) technology or Zigbee protocol (Zigbee).
[0043] Figure 2 FIG. 1 is a flow chart of a natural language query method according to an embodiment of the present invention. It should be understood that Figure 2 The natural language query method shown can be executed independently by the user terminal or the server in the above embodiment, or can be executed by the user terminal and the server through mutual cooperation (that is, each of them executes a part of the steps). Figure 2 As shown, the natural language query method may specifically include the following steps:
[0044] Step S100: Obtain a natural language query statement.
[0045] Specifically, this embodiment can obtain a natural language query statement. The natural language query statement refers to a question, topic, instruction or keyword raised by a user using natural language. For example, a natural language query statement can be "What are the indicators related to DAU", "Distribution of the order volume in Shanghai yesterday by commodity category" or "Commodity", etc.
[0046] Optionally, in this embodiment, the obtained natural language query statement may be in text form or in voice form. Further, when the obtained natural language query statement is in voice form, this embodiment may also perform voice recognition on the natural language query statement before executing subsequent steps to convert it from voice form to text form.
[0047] Step S200: performing a first intent recognition on the natural language query statement to obtain an intent type.
[0048] Among them, performing first intent recognition on a natural language query statement refers to identifying the type of purpose or demand expressed by the user in the natural language query statement. The intent type is the type of purpose or demand expressed by the user in the natural language query statement obtained through the first intent recognition. Specifically, after obtaining the natural language query statement, this embodiment can perform first intent recognition on the natural language query statement to obtain the type of purpose or demand expressed by the user in the natural language query statement.
[0049] Furthermore, in this embodiment, the intent types include knowledge retrieval and other intents. Among them, knowledge retrieval means that the purpose expressed by the user is to obtain relevant knowledge, such as obtaining a solution to a problem, obtaining the processing flow of a certain operation during execution, obtaining the definition of a term, or obtaining the explanation of a phenomenon. Other intents refer to the purpose that the user does not clearly express or the purpose expressed is other than obtaining relevant knowledge, such as querying data, obtaining services or social interaction.
[0050] Optionally, in step S200, the present embodiment may use a large language model to perform a first intent recognition on a natural language query statement to obtain an intent type. Specifically, the present embodiment may construct a first intent recognition prompt statement based on a natural language query statement, and input the first intent recognition prompt statement into an auxiliary large language model to determine the intent type through the large language model. The first intent recognition prompt statement may be a text description, which is used to guide the large language model to perform a first intent recognition on a natural language query statement and to make its output conform to the desired intent type.
[0051] Furthermore, the first intent identification prompt statement can be constructed by filling a natural language query statement into a first intent identification prompt template. Among them, the first intent identification prompt template can be a statement template prepared in advance by relevant personnel. The first intent identification prompt template may include intent type identification instructions and intent type identification reference information. The intent type identification instruction is an instruction used to indicate the task that the large language model needs to complete. For example, the intent type identification instruction may be "Please determine the user's intent type based on the natural language query statement input by the user and the intent type identification reference information." The intent type identification reference information is provided for the large language model and is used to assist the large language model in performing relevant information for the first intent identification. Further, the intent type identification reference information may include an intent type description and an intent type example. Among them, the intent type description is an explanatory text description of the intent type. The intent type example is an example of a natural language query statement that may be used when the type of purpose or need that the user wants to express is the corresponding intent type.
[0052] Exemplarily, assuming that the natural language query statement input by the user is "What are the indicators related to DAU", the first intent recognition prompt statement constructed can be: [Please determine the user's intent type based on the natural language query statement input by the user and the intent type recognition reference information. Among them, the natural language query statement is: "What are the indicators related to DAU". The intent type recognition reference information is: "Intent type: knowledge retrieval; Intent type description: The user wants to obtain certain relevant knowledge; Intent type example: What is the product, what is the principle of the large language model, what is the process of the server sending information to the client; Intent type: other intent; Intent type description: The user did not clearly express the purpose or the expressed purpose is other than obtaining relevant knowledge; Intent type example: Please give the store's turnover this month, please help me turn on the air conditioner, today's weather is really good, hello"]. It should be understood that the first intent recognition prompt statement given above is only for illustration. In actual application, the content included in the first intent recognition prompt statement is not limited to this.
[0053] It should be understood that a large language model (LLM) refers to a deep learning model with a large number of parameters, which can automatically learn the grammatical and semantic rules of natural language, and then generate natural language text. In this embodiment, the large language model used includes a target large language model and an auxiliary large language model. Among them, the target large language model is a large language model deployed on the local end (the local end can be a user terminal or a server), and the auxiliary large language model is a large language model provided by a third party. Further, in this embodiment, the target large language model and the auxiliary large language model can be called separately according to actual needs to implement each step in the natural language query method. Furthermore, in step S200, the large language model used can be an auxiliary large language model.
[0054] Optionally, the target large language model can be a Qwen-14B model, and the auxiliary large language model can be a GPT-3.5 model. Among them, the Qwen-14B model is a pre-trained language model based on the Transformer architecture, which has advanced long text processing capabilities, dialogue interaction capabilities, cognitive and reasoning capabilities, and certain code generation capabilities. The GPT-3.5 model is a deep learning neural network structure that is particularly good at processing sequence data such as text. It uses a self-attention mechanism to capture long-range dependencies in the input sequence, thereby achieving efficient understanding and generation of natural language.
[0055] Step S300: In response to the intent type being knowledge retrieval, a second intent recognition is performed on the natural language query statement to obtain at least one query intent.
[0056] Among them, the second intent recognition of the natural language query statement refers to the recognition of the knowledge field to which the user wants to acquire the knowledge, that is, determining in which knowledge fields the knowledge text related to the knowledge the user wants to acquire can be retrieved. The query intent is obtained through the second intent recognition, that is, the knowledge field to which the user wants to acquire the knowledge. Further, the query intent can characterize the knowledge field to which the knowledge retrieval content belongs. Specifically, when it is determined that the type of purpose or demand expressed by the user in the natural language query statement is to acquire certain relevant knowledge, this embodiment can further perform the second intent recognition on the natural language query statement to obtain the knowledge field to which the user wants to acquire the knowledge.
[0057] It is hoped that the knowledge domain in each embodiment of the present invention may refer to the knowledge domain divided in advance by relevant personnel according to the actual application scenario and application requirements of the solution. For example, when the present solution is applied to the internal knowledge query scenario of the e-commerce platform, the knowledge domain may include the business domain, user domain, product domain and data domain, etc., divided by relevant personnel according to the platform requirements. For another example, when the present solution is applied to the general knowledge query scenario open to the outside world, the knowledge domain may include the mathematics field, physics field, biology field and chemistry field, etc., divided by relevant personnel according to disciplines. It should be understood that the knowledge domain given above is only for illustration, and this embodiment does not limit the specific division method of the knowledge domain, the specific number of divisions of the knowledge domain and which knowledge domains are specifically divided. In step S300, this embodiment determines the knowledge domain to which the user wants to obtain knowledge in the knowledge domain divided by the relevant personnel.
[0058] It is hoped that it will be noted that, in general, the same knowledge is likely to be reflected in multiple knowledge domains, that is, the same knowledge may belong to multiple knowledge domains. For example, the knowledge of daily active users may belong to the user domain, the business domain, the data domain, or the product domain. In order to ensure the comprehensiveness of subsequent knowledge retrieval, in step 300, all knowledge domains to which the user wants to obtain knowledge may be determined in this embodiment.
[0059] Optionally, in step S300, the present embodiment may use a large language model to perform a second intent recognition on a natural language query statement, thereby obtaining at least one query intent. Specifically, the present embodiment may construct a second intent recognition prompt statement based on a natural language query statement, and input the second intent recognition prompt statement into an auxiliary large language model to determine at least one query intent through the large language model. The second intent recognition prompt statement is a text description that is used to guide the large language model to perform a second intent recognition on a natural language query statement, and to make its output conform to at least one desired query intent.
[0060] Furthermore, the second intent identification prompt statement can be constructed by filling the natural language query statement into the second intent identification prompt template. Among them, the second intent identification prompt template can be a statement template prepared in advance by relevant personnel. The second intent identification prompt template may include query intent identification instructions and query intent identification reference information. Query intent identification instructions are instructions used to indicate the tasks that the large language model needs to complete. For example, the query intent identification instruction may be "Please determine all the user's query intentions based on the natural language query statement input by the user and the query intent identification reference information." The query intent identification reference information is provided for the large language model and is used to assist the large language model in performing relevant information for second intent identification. Further, the query intent identification reference information may include knowledge field descriptions of various knowledge fields divided by relevant personnel. Among them, the knowledge field description may be a general text description of the knowledge scope covered by the knowledge field.
[0061] Exemplarily, assuming that the natural language query statement input by the user is "What are the indicators related to DAU", the constructed second intent recognition prompt statement can be: [Please determine all the user's query intentions based on the natural language query statement input by the user and the query intent recognition reference information. Among them, the natural language query statement is: "What are the indicators related to DAU". The query intent recognition reference information is: "Knowledge domain: business domain; knowledge domain description: contains knowledge that will be used or involved in business processes; knowledge domain: user domain; knowledge domain description: contains knowledge that will be used or involved when processing user-related content; knowledge domain: product domain; knowledge domain description: contains knowledge that will be used or involved when processing product-related content; knowledge domain: data domain; knowledge domain description: contains knowledge that will be used or involved in data analysis and data processing."]. It should be understood that the second intent recognition prompt statement given above is only for illustration. In actual application, the content included in the second intent recognition prompt statement is not limited to this.
[0062] Optionally, before performing the second intent recognition on the natural language query statement, this embodiment can also detect whether the user explicitly gives the knowledge field to which the knowledge wants to be acquired in the natural language query statement. If the user explicitly gives the relevant knowledge field in the natural language query statement, this embodiment can directly determine the query intent based on the relevant knowledge field given by the user without using the large language model for excessive expansion. For example, suppose the natural language query statement input by the user is "In the data field and the user field, what are the DAU-related indicators?" Since the natural language query statement clearly states that the knowledge field to which the user wants the knowledge to belong is the data field and the user field, this embodiment can directly determine the data field and the user field as the query intent. It should be understood that if the user does not explicitly give the relevant knowledge field in the natural language query statement, then this embodiment can use the large language model to determine all the knowledge fields to which the user wants to acquire knowledge, thereby obtaining the corresponding query intent.
[0063] Optionally, in step S300, the large language model used may be an auxiliary large language model.
[0064] Step S400: for each query intent, generate a plurality of corresponding query sentences according to the natural language query sentence and the query intent.
[0065] Specifically, after determining at least one query intent, for each query intent, this embodiment may rewrite the natural language query sentence according to the query intent to determine multiple query sentences.
[0066] Optionally, this embodiment can use a large language model to rewrite natural language query statements. Specifically, this embodiment can construct a rewriting prompt statement based on the natural language query statement and the query intent, and input the rewriting prompt statement into the large language model to generate multiple query sentences through the large language model. The rewriting prompt statement is used to guide the large language model to generate multiple query sentences.
[0067] Furthermore, the rewriting prompt statement can be constructed by filling the natural language query statement and query intent into the rewriting prompt template. Among them, the rewriting prompt template can be a statement template prepared in advance by relevant personnel. The rewriting prompt template may include rewriting instructions and rewriting reference information. The rewriting instruction is an instruction used to indicate the task that the large language model needs to complete. For example, the rewriting instruction may be "Please rewrite the natural language query statement input by the user according to the query intent to determine multiple query questions." The rewriting reference information is provided for the large language model and is used to assist the large language model in rewriting relevant information of the natural language query statement. Further, the rewriting reference information may include corresponding rewriting methods.
[0068] Exemplarily, assuming that the natural language query statement input by the user is "What are the indicators related to DAU", and the query intent is the user domain; then the rewriting prompt statement constructed can be: [Please rewrite the natural language query statement input by the user according to the query intent to generate multiple query questions. Among them, the natural language query statement is: "What are the indicators related to DAU". The query intent is: "User domain". The rewriting reference information is: "Replace synonyms, adjust the language type, and adjust the language expression"]. It should be understood that the rewriting prompt statement given above is only for illustration. In actual application, the content included in the rewriting prompt statement is not limited to this.
[0069] Optionally, in step S400, the large language model used may be an auxiliary large language model.
[0070] Step S500: performing knowledge retrieval in a preset knowledge base according to each query sentence to obtain multiple groups of candidate knowledge text sequences.
[0071] Specifically, after rewriting the natural language query sentence to obtain multiple query sentences, the present embodiment can perform knowledge retrieval in a preset knowledge base according to each query sentence to obtain multiple sets of candidate knowledge text sequences, wherein each set of candidate knowledge text sequences can include multiple candidate knowledge texts arranged in sequence.
[0072] It should be understood that due to different focuses or application requirements, the same knowledge will be reflected differently in different knowledge fields. For example, for the knowledge of daily active users, in the user field, the knowledge of daily active users may be more inclined to how the interaction standards of daily active users are defined (that is, what is considered an active user), while in the data field, the knowledge of daily active users may be more inclined to how the data related to daily active users is processed, and in the product field, the knowledge of daily active users may be more inclined to what are the application directions of daily active users. The candidate knowledge texts in each candidate knowledge text sequence obtained in this step are knowledge texts related to the knowledge that the user wants to acquire when only a single knowledge field is considered. It should be understood that there may be repeated candidate knowledge texts between each candidate knowledge text sequence.
[0073] Figure 3 Flow chart of the candidate knowledge text sequence determination method of the embodiment of the present invention. It should be understood that Figure 3 The candidate knowledge text sequence determination method shown in FIG. 4 can be specifically used to implement the above step S500. Figure 3 As shown, the candidate knowledge text sequence determination method may specifically include the following steps:
[0074] Step S510: For each query sentence, determine a knowledge group corresponding to the query sentence in the preset knowledge base according to the knowledge field to which the query sentence belongs.
[0075] Specifically, the preset knowledge base is a pre-built database for storing knowledge texts. The knowledge texts in the preset knowledge base can be divided into multiple knowledge groups according to the knowledge fields to which they belong. Among them, each knowledge group can be used to store knowledge texts belonging to the corresponding knowledge field. In this step, this embodiment can determine the knowledge group corresponding to each query sentence in the preset knowledge base according to the knowledge field to which each query sentence belongs. It should be understood that when the same knowledge text involves multiple knowledge fields at the same time, it can be stored in the knowledge groups corresponding to multiple knowledge fields at the same time. The knowledge field to which each query sentence belongs can be the knowledge field represented by the query intent for generating each query sentence.
[0076] Step S520: For each query sentence, perform knowledge retrieval in the corresponding knowledge group according to the query sentence to obtain a candidate knowledge text sequence.
[0077] Specifically, after determining the knowledge group corresponding to each query sentence, for each query sentence, this embodiment can perform knowledge retrieval according to the query sentence in the knowledge group corresponding to the query sentence to obtain a candidate knowledge text sequence. It should be understood that the knowledge retrieval process of each query sentence can be performed simultaneously or separately, and this application does not limit this.
[0078] Optionally, in step S520, the present embodiment may determine multiple candidate knowledge texts according to the vector expression similarity between the query sentence and each knowledge text in the knowledge group, thereby obtaining a candidate knowledge text sequence. Specifically, in the corresponding knowledge group, the present embodiment may determine a preset number of knowledge texts with the highest vector expression similarity with the query sentence as candidate knowledge texts, thereby obtaining a candidate knowledge text sequence. The preset number may be set by relevant personnel according to actual needs. The multiple candidate knowledge texts in the candidate knowledge text sequence may be sorted according to the vector expression similarity with the query sentence.
[0079] Optionally, the vector expressions of the query sentence and each knowledge text can be determined by inputting the query sentence and each knowledge text into a large-scale text embedding model. Among them, the large-scale text embedding model is a general text embedding model obtained by training with a large-scale data set and using the Massive Text Embedding (MTE) technology. The large-scale text embedding model is used to convert the input data into corresponding vectors. Furthermore, in this embodiment, the large-scale text embedding model used can be the Moka Massive Text Embedding model (M3E), which is a text embedding model obtained by training with a large-scale Chinese sentence pair data set, and can convert natural language query sentences into dense vectors.
[0080] Optionally, in step S520, this embodiment may use a retrieval tool that supports multi-channel concurrent recall to simultaneously implement the knowledge retrieval process for each query sentence. Among them, the retrieval tool may be a vector retrieval tool similar to Faiss (Facebook AI Similarity Search). Faiss is a library for efficient vector retrieval, which is mainly used to process large-scale high-dimensional vector data sets to perform fast similarity searches and clustering operations in large-scale data sets. It should be understood that the retrieval tools given above are only for illustration. In actual application, this embodiment does not limit the retrieval tools used.
[0081] Therefore, by converting natural language query sentences into query sentences adapted to different knowledge fields, and then performing knowledge retrieval in corresponding knowledge groups based on each query sentence, this embodiment can ensure the comprehensiveness of knowledge retrieval.
[0082] Step S600: reorder the candidate knowledge texts in the plurality of groups of candidate knowledge text sequences to determine a target knowledge text sequence.
[0083] Specifically, after obtaining multiple candidate knowledge text sequences, if the large language model directly uses the candidate knowledge texts in the multiple groups of candidate knowledge text sequences to generate feedback information, then too many candidate knowledge texts will interfere with the large language model, resulting in poor quality of the feedback information generated by the large language model. In this regard, in order to ensure the quality of the feedback information generated by the large language model, the present embodiment can also reorder the candidate knowledge texts in the multiple groups of candidate knowledge text sequences to determine a target knowledge text sequence. Among them, the target knowledge text sequence includes multiple target knowledge texts arranged in an order determined by the reordering. The target knowledge text is a knowledge text related to the knowledge that the user wants to acquire when considering multiple knowledge fields at the same time.
[0084] Figure 4 Flow chart of the target knowledge text sequence determination method of the embodiment of the present invention. It should be understood that Figure 4 The target knowledge text sequence determination method shown in FIG. 4 can be used to implement the above step S600. Figure 4 As shown, the target knowledge text sequence determination method may specifically include the following steps:
[0085] Step S610: reorder the candidate knowledge texts in the plurality of groups of candidate knowledge text sequences according to the arrangement position of each candidate knowledge text in each candidate knowledge text sequence.
[0086] Specifically, this embodiment can reorder the candidate knowledge texts in multiple groups of candidate knowledge text sequences according to the arrangement position of each candidate knowledge text in each candidate knowledge text sequence.
[0087] Optionally, in step S610, the present embodiment may determine the ranking score of the candidate knowledge text according to the arrangement position of each candidate knowledge text in each candidate knowledge text sequence, and re-rank each candidate knowledge text from large to small according to the ranking score. Further, the ranking score may be the sum of the reciprocals of the arrangement positions of the candidate knowledge texts in each candidate knowledge text sequence.
[0088] Figure 5 FIG. 1 is a schematic diagram of a candidate knowledge text reordering process according to an embodiment of the present invention. Figure 5 As shown, candidate knowledge text sequence A includes candidate knowledge texts a, c and b arranged in sequence, candidate knowledge text sequence B includes candidate knowledge texts a, b and c arranged in sequence, and candidate knowledge text sequence C includes candidate knowledge texts e, a and d arranged in sequence. According to the arrangement position of each candidate knowledge text in each candidate knowledge text sequence, this embodiment can determine the ranking score of each candidate knowledge text. That is, the ranking score of candidate knowledge text a is determined to be 5 / 2, the ranking score of candidate knowledge text b is determined to be 5 / 6, the ranking score of candidate knowledge text c is determined to be 5 / 6, the ranking score of candidate knowledge text d is determined to be 1 / 3, and the ranking score of candidate knowledge text e is determined to be 1. After determining the ranking score of each candidate knowledge text, this embodiment can re-rank each candidate knowledge text from large to small according to the ranking score (the re-ranked candidate knowledge texts are shown in sequence 51). It should be understood that the candidate knowledge text re-ranking process given above is only for illustration. In actual application, the candidate knowledge text re-ranking process is not limited to this.
[0089] Step S620: select a preset number of candidate knowledge texts ranked top among the re-ranked candidate knowledge texts as target knowledge texts to determine a target knowledge text sequence.
[0090] Specifically, after reordering the candidate knowledge texts in the plurality of groups of candidate knowledge text sequences, this embodiment may select a preset number of candidate knowledge texts with top rankings from the reordered candidate knowledge texts as target knowledge texts, thereby determining the target knowledge text sequence.
[0091] It should be understood that the candidate knowledge texts in each candidate knowledge text sequence are actually knowledge texts related to the knowledge that the user wants to acquire when only a single knowledge field is considered. By reordering the candidate knowledge texts in multiple groups of candidate knowledge text sequences and selecting the candidate knowledge texts with the highest ranking after reordering as the target knowledge texts, this embodiment can find the target knowledge texts related to the knowledge that the user wants to acquire when considering multiple knowledge fields at the same time in multiple groups of candidate knowledge text sequences.
[0092] Optionally, since the target knowledge text is the knowledge text related to the knowledge that the user wants to acquire when considering multiple knowledge fields at the same time, after determining the target knowledge text sequence, this embodiment can also adjust the parameters of the large-scale text embedding model according to the natural language query sentence and each target knowledge text. Therefore, this embodiment can also continuously iterate and update the large-scale text embedding model while using the large-scale text embedding model, thereby improving the vector conversion accuracy of the large-scale text embedding model.
[0093] Step S700: input the natural language query statement and the multiple target knowledge texts into a target large language model to generate feedback information through the target large language model.
[0094] Specifically, after obtaining a plurality of target knowledge texts, this embodiment may input the target knowledge texts and natural language query sentences into the target large language model to obtain feedback information.
[0095] Optionally, in step S700, this embodiment can construct a feedback prompt sentence according to the natural language query sentence and multiple target knowledge texts, and input the feedback prompt sentence into the target large language model to generate feedback information through the target large language model. The feedback prompt sentence is used to guide the target large language model to generate feedback information.
[0096] Furthermore, the feedback prompt statement can be constructed by filling a natural language query statement and multiple target knowledge texts into a feedback prompt template. Among them, the feedback prompt template can be a sentence template prepared in advance by relevant personnel. The feedback prompt template may include feedback instructions and feedback information generation requirements. Feedback instructions are instructions used to indicate the tasks that the large language model needs to complete. For example, the feedback instruction may be "Please generate feedback information that meets the feedback information generation requirements based on the natural language query statement and multiple target knowledge texts." The feedback information generation requirements are related requirements for the generation of feedback information by the large language model. For example, the feedback information generation requirements may be "Avoid using open domain knowledge, do not allow fabricated elements to be added to the answer, please use Chinese for the answer, and the feedback information is in markdown format."
[0097] Exemplarily, assuming that the natural language query statement is "What are the indicators related to DAU", and the target knowledge texts are knowledge text f and knowledge text g, the feedback prompt statement constructed in step S700 can be: [Please generate feedback information that meets the feedback information generation requirements based on the natural language query statement and multiple target knowledge texts. Among them, the natural language query statement is: "What are the indicators related to DAU". The multiple target knowledge texts are: "Knowledge text f; knowledge text g". The feedback information generation requirements are: "Avoid using open domain knowledge, and do not allow fabricated elements to be added to the answer. Please use Chinese for the answer, and the feedback information is in markdown format"]. It should be understood that the feedback prompt statements given above are only for illustration. In actual application, the content included in the feedback prompt statement is not limited to this.
[0098] Optionally, before inputting the natural language query sentence and multiple target knowledge texts into the target large language model to generate feedback information through the target large language model, this embodiment can also obtain the knowledge text corresponding to the preset query intent when the query intent includes the preset query intent, and determine the knowledge text corresponding to the preset query intent as the target knowledge text when the target knowledge text does not include the knowledge text corresponding to the preset query intent. Thus, this embodiment can improve the accuracy of the feedback of the large language model on special field problems.
[0099] Optionally, before inputting the natural language query statement and the plurality of target knowledge texts into the target large language model to generate feedback information through the target large language model, the present embodiment may also obtain the knowledge text corresponding to the preset keyword when the natural language query statement contains the preset keyword, and determine the knowledge text corresponding to the preset keyword as the target knowledge text when the target knowledge text does not include the knowledge text corresponding to the preset keyword. Thus, the present embodiment may provide the large language model with the minimum knowledge text necessary to answer the user's question, thereby ensuring that the large language model can still output feedback information of a certain level even when the recalled knowledge text is wrong or of poor quality.
[0100] Optionally, before using the target large language model to generate feedback information, this embodiment can also first input multiple target knowledge texts into the auxiliary large language model, so as to determine at least one question-answer pair through the auxiliary large language model, and adjust the model parameters of the target large language model according to each question-answer pair. Thus, this embodiment can use the auxiliary large language model to assist the target large language model in generating feedback information, thereby improving the quality of the feedback information generated by the target large language model.
[0101] Figure 6 FIG. 1 is a schematic diagram of a natural language query process according to an embodiment of the present invention. Figure 6 As shown, after obtaining the natural language query statement 61 input by the user, this embodiment can determine the intent type of the natural language query statement 61 through the first intent recognition. When the intent type is knowledge retrieval, this embodiment can perform a second intent recognition on the natural language query statement 61 to obtain at least one query intent 62. Among them, the query intent 62 can be used to characterize the knowledge field to which the knowledge retrieval content belongs. After obtaining at least one query intent 62, this embodiment can rewrite the natural language query statement 61 according to each query intent 62 to obtain multiple query sentences 63, and retrieve and obtain the corresponding candidate knowledge text sequences 64 according to the multiple query sentences 63, and then reorder the candidate knowledge texts in the multiple candidate knowledge text sequences 64 to determine the target knowledge text sequence 65. After determining the target knowledge text sequence 65, this embodiment can input the target knowledge text and the natural language query statement 61 in the target knowledge text sequence 65 into the target large language model 66, thereby obtaining feedback information 67.
[0102] The embodiment of the present invention, after determining that the intent type of a natural language query statement is knowledge retrieval through a first intent recognition, performs a second intent recognition on the natural language query statement to obtain at least one query intent for characterizing the knowledge field to which the knowledge retrieval content belongs, rewrites the natural language query statement according to the query intent to obtain multiple query sentences, retrieves multiple candidate knowledge text sequences according to the multiple query sentences, reorders the candidate knowledge texts in the multiple candidate knowledge text sequences to determine a target knowledge text sequence, inputs the target knowledge text and the natural language query statement into a target large language model to obtain feedback information. Thus, by understanding the user intent from multiple dimensions and performing knowledge retrieval, and then giving the user feedback based on the retrieved target knowledge text, the implementation of the present invention can provide users with more intelligent and precise question-and-answer services.
[0103] Figure 7 FIG. 1 is a schematic diagram of a natural language query device according to an embodiment of the present invention. Figure 7 As shown, the natural language query device of an embodiment of the present invention includes a query statement acquisition unit 71, a first intent recognition unit 72, a second intent recognition unit 73, a query question generation unit 74, a text sequence acquisition unit 75, a sorting unit 76 and a feedback information generation unit 77.
[0104] Specifically, the query statement acquisition unit 71 is used to acquire a natural language query statement;
[0105] The first intent recognition unit 72 is used to perform a first intent recognition on the natural language query sentence to obtain an intent type, where the intent type includes knowledge retrieval and other intents;
[0106] The second intent recognition unit 73 is used for performing a second intent recognition on the natural language query statement in response to the intent type being knowledge retrieval to obtain at least one query intent, wherein the query intent is used to characterize the knowledge field to which the knowledge retrieval content belongs;
[0107] The query sentence generating unit 74 is used to generate corresponding multiple query sentences according to the natural language query sentence and the query intention for each query intention;
[0108] The text sequence acquisition unit 75 is used to perform knowledge retrieval in a preset knowledge base according to each query sentence to obtain multiple groups of candidate knowledge text sequences, each of which includes multiple candidate knowledge texts arranged in sequence;
[0109] The sorting unit 76 is used to re-sort the candidate knowledge texts in the plurality of groups of candidate knowledge text sequences to determine a target knowledge text sequence, wherein the target knowledge text sequence includes a plurality of target knowledge texts arranged in an order determined by the re-sorting;
[0110] The feedback information generating unit 77 is used to input the natural language query sentence and the multiple target knowledge texts into the target large language model to generate feedback information through the target large language model.
[0111] The embodiment of the present invention, after determining that the intent type of a natural language query statement is knowledge retrieval through a first intent recognition, performs a second intent recognition on the natural language query statement to obtain at least one query intent for characterizing the knowledge field to which the knowledge retrieval content belongs, rewrites the natural language query statement according to the query intent to obtain multiple query sentences, retrieves multiple candidate knowledge text sequences according to the multiple query sentences, reorders the candidate knowledge texts in the multiple candidate knowledge text sequences to determine a target knowledge text sequence, inputs the target knowledge text and the natural language query statement into a target large language model to obtain feedback information. Thus, by understanding the user intent from multiple dimensions and performing knowledge retrieval, and then giving the user feedback based on the retrieved target knowledge text, the implementation of the present invention can provide users with more intelligent and precise question-and-answer services.
[0112] Figure 8 Schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device may be a server or a terminal in the above-mentioned embodiment. Figure 8 As shown, the electronic device includes at least one processor 81; a memory 82 communicatively connected to at least one processor 81; and a communication component 83 communicatively connected to a scanning device, wherein the communication component 83 receives and sends data under the control of the processor 81; wherein the memory 82 stores instructions executable by at least one processor 81, and the instructions are executed by at least one processor 81 to implement the above-mentioned natural language query method.
[0113] Specifically, the electronic device includes: one or more processors 81 and a memory 82, Figure 8 A processor 81 is taken as an example. The processor 81 and the memory 82 may be connected via a bus or other means. Figure 8 In the example, the bus connection is used. The memory 82 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 81 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 82, that is, realizing the above-mentioned natural language query method.
[0114] The memory 82 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store a list of options, etc. In addition, the memory 82 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 82 may optionally include a memory remotely arranged relative to the processor 81, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0115] One or more modules are stored in the memory 82, and when executed by one or more processors 81, the natural language query method in any of the above method embodiments is executed.
[0116] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0117] The embodiment of the present invention, after determining that the intent type of a natural language query statement is knowledge retrieval through a first intent recognition, performs a second intent recognition on the natural language query statement to obtain at least one query intent for characterizing the knowledge field to which the knowledge retrieval content belongs, rewrites the natural language query statement according to the query intent to obtain multiple query sentences, retrieves multiple candidate knowledge text sequences according to the multiple query sentences, reorders the candidate knowledge texts in the multiple candidate knowledge text sequences to determine a target knowledge text sequence, inputs the target knowledge text and the natural language query statement into a target large language model to obtain feedback information. Thus, by understanding the user intent from multiple dimensions and performing knowledge retrieval, and then giving the user feedback based on the retrieved target knowledge text, the implementation of the present invention can provide users with more intelligent and precise question-and-answer services.
[0118] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0119] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0120] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A natural language query method, It is characterized in that The method comprises: Obtain natural language query statements; Performing a first intent recognition on the natural language query statement to obtain an intent type, wherein the intent type includes knowledge retrieval and other intents; In response to the intent type being knowledge retrieval, performing second intent recognition on the natural language query statement to obtain a plurality of query intents, wherein the query intents are used to characterize the knowledge domain to which the knowledge retrieval content belongs; For each of the query intentions, generating a corresponding plurality of query sentences according to the natural language query sentence and the query intention; For each query sentence, determining a knowledge group corresponding to the query sentence in a preset knowledge base according to the knowledge field to which the query sentence belongs, wherein the preset knowledge base includes a plurality of knowledge groups, and the plurality of knowledge groups are respectively used to store knowledge texts belonging to the corresponding knowledge field; For each query sentence, knowledge retrieval is performed in the corresponding knowledge group according to the query sentence to obtain a candidate knowledge text sequence, wherein the candidate knowledge text sequence includes a plurality of candidate knowledge texts arranged in sequence, and the candidate knowledge texts in the candidate knowledge text sequence are knowledge texts related to the knowledge retrieval content when a single knowledge field is considered; Reordering the candidate knowledge texts in the plurality of groups of the candidate knowledge text sequences to determine a target knowledge text sequence, wherein the target knowledge text sequence includes a plurality of target knowledge texts arranged in an order determined by the reordering, and the target knowledge texts in the target knowledge text sequence are candidate knowledge texts related to the knowledge retrieval content when considering a plurality of knowledge fields; The natural language query sentence and the plurality of target knowledge texts are input into a target large language model to generate feedback information through the target large language model.
2. The method according to claim 1, It is characterized in that The performing knowledge retrieval in the corresponding knowledge group according to the query sentence to obtain a candidate knowledge text sequence comprises: In the corresponding knowledge grouping, multiple candidate knowledge texts are determined according to the vector expression similarity between the query sentence and each of the knowledge texts to obtain a candidate knowledge text sequence, wherein the multiple candidate knowledge texts in the candidate knowledge text sequence are sorted according to the vector expression similarity between the query sentence and each of the knowledge texts.
3. The method according to claim 2, It is characterized in that The vector expressions of the query sentence and each of the knowledge texts are determined by a large-scale text embedding model.
4. The method according to claim 3, It is characterized in that After reordering the candidate knowledge texts in the plurality of groups of the candidate knowledge text sequences to determine a target knowledge text sequence, the method further includes: The parameters of the large-scale text embedding model are adjusted according to the natural language query sentence and each of the target knowledge texts.
5. The method according to claim 1, It is characterized in that The reordering of the candidate knowledge texts in the plurality of groups of the candidate knowledge text sequences to determine the target knowledge text sequence comprises: Reordering the candidate knowledge texts in the plurality of groups of the candidate knowledge text sequences according to the arrangement position of each candidate knowledge text in each candidate knowledge text sequence; A preset number of candidate knowledge texts ranked top are selected from the re-ranked candidate knowledge texts as target knowledge texts to determine a target knowledge text sequence.
6. The method according to claim 1, It is characterized in that Before inputting the natural language query sentence and the plurality of target knowledge texts into a target large language model to generate feedback information through the target large language model, the method further includes: In response to the natural language query sentence containing a preset keyword, obtaining a knowledge text corresponding to the preset keyword; In response to the target knowledge text not including the knowledge text corresponding to the preset keyword, the knowledge text corresponding to the preset keyword is determined as the target knowledge text.
7. The method according to claim 1, It is characterized in that Before inputting the natural language query sentence and the plurality of target knowledge texts into a target large language model to generate feedback information through the target large language model, the method further includes: In response to the query intent including a preset query intent, obtaining a knowledge text corresponding to the preset query intent; In response to the target knowledge text not including the knowledge text corresponding to the preset query intention, the knowledge text corresponding to the preset query intention is determined as the target knowledge text.
8. The method according to claim 1, It is characterized in that Before inputting the natural language query sentence and the plurality of target knowledge texts into a target large language model to generate feedback information through the target large language model, the method further includes: Inputting the plurality of target knowledge texts into an auxiliary large language model to determine at least one question-answer pair through the auxiliary large language model; The model parameters of the target large language model are adjusted according to each of the question-answer pairs.
9. The method according to claim 1, It is characterized in that The generating of a plurality of corresponding query sentences according to the natural language query sentence and the query intention comprises: Constructing a rewriting prompt sentence according to the natural language query sentence and the query intention; The rewriting prompt sentence is input into the auxiliary large language model to generate multiple query sentences through the auxiliary large language model, and the rewriting prompt sentence is used to guide the auxiliary large language model to generate multiple query sentences.
10. The method according to claim 1, It is characterized in that The inputting the natural language query statement and the plurality of target knowledge texts into a target large language model to generate feedback information through the target large language model comprises: Constructing a feedback prompt sentence according to the natural language query sentence and the plurality of target knowledge texts; The feedback prompt sentence is input into the target large language model to generate feedback information through the target large language model, and the feedback prompt sentence is used to guide the target large language model to generate the feedback information.
11. The method according to claim 1, It is characterized in that The performing first intent recognition on the natural language query statement to obtain the intent type includes: Constructing a first intent recognition prompt sentence according to the natural language query sentence; The first intention recognition prompt sentence is input into the auxiliary large language model to determine the intention type through the auxiliary large language model, and the intention recognition prompt sentence is used to guide the auxiliary large language model to determine the intention type.
12. The method according to claim 1, It is characterized in that The performing second intent recognition on the natural language query statement to obtain at least one query intent comprises: Constructing a second intent recognition prompt sentence according to the natural language query sentence; The second intent recognition prompt sentence is input into the auxiliary large language model to determine at least one query intent through the auxiliary large language model, and the intent recognition prompt sentence is used to guide the auxiliary large language model to determine the query intent.
13. A natural language query device, It is characterized in that The device comprises: A query statement acquisition unit, used to acquire a natural language query statement; A first intent recognition unit, configured to perform a first intent recognition on the natural language query statement to obtain an intent type, wherein the intent type includes knowledge retrieval and other intents; A second intent recognition unit is used for, in response to the intent type being knowledge retrieval, performing second intent recognition on the natural language query sentence to obtain a plurality of query intents, wherein the query intents are used to characterize the knowledge domain to which the knowledge retrieval content belongs; A query sentence generating unit, configured to generate a plurality of corresponding query sentences for each query intent according to the natural language query sentence and the query intent; a knowledge group determination unit, configured to determine, for each query sentence, a knowledge group corresponding to the query sentence in a preset knowledge base according to the knowledge field to which the query sentence belongs, wherein the preset knowledge base includes a plurality of knowledge groups, and the plurality of knowledge groups are respectively used to store knowledge texts belonging to corresponding knowledge fields; A text sequence acquisition unit is used for performing knowledge retrieval in the corresponding knowledge group according to each query sentence to acquire a candidate knowledge text sequence, wherein the candidate knowledge text sequence includes a plurality of candidate knowledge texts arranged in sequence, and the candidate knowledge texts in the candidate knowledge text sequence are knowledge texts related to the knowledge retrieval content when considering a single knowledge field; a sorting unit, for re-sorting candidate knowledge texts in a plurality of groups of candidate knowledge text sequences to determine a target knowledge text sequence, wherein the target knowledge text sequence includes a plurality of target knowledge texts arranged in an order determined by the re-sorting, and the target knowledge texts in the target knowledge text sequence are candidate knowledge texts related to the knowledge retrieval content when considering a plurality of knowledge fields; The feedback information generating unit is used to input the natural language query sentence and the multiple target knowledge texts into a target large language model to generate feedback information through the target large language model.
14. A computer readable storage medium having computer program instructions stored thereon, It is characterized in that The computer program instructions implement the method according to any one of claims 1 to 12 when executed by a processor.
15. An electronic device, It is characterized in that The device comprises: a memory for storing one or more computer program instructions; A processor, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 12.
16. A computer program product, It is characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 12.
