Knowledge slice recall method and device, equipment, medium and program product
By using intent classification and mapping dictionary in the RAG system combined with semantics and vector retrieval methods, the problem of inaccurate recall of the problem is solved, the accuracy and matching of knowledge slicing recall in the existing technology is improved, and the user experience is improved.
Patent Information
- Application Number
- CN202510466271.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-07-29
AI Technical Summary
The existing RAG system easily retrieves knowledge slices that do not match the problem intention in the knowledge slice recall, resulting in poor matching and accuracy between the recalled knowledge slices and the user's problem intention, affecting the user experience.
The intent category of the problem text is determined through the preset intent classification model, and the intent mapping dictionary is used to obtain the intent list, and the target knowledge slice is retrieved in the knowledge slice associated with the intent list, and the target knowledge slice that meets the problem text is recalled.
It improves the accuracy and relevance of knowledge slicing recall, enhances the matching between knowledge slicing and problem text, and improves user experience.
Smart Images

Figure CN120386859A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big data technology, and particularly to a method, device, equipment, medium and program product for knowledge slice recall. Background Art
[0002] In related technologies, a RAG (Retrieval-Augmented Generation) system usually retrieves knowledge slice vectors in a knowledge base through question vectors to return knowledge slices corresponding to the knowledge slice vectors to a user. However, this method usually easily retrieves knowledge slices that do not match the question intention, resulting in poor matching between the recalled knowledge slices and the user's question intention and poor accuracy of the recalled knowledge slices, thus affecting the user experience. Summary of the Invention
[0003] The present disclosure provides a method, device, equipment, medium and program product for knowledge slice recall. The technical solution of the present disclosure is as follows:
[0004] In a first aspect, the present disclosure provides a method for knowledge slice recall, including:
[0005] When receiving a user's question text, determining an intention category of the question text through a preset intention classification model; wherein, the preset intention classification model is trained based on a large model and is used to map the question text to a preset intention category;
[0006] Obtaining an intention list corresponding to the intention category through an intention mapping dictionary; wherein, the intention mapping dictionary is used to map a single intention category to an intention list including multiple intention categories;
[0007] Retrieving a target knowledge slice that conforms to the question text from the knowledge slices associated with the intention list;
[0008] Recalling the target knowledge slice.
[0009] In a possible implementation manner, before determining the intention category of the question text through the preset intention classification model when receiving the user's question text, the method further includes:
[0010] Processing a knowledge document to obtain knowledge slices;
[0011] Performing intention recognition on each knowledge slice through the preset intention classification model to obtain an intention list corresponding to each knowledge slice; wherein, each knowledge slice is associated with at least one intention category;
[0012] Storing the intention list corresponding to each knowledge slice.
[0013] In a possible implementation manner, retrieving a target knowledge slice that conforms to the problem text in the knowledge slices associated with the intent list includes:
[0014] Retrieving a target knowledge slice that conforms to the problem text in the knowledge slices associated with the intent list through a preset retrieval method; wherein, the preset retrieval method includes semantic retrieval and vector retrieval.
[0015] In a possible implementation manner, retrieving a target knowledge slice that conforms to the problem text in the knowledge slices associated with the intent list through a preset retrieval method includes:
[0016] Determining the target problem intent of the problem text;
[0017] When the target problem intent is a query parameter intent, routing the target problem intent to the device parameter index;
[0018] Through the preset retrieval method and the device parameter index, retrieving a target knowledge slice that conforms to the problem text in the knowledge slices associated with the intent list through the preset retrieval method;
[0019] When the target problem intent is not the query parameter intent, routing the target problem intent to the document index;
[0020] Through the preset retrieval method and the document index, retrieving a target knowledge slice that conforms to the problem text in the knowledge slices associated with the intent list through the preset retrieval method.
[0021] In a possible implementation manner, the intent categories at least include: port statistics information tool, device parameter query tool, procedure assistant tool, maintenance and operation assistant tool, regulations and standards assistant tool, industry term tool, fault solution tool, others.
[0022] In a possible implementation manner, it further includes:
[0023] In a multi-round dialogue scenario, determining whether the current dialogue problem text is a continuation of the previous round of dialogue problem text;
[0024] When the current dialogue problem text is a continuation of the previous round of dialogue problem text, inheriting the intent category of the previous round of dialogue.
[0025] In a second aspect, the present disclosure provides a knowledge slice recall device, including:
[0026] A classification module, configured to determine the intent category of the question text by using a preset intent classification model when receiving the question text of a user; wherein, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent category;
[0027] An acquisition module, configured to acquire an intent list corresponding to the intent category by using an intent mapping dictionary; wherein, the intent mapping dictionary is used to map a single intent category to an intent list including multiple intent categories;
[0028] A retrieval module, configured to retrieve a target knowledge slice that conforms to the question text from knowledge slices associated with the intent list;
[0029] A recall module, configured to recall the target knowledge slice.
[0030] In a third aspect, the present disclosure provides an electronic device, including:
[0031] A processor;
[0032] A memory for storing executable instructions of the processor;
[0033] Wherein, the processor is configured to execute the instructions to implement the knowledge slice recall method described in the first aspect.
[0034] In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the knowledge slice recall method described in the first aspect.
[0035] In a fifth aspect, the present disclosure provides a computer program product, including computer programs / instructions, wherein the computer programs / instructions, when executed by a processor, implement the knowledge slice recall method described in the first aspect.
[0036] The technical solutions disclosed in the present disclosure at least bring the following beneficial effects:
[0037] In an embodiment of the present disclosure, when a question text of a user is received, the intent category of the question text is determined through a preset intent classification model; wherein, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent classification; an intent list corresponding to the intent category is obtained through an intent mapping dictionary; wherein, the intent mapping dictionary is used to map a single intent category to an intent list including multiple intent categories; in a knowledge slice associated with the intent list, a target knowledge slice that conforms to the question text is retrieved; and the target knowledge slice is recalled. In this way, by increasing the intent classification of the question text and the intent classification of the knowledge slice, the knowledge slice related to the question can be recalled more precisely, the accuracy of the recalled knowledge slice can be improved, the relevance and matching degree between the recalled knowledge slice and the question text can be improved, and thus the user experience can be effectively improved.
[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure and do not constitute an improper limitation to the present disclosure.
[0040] Figure 1 It is a schematic flowchart of a method for recalling a knowledge slice provided by an embodiment of the present disclosure;
[0041] Figure 2 It is a logical schematic diagram of a method for recalling a knowledge slice provided by an embodiment of the present disclosure;
[0042] Figure 3 It is a schematic structural diagram of a device for recalling a knowledge slice provided by an embodiment of the present disclosure;
[0043] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0045] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present disclosure are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0046] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0047] In the technical solution of the present disclosure, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.
[0048] It should be noted that in the embodiments of the present disclosure, there may be existing solutions in the industry for certain software, components, models, etc. They should be regarded as exemplary. The purpose is only to illustrate the feasibility in the implementation of the technical solution of the present disclosure, but it does not mean that the applicant has already or necessarily used this solution.
[0049] Based on the background art, it can be seen that current mainstream RAG systems usually directly retrieve the knowledge slice vectors of the knowledge base with the question vector of the question text input by the user. Since this method only focuses on the similarity between the question text and the knowledge slice, the similarity score between the vectors transformed from the question text and the knowledge slice is often low, because the question text usually has only 20 to 30 words, while the knowledge slice usually has 500 - 1000 words. This easily leads to retrieving knowledge slices that are different from the intention of the user's question text. Therefore, relying solely on vector similarity is not sufficient to recall highly relevant knowledge slices, and a more accurate method for recalling relevant slices is needed.
[0050] Based on this, the embodiments of the present disclosure provide a method, apparatus, device, medium, and program product for knowledge slice recall. The method can identify the intent list of knowledge slices by performing intent recognition on knowledge slices. When a user asks a question, the intent category of the user's question text is identified by performing intent recognition on the question text. During retrieval, knowledge slices that meet the user's intent are retrieved and recalled. In this way, by adding the intent classification of the question text and the intent classification of knowledge slices, knowledge slices related to the question can be recalled more precisely, improving the accuracy of the recalled knowledge slices, the relevance and matching between the recalled knowledge slices and the question text, and thus effectively improving the user experience.
[0051] The following describes in detail the technical solutions provided by the embodiments of the present disclosure with reference to the accompanying drawings.
[0052] The following is an explanation of some terms used in the embodiments of the present disclosure:
[0053] Intent category: Refers to the intent classification of the question input by the user. For example, for the question 'What is the typhoon resistance level of the 1800th ship unloader?', the intent category of the user is to inquire about equipment parameters.
[0054] Vector: A digital representation form of text or pictures, which is a multi-dimensional floating-point number matrix.
[0055] Milvus: An open-source database for storing and retrieving vectors.
[0056] Prompt: Prompt word.
[0057] RAG: A retrieval-enhanced technology, usually used in large model knowledge base systems. Based on the user's question text, knowledge slices in the knowledge base are retrieved to find knowledge slices related to the question and provide more accurate answers to the large model.
[0058] Figure 1 The following is a flowchart of a method for knowledge slice recall provided by the embodiments of the present disclosure. This method can be applied to a server, such as a single server or a server cluster. As Figure 1 shown, the method for knowledge slice recall may include the following steps:
[0059] S101, when receiving the question text of the user, determine the intent category of the question text through a preset intent classification model.
[0060] Among them, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent classification.
[0061] In an embodiment of the present disclosure, when the question text input by the user is received, the question text can be input into a pre-trained preset intention classification model, and the question text can be classified by the preset intention classification model to obtain the intention category of the user's question text. It can be understood that the preset intention classification model can be pre-trained based on a large model, which can map the question text to a preset intention category, and the preset intention category can be predefined. For example, it can include categories such as port statistics information tool, equipment parameter query tool, procedure assistant tool, maintenance and operation assistant tool, regulations and standards assistant tool, industry term tool, fault solution tool, others, etc. It can be understood that the intention category can also be set with other customizations according to actual needs.
[0062] S102, obtain the intention list corresponding to the intention category through the intention mapping dictionary.
[0063] Among them, the intention mapping dictionary is used to map a single intention category to an intention list containing multiple intention categories. The intention mapping dictionary is a tool that can map the intention category of the question text expressed by the user to the instruction or behavior of the solution.
[0064] In an embodiment of the present disclosure, after determining the intention category of the question text input by the user, the intention list corresponding to the intention category can be determined. Exemplarily, the intention list corresponding to the intention category can be determined through the intention mapping dictionary. As an example, after the intention category of the user's question text is obtained through a large model (preset intention classification model), it will not be used as the intention category for the final retrieval of knowledge slices, but this intention is used to obtain the intention list through the intention mapping dictionary. For example: Question text: What are the ten non-lifting rules of the crane; Intention category recognized by the large model: Procedure assistant tool; The intention list obtained through the intention mapping dictionary can be: Procedure assistant tool, maintenance operation manual, maintenance plan, equipment technical basic information. As an example, an intention mapping dictionary structure can be designed in advance. For example, the intention mapping dictionary can be designed as a multi-level dictionary structure. For example: the key of the outer dictionary is the intention category, and the value of the outer dictionary is the intention list under this intention category. In this way, the corresponding intention list can be quickly accessed directly through the intention category as the key; then, according to actual needs, create an intention mapping dictionary based on the multi-level dictionary structure; then, a query function can be defined, and this query function is called to obtain the corresponding intention list through the intention category and output the intention list. It can be understood that the content of the intention mapping dictionary can be added, deleted, changed, etc. according to actual needs. In this way, a more comprehensive intention list can be obtained through the intention mapping dictionary, thereby expanding the recall retrieval range.
[0065] S103, retrieve the target knowledge slice that conforms to the question text from the knowledge slices associated with the intention list.
[0066] In an embodiment of the present disclosure, after obtaining the intent list corresponding to the intent category, knowledge slices associated with the intent list can be determined. Then, among these knowledge slices associated with the intent list corresponding to the intent category, the knowledge slice that matches the question text is retrieved as the target knowledge slice. It can be understood that a large model can be pre-called to identify the intent category of each knowledge slice to obtain the intent list corresponding to each knowledge slice; during retrieval, the knowledge bases of ES (Elasticsearch) and Milvus can be retrieved.
[0067] S104, recall the target knowledge slice.
[0068] In an embodiment of the present disclosure, after retrieving the target knowledge slice that matches the question text, the knowledge slice can be recalled. Exemplarily, the target knowledge slice can be returned to the user and presented to the user as the answer to the question text input by the user.
[0069] In an embodiment of the present disclosure, when receiving the question text of the user, the intent category of the question text is determined by a preset intent classification model; wherein, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent classification; the intent list corresponding to the intent category is obtained through an intent mapping dictionary; wherein, the intent mapping dictionary is used to map a single intent category to an intent list including multiple intent categories; among the knowledge slices associated with the intent list, the target knowledge slice that matches the question text is retrieved; the target knowledge slice is recalled. In this way, by increasing the intent classification of the question text and the intent classification of the knowledge slices, the knowledge slices related to the question can be recalled more accurately, the accuracy of the recalled knowledge slices can be improved, the relevance and matching degree between the recalled knowledge slices and the question text can be improved, and thus the user experience can be effectively improved.
[0070] In some possible implementation manners, before determining the intent category of the question text by a preset intent classification model when receiving the question text of the user, it further includes:
[0071] Process the knowledge documents to obtain knowledge slices;
[0072] Perform intent recognition on each knowledge slice through a preset intent classification model to obtain the intent list corresponding to each knowledge slice; wherein, each knowledge slice is associated with at least one intent category;
[0073] Store the intent list corresponding to each knowledge slice.
[0074] In an embodiment of the present disclosure, an intent list for each knowledge slice can be determined and stored in advance. Exemplarily, the knowledge document can be preprocessed and sliced in advance to obtain knowledge slices. Then, each knowledge slice is subjected to intent recognition processing through a preset intent classification model to obtain the intent category corresponding to each knowledge slice. Each knowledge slice corresponds to at least one intent category, that is, each knowledge slice is associated with at least one intent category. Then, the intent categories corresponding to each knowledge slice can be formed into an intent list to obtain the intent list corresponding to each knowledge slice. After that, the intent list corresponding to each knowledge slice can be stored, for example, stored in a database, to provide data support for subsequent knowledge slice recall.
[0075] In some possible implementation manners, in the knowledge slices associated with the intent list, retrieving the target knowledge slice that conforms to the question text includes:
[0076] In the knowledge slices associated with the intent list, the target knowledge slice that conforms to the question text is retrieved through a preset retrieval method.
[0077] Among them, the preset retrieval methods include semantic retrieval and vector retrieval.
[0078] In an embodiment of the present disclosure, the target knowledge slice can be retrieved by combining semantic retrieval and vector retrieval. Exemplarily, on the one hand, by understanding the semantic meaning of the query text, the knowledge slices semantically related to the question text can be retrieved from the knowledge base. For example, natural language processing techniques can be used to parse the semantic meanings of the query question text and the knowledge slices, and by calculating the similarity between the two (such as cosine similarity), the knowledge slice with the highest similarity is selected as the result of semantic retrieval. On the other hand, the knowledge slice most relevant to the question text can also be retrieved by calculating vector similarity. For example, the question text and the knowledge slice are embedded into a high-dimensional vector space, such as through a pre-trained embedding model (such as Word2Vec, GloVe, Sentence-BERT, etc.), and then the similarity between the question text vector and the knowledge slice vector is calculated (such as cosine similarity), and the knowledge slice with the highest similarity is selected as the result of vector retrieval. After that, the semantic retrieval result and the vector retrieval result are combined to improve the accuracy and efficiency of retrieval. For example, first use the semantic retrieval result to preliminarily screen out the knowledge slices semantically related to the question text, and then use the vector retrieval result to further screen the screened knowledge slices to determine the final target knowledge slice. In this way, by combining semantic retrieval and vector retrieval, the target knowledge slice that conforms to the question text can be retrieved from the knowledge slices associated with the intent list. First, semantic retrieval is performed for screening, and then vector retrieval is performed for fine ranking, which can effectively improve the accuracy of the retrieval effect and thus improve the accuracy of the target knowledge slice.
[0079] In some possible embodiments, in the knowledge slice associated with the intent list, retrieving the target knowledge slice that matches the question text through a preset retrieval method includes:
[0080] Determine the target question intent of the question text;
[0081] In the case where the target question intent is a query parameter intent, route the target question intent to the device parameter index;
[0082] Through the preset retrieval method and the device parameter index, in the knowledge slice associated with the intent list, retrieve the target knowledge slice that matches the question text through the preset retrieval method;
[0083] In the case where the target question intent is not a query parameter intent, route the target question intent to the document index;
[0084] Through the preset retrieval method and the document index, in the knowledge slice associated with the intent list, retrieve the target knowledge slice that matches the question text through the preset retrieval method.
[0085] In the embodiments of the present disclosure, two intent routing indexes can be set: the device parameter index and the document index. Exemplarily, the question intent of the question text can be determined, that is, the target question intent. For example, it can be determined whether the question intent of the question text is the intent to query device parameters. In the case where the target question intent is a query parameter intent, only route the target question intent to the device parameter index, and then through the preset retrieval method and the device parameter index, retrieve the target knowledge slice that matches the question text in the knowledge slice associated with the intent list. For example, the knowledge slices pointed to by the device parameter index can be determined in the knowledge slice associated with the intent list, and then the key information of these knowledge slices and the key information of the question text, such as the device ID (if any) and the parameter type, can be extracted; use semantic understanding technology (such as the BERT model) to encode the question text and the knowledge slice, calculate the semantic similarity, and find the most relevant knowledge slice; then embed the question text and the relevant knowledge slice into a high-dimensional vector space, and find the most relevant knowledge slice as the target knowledge slice through vector similarity calculation (such as cosine similarity). Conversely, in the case where the target question intent is not a query parameter intent, route the target question intent to the document index. Then determine the knowledge slices pointed to by the document index in the knowledge slice associated with the intent list, and then retrieve the target knowledge slice that matches the question text in the knowledge slices pointed to by the document index through the preset retrieval method. In this way, the recall accuracy and efficiency of the knowledge slice can be improved.
[0086] In some possible embodiments, it further includes:
[0087] In a multi-round dialogue scenario, determine whether the current dialogue question text is a continuation of the previous round of dialogue question text;
[0088] In the case where the current dialogue problem text is a continuation of the previous dialogue problem text, inherit the intent category of the previous dialogue.
[0089] In an embodiment of the present disclosure, in a multi-round dialogue scenario, it is possible to determine whether the current dialogue problem text is a continuation of the previous dialogue problem text, that is, whether it is a follow-up question that continues the previous topic. If the current dialogue problem text is a continuation of the previous dialogue problem text, the intent category of the previous dialogue can be inherited. For example: The intent of asking about device parameters in the first round of questions should be inherited to the second round. When conducting a search in the second round of questions, indexes related to device parameters and corresponding documents should also be retrieved. As an example, assume the first question is: What is the wind resistance level of the 1800th ship unloader? The second question is: What is its original asset value? Then it can be determined that the second-round question is a follow-up question that continues the previous topic. Therefore, the intent of asking about device parameters in the first round of questions should be inherited to the second round. When conducting a search in the second round of questions, indexes related to device parameters and corresponding documents should also be retrieved.
[0090] To make the knowledge slice recall method provided by the embodiments of the present disclosure clearer, the following uses a specific example for illustration. The knowledge slice recall method provided by the embodiments of the present disclosure may include the following processes:
[0091] (1) Slice intent recognition: First, define the intent category of the user's question, and then obtain knowledge slices after slicing the knowledge document. After that, a large model can be called to perform intent recognition on each knowledge slice to obtain the intent list of each slice.
[0092] Among them, the intent categories can be as follows;
[0093] 1) Port statistics information tool
[0094] 2) Device parameter query tool
[0095] 3) Procedure assistant tool
[0096] 4) Maintenance and operation assistant tool
[0097] 5) Regulations and standards assistant tool
[0098] 6) Industry terminology tool
[0099] 7) Fault solution tool
[0100] 8) Others
[0101] (2) Question intent recognition: Perform intent recognition on the question text input by the user to obtain the intent category of the question text input by the user. Specifically as follows:
[0102] Multi-level Intent Mapping: After the user's question obtains the intent category through the large model, it will not be used as the final retrieved intent category. Instead, this intent category will be mapped to an intent list through the intent mapping dictionary. For example: The intent of the question "What are the ten non-lifting rules of the crane?" is recognized by the large model as the intent category "Regulation Assistant Tool". After mapping, the obtained intent list is: Regulation Assistant Tool, Maintenance Operation Manual, Repair and Maintenance Plan, Equipment Technical Basic Information. Through the intent mapping dictionary, a more comprehensive intent list can be obtained, thereby expanding the recall retrieval scope.
[0103] (3) Intent Routing Index: There are 2 types of indexing methods: Equipment Parameter Index and Document Index. When the user's intent is to query equipment parameters, it will only be routed to the Equipment Parameter Index, and other intent categories will be routed to the Document Index.
[0104] (4) Intent List of Problem Intent Retrieval Slices: In the retrieval and recall stage, use the intent category obtained by intent recognition to retrieve the knowledge bases of ES and Milvus to find the knowledge slices that meet the user's intent.
[0105] (5) Intent Inheritance: Intent inheritance means that in multi-turn conversations, if the new round of questions continues the topic with the previous round of questions, then the new round of conversation should inherit the intent of the previous round of conversation. For example: 1. What is the wind resistance level of the 1800th ship unloader? 2. What is its original asset value? The second-round question is a follow-up question that continues the previous round of topic. Therefore, the intent of the first-round question to query equipment parameters should be inherited to the second round. When the second-round question is retrieved, it should also retrieve the indexes and corresponding documents related to equipment parameters.
[0106] Combined with Figure 2 , a specific example of the knowledge slice recall method provided by the embodiments of the present disclosure may include the following processing:
[0107] Step 1: Intent Recognition
[0108] Intent Distribution Module: First, the system needs to recognize the intent category of the user's question text.
[0109] Classification: Classify the question text into predefined intent categories.
[0110] Retrieval: Use the obtained intent category to accurately retrieve the corresponding knowledge slice recall text.
[0111] Step 2: Intent Module Decision
[0112] intent_module: Determine which index to query according to the question intent.
[0113] If it is an equipment parameter query, query ES_Device_Params.
[0114] If it is a query for document content, query ES_Docs or Milvus_Docs, depending on whether vector retrieval is required.
[0115] Step 3: Query the device parameter index
[0116] Question + keyword group query: For questions identified as querying device parameters, the question text plus keyword groups can be used to query in the ES_Device_Params index.
[0117] Step 4: Query the document index
[0118] Question + keyword group query: For questions identified as querying document content, the question text plus keyword groups can be used to query in the ES_Docs index.
[0119] Step 5: Query the Milvus vector index
[0120] Question vector query: For question texts that require vector retrieval, the question text can be converted into vector form and queried in the Milvus_Docs index.
[0121] Most similar q expansion retrieval: After finding the vector most similar to the question vector, perform expansion retrieval to obtain more relevant information.
[0122] The specific implementation and technical effects of each step in this embodiment are similar to those of the above method embodiment, and will not be elaborated here.
[0123] Based on the same inventive concept, an embodiment of the present disclosure also provides a knowledge slice recall device. As Figure 3 shown, the knowledge slice recall device 300 includes:
[0124] A classification module 310, configured to, when receiving the user's question text, determine the intent category of the question text through a preset intent classification model; wherein, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent category;
[0125] An acquisition module 320, configured to obtain an intent list corresponding to the intent category through an intent mapping dictionary; wherein, the intent mapping dictionary is used to map a single intent category to an intent list including multiple intent categories;
[0126] A retrieval module 330, configured to retrieve a target knowledge slice that conforms to the question text in the knowledge slices associated with the intent list;
[0127] A recall module 340, configured to recall the target knowledge slice.
[0128] In a possible implementation, it further includes:
[0129] A slicing module, configured to process a knowledge document to obtain knowledge slices;
[0130] A slice classification module, configured to perform intent recognition on each of the knowledge slices through a preset intent classification model to obtain an intent list corresponding to each of the knowledge slices; wherein, each of the knowledge slices is associated with at least one intent category;
[0131] A storage module, configured to store the intent list corresponding to each of the knowledge slices.
[0132] In a possible implementation, the retrieval module 330 is configured to:
[0133] In the knowledge slices associated with the intent list, retrieve target knowledge slices that conform to the problem text through a preset retrieval method; wherein, the preset retrieval method includes semantic retrieval and vector retrieval.
[0134] In a possible implementation, the retrieval module 330 is configured to:
[0135] Determine the target problem intent of the problem text;
[0136] When the target problem intent is a query parameter intent, route the target problem intent to the device parameter index;
[0137] Through the preset retrieval method and the device parameter index, in the knowledge slices associated with the intent list, retrieve target knowledge slices that conform to the problem text through the preset retrieval method;
[0138] When the target problem intent is not the query parameter intent, route the target problem intent to the document index;
[0139] Through the preset retrieval method and the document index, in the knowledge slices associated with the intent list, retrieve target knowledge slices that conform to the problem text through the preset retrieval method.
[0140] In a possible implementation, the intent category at least includes: port statistics information tool, device parameter query tool, procedure assistant tool, maintenance and operation assistant tool, regulation and standard assistant tool, industry term tool, fault solution tool, others.
[0141] In a possible implementation, it further includes:
[0142] A determination module, configured to determine whether the current dialogue question text is a continuation of the previous dialogue question text in a multi-round dialogue scenario;
[0143] An inheritance module, configured to inherit the intent category of the previous round of dialogue when the current dialogue question text is a continuation of the previous round of dialogue question text.
[0144] The specific implementation manners and technical effects of the device provided by the embodiments of the present disclosure are similar to those of the above method embodiments, and will not be described in detail herein.
[0145] According to an embodiment of the present disclosure, the present disclosure also discloses an electronic device, a computer-readable storage medium, and a computer program product.
[0146] Figure 4 FIG. shows a schematic block diagram of an exemplary electronic device 400 that can be used to implement the embodiments of the present disclosure. The electronic device 400 is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0147] As Figure 4 shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0148] A plurality of components in the electronic device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disc, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0149] The computing unit 401 may be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 executes the various methods and processes described above, such as the knowledge slice recall method. For example, in some embodiments, the knowledge slice recall method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the knowledge slice recall method described above may be executed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the knowledge slice recall method in any other suitable manner (e.g., by means of firmware).
[0150] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special or general-purpose programmable processor, that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] The program code of the computer program product for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0152] In the context of this disclosure, a computer-readable storage medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can be a machine-readable signal medium or a machine-readable storage medium. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0153] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0154] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0155] A computer system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system or a server combined with a blockchain.
[0156] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.
[0157] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A knowledge slice recall method, characterized in that, Including: When receiving the question text of the user, determining the intent category of the question text through a preset intent classification model; wherein, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent category; Obtaining the intent list corresponding to the intent category through an intent mapping dictionary; wherein, the intent mapping dictionary is used to map a single intent category to an intent list including multiple intent categories; In the knowledge slices associated with the intent list, retrieving the target knowledge slice that conforms to the question text; Recalling the target knowledge slice.
2. The knowledge slice recall method according to claim 1, wherein Before the step of determining the intent category of the question text through a preset intent classification model when receiving the question text of the user, it further includes: Processing the knowledge document to obtain knowledge slices; Performing intent recognition on each knowledge slice through a preset intent classification model to obtain the intent list corresponding to each knowledge slice; wherein, each knowledge slice is associated with at least one intent category; Storing the intent list corresponding to each knowledge slice.
3. The knowledge slice recall method according to claim 1, wherein The step of retrieving the target knowledge slice that conforms to the question text in the knowledge slices associated with the intent list includes: In the knowledge slices associated with the intent list, retrieving the target knowledge slice that conforms to the question text through a preset retrieval method; wherein, the preset retrieval method includes semantic retrieval and vector retrieval.
4. The knowledge slice recall method according to claim 3, wherein The step of retrieving the target knowledge slice that conforms to the question text in the knowledge slices associated with the intent list includes: Determining the target question intent of the question text; When the target question intent is a query parameter intent, routing the target question intent to the device parameter index; Through the preset retrieval method and the device parameter index, retrieving the target knowledge slice that conforms to the question text in the knowledge slices associated with the intent list through the preset retrieval method; When the target question intent is not the query parameter intent, routing the target question intent to the document index; Through the preset retrieval method and the document index, retrieving the target knowledge slice that conforms to the question text in the knowledge slices associated with the intent list through the preset retrieval method.
5. The knowledge slice recall method according to claim 1, characterized in that The intent category at least includes: port statistics information tool, device parameter query tool, procedure assistant tool, maintenance and operation assistant tool, regulations and standards assistant tool, industry term tool, fault solution tool, others.
6. The knowledge slice recall method according to claim 1, wherein It also includes: In a multi-round dialogue scenario, determining whether the current dialogue question text is a continuation of the previous round of dialogue question text; When the current dialogue question text is a continuation of the previous round of dialogue question text, inheriting the intent category of the previous round of dialogue.
7. A knowledge slice recall device, characterized in that, Including: A classification module, configured to determine the intent category of the question text through a preset intent classification model when receiving the question text of the user; wherein, the preset intent classification model is trained based on a large model and is used to map the question text to a preset intent category; An acquisition module, configured to acquire an intent list corresponding to the intent category through an intent mapping dictionary; wherein, the intent mapping dictionary is used to map a single intent category to an intent list including multiple intent categories; A retrieval module, configured to retrieve a target knowledge slice that conforms to the question text from knowledge slices associated with the intent list; A recall module, configured to recall the target knowledge slice.
8. An electronic device, characterized in that, Comprising: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the instructions to implement the knowledge slice recall method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the knowledge slice recall method according to any one of claims 1-6 is implemented.
10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the knowledge slice recall method according to any one of claims 1-6 is implemented.