Question processing method and device based on generative large language model, equipment and storage medium

By using a generative large language model in cloud service scenarios, combining a tree-shaped knowledge system, determining the user's problem path and type, matching candidate knowledge blocks, and generating accurate answers, the intelligent customer service answers inaccurate questions in the complex knowledge system are solved, and the efficiency and quality of intelligent customer service are improved.

CN120492572APending Publication Date: 2025-08-15BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510550441.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In existing cloud service scenarios, it is difficult for intelligent customer service assistants to provide efficient and accurate self-service Q&A services, especially in a complex multi-level tree-like knowledge system. How to effectively match user questions and generate accurate answers is a challenge.

Method used

By combining the tree-like knowledge system of the target scenario, the initial knowledge path and question type of user problems are determined, the path recognition module and the knowledge block matching module are used to match, candidate knowledge blocks are generated, and answers are generated through the answer generation module, candidate knowledge paths are introduced to improve the accuracy and efficiency of the answers.

Benefits of technology

It realizes efficient and accurate matching and answer generation of user questions in cloud service scenarios, and improves the response efficiency and answer quality of intelligent customer service. Especially in the handling of focus and decentralized questions, dynamic classification strategies ensure the accuracy and coverage of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492572A_ABST
    Figure CN120492572A_ABST
Patent Text Reader

Abstract

The invention provides a question processing method and device based on a generative large language model, equipment and a storage medium, and relates to the technical field of large language models, natural language processing and the like. The method comprises the steps of determining an initial knowledge path to which a user question belongs and a question type based on a tree-shaped knowledge system of a target scene; according to the question type, matching the user question with an initial knowledge block corresponding to the initial knowledge path to obtain a candidate knowledge block; and through a generative large language model, according to the user question, the candidate knowledge block and the candidate knowledge path corresponding to the candidate knowledge block, generating an answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically large language models, natural language processing, and other technical fields. Specifically, it relates to a question processing method, apparatus, device, and storage medium based on a generative large language model. Background Art

[0002] The Generative Large Language Model (GLLM) has a large number of parameters and training data. By utilizing more parameters and larger datasets for training, its performance and sample efficiency on various downstream tasks are effectively improved.

[0003] Intelligent customer service has been applied in numerous industries and has become a key efficiency-enhancing tool across multiple business areas. Cloud service scenarios include a variety of cloud service products, such as large-scale model service and development platforms, large-scale model application development platforms, full-featured AI (Artificial Intelligence) development platforms, cloud servers, and cloud databases. Each cloud service product has complex and rich knowledge documentation. It is crucial to build intelligent customer service assistants tailored to these cloud service scenarios, providing continuous self-service Q&A services to assist users in learning and using various cloud service products. Summary of the Invention

[0004] The present disclosure provides a question processing method, apparatus, device, and storage medium based on a generative large language model.

[0005] According to one aspect of the present disclosure, a question processing method based on a generative large language model is provided, comprising:

[0006] Determine the initial knowledge path and problem type to which the user's problem belongs based on the tree-like knowledge system of the target scenario;

[0007] According to the question type, matching the user question with the initial knowledge block corresponding to the initial knowledge path to obtain a candidate knowledge block;

[0008] An answer is generated based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks through a generative large language model.

[0009] According to one aspect of the present disclosure, a question processing apparatus based on a generative large language model is provided, comprising:

[0010] The path identification module is used to determine the initial knowledge path and question type to which the user's question belongs based on the tree-like knowledge system of the target scenario;

[0011] A knowledge block matching module is used to match the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block;

[0012] The answer generation module is used to generate an answer based on the user question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block through a generative large language model.

[0013] According to another aspect of the present disclosure, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method provided by any embodiment of the present disclosure.

[0017] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method provided by any embodiment of the present disclosure.

[0018] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the computer program implements the method provided according to any embodiment of the present disclosure.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a question processing method based on a generative large language model provided according to an embodiment of the present disclosure;

[0021] Figure 2 is a flowchart of another question processing method based on a generative large language model provided according to an embodiment of the present disclosure;

[0022] Figure 3 is a flowchart of another question processing method based on a generative large language model provided according to an embodiment of the present disclosure;

[0023] Figure 4a is a flowchart of another question processing method based on a generative large language model provided according to an embodiment of the present disclosure;

[0024] Figure 4b 1 is a schematic diagram of a question processing principle based on a generative large language model according to an embodiment of the present disclosure;

[0025] Figure 5 1 is a schematic structural diagram of a question processing device based on a generative large language model according to an embodiment of the present disclosure;

[0026] Figure 6 It is a block diagram of an electronic device used to implement the question processing method based on the generative large language model according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Figure 1 This is a flowchart of a question processing method based on a generative large language model according to an embodiment of the present disclosure. The method is suitable for providing an intelligent customer service robot for cloud service scenarios to assist users in learning and using various cloud service products. The method can be executed by a question processing device based on a generative large language model, which can be implemented in software and / or hardware and can be integrated into electronic devices. Figure 1 As shown, the question processing method based on the generative large language model of this embodiment may include:

[0028] S101, determining the initial knowledge path and question type to which the user's question belongs based on the tree-like knowledge system of the target scenario;

[0029] S102, matching the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block;

[0030] S103 , generating an answer based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks through a generative large language model.

[0031] Among them, the target scenario is a business scenario with a multi-level tree-like knowledge system, such as a cloud service scenario. Exemplarily, the first layer in the tree-like knowledge system is the root node; the second layer is the product node, and each product node corresponds to a product. Taking the target scenario as a cloud service scenario as an example, the second layer may include multiple product nodes such as the large model service and development platform, the large model application development platform, the full-function AI (Artificial Intelligence) development platform, the technical cloud server, and the cloud database. The third layer includes multiple sub-nodes of the product node, corresponding to the business functions, business modules, and business links of the product node. Taking the large model service and development platform product as an example, the third layer may include multiple sub-nodes such as getting started, model, platform billing, reasoning service API, platform function OpenAPI (Open Application Programming Interface), SDK (Software Development Kit) reference, best practices, platform operation, frequently asked questions, and related protocols. And so on, according to the subordinate relationship to the leaf node, each leaf node corresponds to at least one knowledge block. Among them, a single leaf node corresponds to one or more knowledge documents. A single knowledge document can be divided into different knowledge blocks, or different knowledge documents can be merged into one knowledge block.

[0032] For example, a user question entered by a user through an intelligent customer assistant can be obtained. Based on the tree-like knowledge system of the target scenario, the user question path is identified and the question type is pre-classified to obtain the initial knowledge path and question type to which the user question belongs. The initial knowledge path extends layer by layer from the root node of the tree-like knowledge system to the leaf nodes. The leaf nodes are associated with at least one knowledge block. The question type can be focused or dispersed.

[0033] In the embodiment of the present disclosure, the user question can be matched layer by layer with the nodes of each level in the tree-like knowledge system of the target scenario until the leaf node, and the initial knowledge path extending from the root node through the corresponding product node to the leaf node layer by layer is obtained. For the i-th layer node, the user question can be semantically matched with the i-th layer node to obtain a successfully matched i-th layer node and each i+1 layer child node of the i-th layer node; the user question can continue to be semantically matched with the corresponding i+1 layer child node until a successfully matched leaf node is obtained. Moreover, the user question can be input into a pre-built lightweight classification model (such as a text classification model) to obtain the question type. By determining the initial knowledge path and question type to which the user question belongs based on the tree-like knowledge system of the target scenario, it is convenient to subsequently recall the matched candidate knowledge blocks for the user question based on the initial knowledge path and question type, which can narrow the search scope of subsequent candidate knowledge blocks, reduce the subsequent knowledge entanglement problem, and improve the efficiency and accuracy of determining the candidate knowledge blocks.

[0034] Moreover, a recall and retrieval strategy associated with the question type can be used to match the user question with the initial knowledge block corresponding to the initial knowledge path, and obtain the recalled candidate knowledge block based on the matching result. Different question types correspond to different recall strategies; and the user question, each recalled candidate knowledge block, and the candidate knowledge path corresponding to each candidate knowledge block are input into the generative large language model, and the answer is obtained based on the output of the large language model. Exemplarily, a prompt word (Prompt) including prefix prompts (Prefix prompt) such as role settings, user questions, and candidate knowledge blocks can be constructed, and the candidate knowledge path is also used as supplementary information of the candidate knowledge block in the prompt word. By injecting the candidate knowledge path corresponding to the candidate knowledge block into the prompt word, that is, injecting the hierarchical association of the candidate knowledge block in the tree-like knowledge system, the prompt word has both problem-oriented and structure-aware capabilities, which can further enhance the large language model's processing capabilities for each candidate knowledge block, thereby further improving the accuracy of the answer.

[0035] In the prompt words, you can also use the task description, rule explanation, few-shot (small sample) mechanism to add business rules, so that the output of the large language model meets the corresponding business rules. For example, you can specify the opening word of the answer; the source method such as link, picture, table; the output format of the URL, such as using markdown (lightweight markup language) syntax to output the URL; the output format of the reference, such as the answer Please ensure that only one data number appears as a superscript at a time. If there are multiple superscripts, use the following format: 1 2 If you can identify the source of your answer, such as source 1, source 2, or source 5, please use the corresponding source number as a superscript. 和If the answer is too long, please output it in segments. Further improve the quality of the answer by introducing business rules in the prompt words.

[0036] The technical solution provided by the embodiments of the present disclosure performs semantic analysis and path mapping on user questions based on the tree-like knowledge system of the target scenario, determines the initial knowledge path and question type to which the user question belongs, and matches the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block, thereby reducing the retrieval space of the candidate knowledge block and improving the efficiency and accuracy of determining the candidate knowledge block; and, by introducing the candidate knowledge path corresponding to the candidate knowledge block into the prompt word, the prompt word retains the semantic features of the user question and the candidate knowledge block, and is embedded in the topological structure of the tree-like knowledge system of the target scenario. The dual-modal prompt of "question-path" can guide the large model to associate the context more accurately, further improving the efficiency and accuracy of answer generation.

[0037] Figure 2 This is a flowchart of another question processing method based on a generative large language model according to an embodiment of the present disclosure. Figure 2 Based on the above embodiment, the question processing method based on the generative large language model of this embodiment may include:

[0038] S201, matching the user question level by level based on the tree-like knowledge system of the target scenario to obtain potential paths and their confidences; if the confidence of the first path is equal to or greater than a preset confidence threshold, proceeding to S202; otherwise, skipping to S203; wherein the first path is the potential path with the highest confidence;

[0039] S202, determining that the problem type is a focused type, and using the first path as the initial knowledge path;

[0040] S203, determining that the problem type is a decentralized type, and taking the first M potential paths as the initial knowledge paths; M is equal to or greater than 2;

[0041] S204, matching the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block;

[0042] S205 , generating an answer based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks through a generative large language model.

[0043] In an embodiment of the present disclosure, the user problem can be pre-classified into knowledge paths based on the tree-like knowledge system of the target scenario to obtain multiple potential paths and the confidence of each potential path; the first path is the potential path with the highest confidence; if the confidence of the first path is equal to or greater than a preset confidence threshold (for example, 0.8), it is determined that the user problem is of the focused type, that is, the user problem involves a single knowledge point, and the first path is used as the initial knowledge path, for example, the initial knowledge path is document center-large model service and development platform-platform function OpenAPI-service domain name; otherwise, it is determined that the user problem is of the dispersed type, that is, the user problem may involve multiple knowledge points across business functions, cross-business modules, and cross-business links, and the top M (for example, 3) potential paths with relatively high confidence are all used as the initial knowledge paths. Through the tree-like knowledge system based on the target scenario, multiple potential paths corresponding to the user question and the confidence of different potential paths are determined; if the maximum confidence is equal to or greater than the confidence threshold, the user question is classified as a clustered question, and the potential path corresponding to the maximum confidence is used as the initial knowledge path, which can ensure the accuracy of the answer and decision-making efficiency; if the maximum confidence is less than the confidence threshold, there are multiple potential paths with similar confidence, which is classified as a decentralized question, and the top M high-confidence paths are selected to form the initial knowledge path, realizing a dynamic classification strategy for user questions, which can not only improve the response efficiency of focused questions, but also take into account the coverage of decentralized questions, thereby taking into account both problem handling efficiency and answer quality.

[0044] In an optional embodiment, the user question is matched with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block, including: if the question type is a focused type, the user question is vectorized to obtain a user question vector; the vector representation of the initial knowledge block is obtained from a pre-built vector database, and the similarity between the user question vector and the vector representation of the initial knowledge block is determined; if the similarity is less than a similarity threshold, the knowledge block is supplemented based on the tree-like knowledge system, and the candidate knowledge block is determined from the initial knowledge block and the supplemented knowledge block.

[0045] In the disclosed embodiments, user questions can be vectorized (embedded). A vectorization interface can be called to convert the text of the user question into a high-dimensional user question vector, laying the foundation for subsequent semantic retrieval and recall of candidate knowledge blocks. During the vectorization process, the representation capabilities of the pre-trained language model can be relied upon to ensure the proximity of similar questions in the vector space.

[0046] Among them, the vector representation of the knowledge base in the vector library can be obtained as follows: pre-dividing and merging the knowledge documents of the target scenario to obtain knowledge blocks; calling the vectorization interface to convert the text of the knowledge block into a high-dimensional knowledge vector. If the question type is focused, the initial knowledge block is unique. By querying the vector representation of the initial knowledge block from the vector library and calculating the similarity between the user question vector and the vector representation of the initial knowledge block; if the similarity is less than the similarity threshold, and the similarity threshold is also an empirical value such as 0.65, the knowledge blocks are supplemented based on the tree-like knowledge system, and candidate knowledge blocks are selected from the initial knowledge block and the supplemented knowledge blocks; if the similarity is equal to or greater than the similarity threshold, the initial knowledge block is used as a candidate knowledge block, that is, the candidate knowledge block is also unique. For focused questions, when the similarity between the user question vector and the initial knowledge block is lower than the similarity threshold, the knowledge blocks are horizontally expanded and supplemented based on the tree-like knowledge system. The above processing can overcome the limitations of single knowledge block matching, especially when there are quality defects such as division errors and missing nodes in the local node relationships in the tree-like knowledge system. By using horizontal and supplementary knowledge blocks, the matching anomalies caused by local relationship deviations can be corrected.

[0047] In an optional embodiment, the knowledge block supplementation based on the tree-like knowledge system and the determination of the candidate knowledge block from the initial knowledge block and the supplemented knowledge block include: obtaining other leaf nodes at the same level as the leaf node corresponding to the initial knowledge block and having the same parent node from the tree-like knowledge system to obtain corresponding other knowledge blocks; obtaining the vector representation of the other knowledge blocks from the vector database, and determining the similarity between the user question vector and the vector representation of the other knowledge blocks; and selecting the candidate knowledge block from the initial knowledge block and the other knowledge blocks based on the similarity.

[0048] For focused questions, when the similarity between the user question vector and the initial knowledge block is below the similarity threshold, other leaf nodes at the same level and with the same parent node as the leaf node corresponding to the initial knowledge block can be obtained from the tree-like knowledge system, that is, other knowledge blocks belonging to the same parent node as the initial knowledge block; vector representations of other knowledge blocks are obtained from the vector library, and the similarity between the user question vector and the vector representations of other knowledge blocks is calculated; a fixed number of knowledge blocks with high similarity are selected from the initial knowledge block and other knowledge blocks as candidate knowledge blocks. By horizontally supplementing the initial knowledge block to obtain other knowledge blocks, and selecting the knowledge blocks with high similarity from the initial knowledge block and other knowledge blocks as candidate knowledge blocks, the accuracy of the candidate knowledge blocks can be further improved.

[0049] In an optional embodiment, the user question is matched with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block, including: if the question type is decentralized, the user question is vectorized to obtain a user question vector; the vector representation of the initial knowledge block is obtained from a pre-constructed vector database, and the similarity between the user question vector and the vector representation of the initial knowledge block is determined; and the candidate knowledge block is selected from the initial knowledge block according to the similarity.

[0050] If the question type is decentralized, it corresponds to multiple initial knowledge blocks. By querying the vector representations corresponding to the multiple initial knowledge blocks from the vector library, and calculating the similarity between the user question vector and the vector representations of different initial knowledge blocks, a fixed number of knowledge blocks with higher similarity are selected from the multiple initial knowledge blocks as candidate knowledge blocks. For example, a fixed number of candidate knowledge blocks are selected from each initial knowledge block according to the similarity, without expanding the initial knowledge blocks. This is because the characteristics of decentralized problems determine that the matching degree between the user question vector and a single knowledge block is not high, but there are multiple initial knowledge blocks (such as cross-business module cross-problems). If the sibling nodes are forcibly expanded horizontally, noise information may be introduced. For decentralized problems, by selecting candidate knowledge blocks from the initial knowledge blocks, answer redundancy and deviation caused by over-expansion can be avoided.

[0051] The technical solution provided by the embodiments of the present disclosure determines multiple potential paths corresponding to user questions and the confidence levels of different potential paths through a tree-like knowledge system based on the target scenario; divides user questions into clustered questions or dispersed questions according to the maximum confidence level of the potential paths, thereby realizing a dynamic classification strategy for user questions; for clustered questions, when the similarity between the user question vector and the initial knowledge block is lower than the similarity threshold, matching anomalies caused by local relationship deviations can be corrected by horizontally and supplementing knowledge blocks based on the tree-like knowledge system; for dispersed questions, answer redundancy and deviation caused by over-expansion can be avoided by selecting candidate knowledge blocks from the initial knowledge blocks.

[0052] Figure 3 This is a flowchart of another method for processing questions based on a generative large language model according to an embodiment of the present disclosure. Figure 3 Based on the above embodiment, the knowledge documents and knowledge blocks are further defined. The question processing method based on the generative large language model of this embodiment may include:

[0053] S301, determining the initial knowledge path and question type to which the user's question belongs based on the tree-like knowledge system of the target scenario;

[0054] S302, matching the user question with the initial knowledge blocks corresponding to the initial knowledge path according to the question type to obtain candidate knowledge blocks; wherein the initial knowledge blocks are obtained by processing the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system according to the priorities between different delimiters in the delimiter group to obtain knowledge blocks of fixed length intervals;

[0055] S303 , generating an answer based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks through a generative large language model.

[0056] The delimiter group may include at least two delimiters, and the priorities between different delimiters are predetermined. For example, the delimiter group may include three types of delimiters: title, paragraph, and period, and the priorities between the three are successively lower. Exemplarily, the delimiters in the delimiter group are sorted from high to low according to priority; appropriate delimiters are selected from the delimiter group according to priority, and the knowledge document is processed into knowledge blocks of fixed length intervals (for example, 480-500 words). Through the above processing, each knowledge block can carry independent semantics and meet the input length restriction requirements of the natural language model.

[0057] In an optional embodiment, the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system are processed according to the priorities between different delimiters in the delimiter group to obtain knowledge blocks of fixed length intervals, including: according to the delimiter priority, a delimiter is selected from the delimiter group to cut the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system to obtain knowledge slices; if the length of the knowledge slice exceeds the fixed length interval, it is downgraded and re-cut using the next delimiter until a knowledge block of fixed length interval is obtained; if the knowledge slice is lower than the fixed length interval, the knowledge slice is temporarily stored and merged with adjacent slices to obtain a knowledge block of fixed length interval.

[0058] Exemplarily, the delimiter group is traversed according to the delimiter priority, that is, delimiters are selected from the delimiter group, for example, delimiters are selected in sequence, and the current knowledge document corresponding to the current leaf node is cut using the delimiter selected from the delimiter group to obtain a knowledge slice; if the length of the knowledge slice exceeds the fixed length interval, the delimiter group traversal operation is returned to the delimiter group, and the delimiter of the next priority is downgraded to obtain the delimiter of the next priority from the delimiter group, and the current knowledge document is cut using the re-obtained delimiter until the length of the generated knowledge slice is equal to the fixed length interval, thereby obtaining a knowledge block; if the length of the knowledge slice is lower than the fixed length interval, the knowledge slice is temporarily stored in a temporary list, and the next knowledge document is cut, and adjacent slices are merged in the cutting order to generate a knowledge block of a fixed length interval. For example, when a knowledge document is cut using chapter symbols to generate 800-word knowledge slices, it can be automatically downgraded to paragraph symbols to obtain 480-word knowledge slices and 320-word knowledge slices. The 480-word knowledge slice can be used as a knowledge block, and the 320-word knowledge slice can be temporarily stored in a temporary list. The next knowledge document is segmented, and the 320-word knowledge slice is combined with the 180-word knowledge slice of the next knowledge document to produce a 500-word knowledge block. This process continues until multiple fixed-length knowledge blocks are obtained. By traversing the delimiter group according to the priority of different delimiters, segmenting and merging the knowledge document to produce fixed-length knowledge blocks, the efficiency of knowledge block construction is improved.

[0059] The technical solution provided by the embodiment of the present disclosure processes the knowledge document into knowledge blocks of fixed length intervals by traversing the delimiter groups according to priority, so that each knowledge block can carry independent semantics and meet the input length restrictions of the natural language model, thereby improving the semantic processing efficiency of the knowledge blocks.

[0060] In an optional embodiment, the method also includes: obtaining a knowledge document corresponding to a leaf node in a tree-like knowledge system; determining whether there is a long link or structured text in the knowledge document; the structured text is in JSON format or source code; the long link is a link whose length exceeds a length threshold; if it exists, reducing the knowledge document according to the long link or the structured text.

[0061] The length threshold is an empirical value (e.g., 50). If the knowledge documents corresponding to leaf nodes in the tree-like knowledge system contain long links exceeding the length threshold, or structured text such as JSON format or source code, the long links or structured text are shortened to reduce the length of the knowledge documents, thereby reducing the workload of subsequent semantic retrieval of knowledge and further improving the efficiency of question processing.

[0062] In an optional embodiment, the reducing the knowledge document according to the long link or the structured text includes: if there is structured text in the knowledge document, determining a description text of the structured text, and replacing the structured text with the description text in the knowledge document; if there is a long link in the knowledge document, generating an associated short link according to the long link, a timestamp and a random number, and replacing the long link with the short link in the knowledge document.

[0063] For example, if a knowledge document contains structured text such as JSON format or source code, the description text of the structured text is determined and used to replace the structured text. In other words, the structured text is deleted from the knowledge document so that the structured text does not participate in semantic processing. If a long link exists in the knowledge document, a unique short link is generated for the long link based on the long link, the converted timestamp, and the random number. The short link is used to replace the long link, so that the link content is retained in the knowledge document and the length of the knowledge document is reduced.

[0064] It should be noted that in order to further reduce the number of characters in the knowledge document, the knowledge document can also be processed as follows: rewrite the symbols in the table, for example, change multiple consecutive connectors into a single connector; use regular expressions to remove comments in a specified format; convert multiple consecutive spaces into a single character.

[0065] Figure 4a This is a flowchart of another method for question processing based on a generative large language model according to an embodiment of the present disclosure. Figure 4a Based on the above embodiment, the question processing method based on the generative large language model of this embodiment may include:

[0066] S401, determining the initial knowledge path and question type to which the user's question belongs based on the tree-like knowledge system of the target scenario;

[0067] S402, matching the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block;

[0068] S403, matching the user question with standard questions in the question-answer database to obtain candidate questions;

[0069] S404, sorting the candidate questions and the candidate knowledge blocks according to the user questions;

[0070] S405 , according to the ranking result, the user question, the candidate question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block are input into a generative large language model to obtain an answer.

[0071] refer to Figure 4b The intelligent customer service robot 02 in the target scenario obtains the user question from the intelligent assistant interface 01, inputs the user question into the pre-classification model 03, and obtains the initial knowledge path and question type to which the user question belongs; the intelligent customer service robot 02 calls the vectorization interface 04 to convert the text of the user question into a high-dimensional user question vector; and obtains the vector representation of the initial knowledge block corresponding to the leaf node in the initial knowledge path from the vector database 05, and based on the tree-like knowledge system, determines the candidate knowledge block from the initial knowledge block or the horizontally expanded brother knowledge block according to the question type, user question vector, and vector representation of the initial knowledge block.

[0072] In the disclosed embodiment, the intelligent customer service robot 02 can also obtain standard questions from the question and answer library, obtain vector representations of standard questions from the vector library 05, calculate the similarity between the user question vector and the vector representation of the standard question, and use standard questions with fixed values of higher correlation as candidate questions; and, through the re-ranking model 06, re-rank the candidate knowledge blocks and candidate questions according to the user questions to obtain the ranking results; according to the ranking results, the user questions, candidate questions, candidate knowledge blocks, and candidate knowledge paths corresponding to the candidate knowledge blocks are input into the generative large language model 07 to obtain answers.

[0073] Among them, the re-ranking model 06 can be constructed using a cross-encoder. By re-ranking candidate knowledge blocks and candidate questions, low-relevance content can be filtered out, further improving the quality of candidate resources. Due to the use of a "cross-encoder" structure, the re-ranking model 06 has higher accuracy than the vectorization interface 04. By first using the vectorization interface 04 with lower time computational cost to recall candidate knowledge blocks and candidate questions, narrowing the scope, and then using the re-ranking model 06 to further calculate similarity, it can balance the efficiency and quality of candidate resources.

[0074] Approximate Nearest Neighbor Search (ANN) is a key issue in machine learning and data mining. The Navigable Small World (NSW) algorithm can be used to improve the efficiency of retrieving candidate knowledge blocks. The Hierarchical Navigable Small World (HNSW) algorithm, an improved version of the NSW algorithm, further improves search efficiency and accuracy by constructing a hierarchical graph structure. Through the use of a hierarchical structure and navigation nodes, it achieves a good balance between search efficiency and accuracy.

[0075] The technical solution provided by the embodiment of the present disclosure determines the initial knowledge path and question type to which the user question belongs through a tree-like knowledge system based on the target scenario; matches the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block; matches the user question with the standard question in the question and answer library to obtain a candidate question; re-sorts the candidate questions and candidate knowledge blocks through a cross-coding structure, and inputs the user question, candidate question, candidate knowledge block, and corresponding candidate knowledge path into a generative large language model according to the sorting result, which can improve the retrieval efficiency, reduce the irrelevant knowledge provided to the large language model for summary generation, and further improve the efficiency and quality of answer generation.

[0076] In an optional embodiment, before generating an answer based on the user question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block, it also includes: if any candidate knowledge block includes a description text of a structured text, obtaining the structured text corresponding to the description information, and adding the structured text to the candidate knowledge block.

[0077] For example, for candidate knowledge blocks that include structured text, by restoring the structured text to the candidate knowledge block and inputting it into a generative large language model, the large language model can parse the structured text, thereby further improving the reliability of the answer.

[0078] In an optional embodiment, after generating an answer based on the user question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block, it also includes: if the answer includes a short link, obtaining a long link associated with the short link, and replacing the short link with the long link; wherein the short link is pre-generated based on the long link, timestamp, and time.

[0079] For example, for candidate knowledge blocks that include long links, by restoring the long links to the answers, that is, inputting the short links into the large language model instead of the long links, the link type can be retained while reducing the processing efficiency of the large language model.

[0080] Figure 5 This is a structural diagram of a question processing device based on a generative large language model according to an embodiment of the present disclosure. The device is suitable for providing an intelligent customer service robot for cloud service scenarios to assist users in learning and using various cloud service products. The device can be implemented in software and / or hardware and can be integrated into electronic devices. Figure 5 As shown, the question processing apparatus 500 based on the generative large language model of this embodiment may include:

[0081] A path identification module 510 is used to determine the initial knowledge path and question type to which the user question belongs based on the tree-like knowledge system of the target scenario;

[0082] A knowledge block matching module 520 is configured to match the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block;

[0083] The answer generation module 530 is used to generate an answer based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks through a generative large language model.

[0084] In an optional implementation, the initial knowledge path extends layer by layer from the root node of the tree-like knowledge system to the leaf nodes; the leaf nodes are associated with at least one knowledge block.

[0085] In an optional implementation, the path identification module 510 includes:

[0086] A potential path unit is used to match the user question step by step based on the tree-like knowledge system of the target scenario to obtain potential paths and confidence levels of the potential paths;

[0087] a focusing unit, configured to determine that the problem type is a focusing type if the confidence of the first path is equal to or greater than a preset confidence threshold, and use the first path as the initial knowledge path; wherein the first path is the potential path with the highest confidence;

[0088] A decentralized unit is configured to determine that the problem type is decentralized if the confidence of the first path is less than the confidence threshold, and to use the first M potential paths as the initial knowledge paths; M is equal to or greater than 2.

[0089] In an optional implementation, the knowledge block matching module 520 includes a focus matching unit, and the focus matching unit includes:

[0090] a question vector subunit, configured to vectorize the user question to obtain a user question vector if the question type is a focused type;

[0091] a vector matching subunit, configured to obtain a vector representation of the initial knowledge block from a pre-built vector database, and determine a similarity between the user question vector and the vector representation of the initial knowledge block;

[0092] The supplementing subunit is configured to supplement the knowledge blocks based on the tree-like knowledge system if the similarity is less than a similarity threshold, and determine the candidate knowledge blocks from the initial knowledge blocks and the supplemented knowledge blocks.

[0093] In an optional embodiment, the supplementing subunit is specifically used to:

[0094] Obtaining other leaf nodes at the same level and with the same parent node as the leaf node corresponding to the initial knowledge block from the tree-like knowledge system to obtain corresponding other knowledge blocks;

[0095] Obtaining vector representations of the other knowledge blocks from the vector database, and determining similarities between the user question vector and the vector representations of the other knowledge blocks;

[0096] The candidate knowledge block is selected from the initial knowledge block and the other knowledge blocks according to the similarity.

[0097] In an optional implementation, the knowledge block matching module 520 includes a decentralized matching unit, which is specifically configured to:

[0098] If the question type is a decentralized type, vectorizing the user question to obtain a user question vector;

[0099] Obtaining vector representations of the initial knowledge blocks from a pre-built vector database, and determining similarities between the user question vector and the vector representations of the initial knowledge blocks;

[0100] The candidate knowledge blocks are selected from the initial knowledge blocks according to the similarity.

[0101] In an optional implementation, the apparatus 500 further includes:

[0102] The knowledge segmentation module is used to process the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system according to the priorities between different separators in the separator group to obtain knowledge blocks with fixed length intervals.

[0103] In an optional implementation, the knowledge segmentation module includes:

[0104] A knowledge cutting unit, configured to select a separator from the separator group according to the separator priority to cut the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system to obtain knowledge blocks;

[0105] A downgrading and cutting unit, configured to downgrade and re-cut the knowledge slice using the next separator if the length of the knowledge slice exceeds the fixed length interval, until a knowledge block of the fixed length interval is obtained;

[0106] The slice merging unit is used to temporarily store the knowledge slice if the knowledge slice is lower than the fixed length interval, and merge it with the adjacent slice to obtain a knowledge block of the fixed length interval.

[0107] In an optional implementation, the apparatus 500 further includes a document reduction module, and the document reduction module includes:

[0108] A document acquisition unit is used to acquire knowledge documents corresponding to leaf nodes in the tree-like knowledge system;

[0109] A document identification unit is used to determine whether there is a long link or structured text in the knowledge document; the structured text is in JSON format or source code; the long link is a link whose length exceeds a length threshold;

[0110] A document reduction unit is used to reduce the knowledge document according to the long link or the structured text, if any.

[0111] In an optional implementation, the document reduction unit includes:

[0112] a structure reduction subunit, configured to determine a description text of the structured text if the structured text exists in the knowledge document, and replace the structured text with the description text in the knowledge document;

[0113] The link reduction subunit is used to generate an associated short link according to the long link, a timestamp and a random number if a long link exists in the knowledge document, and replace the long link with the short link in the knowledge document.

[0114] In an optional implementation, the answer generation module 530 includes:

[0115] A question matching unit, configured to match the user question with standard questions in the question-answer library to obtain candidate questions;

[0116] A sorting unit, configured to sort the candidate questions and the candidate knowledge blocks according to the user questions;

[0117] The answer generation unit is used to input the user question, the candidate question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block into the generative large language model according to the sorting result to obtain an answer.

[0118] In an optional implementation, the answer generation module 530 further includes:

[0119] The structure recovery unit is used to obtain the structured text corresponding to the description information if any candidate knowledge block includes description text of the structured text, and add the structured text to the candidate knowledge block.

[0120] In an optional implementation, the answer generation module 530 further includes:

[0121] A link recovery unit is used to obtain a long link associated with the short link if the answer includes a short link, and replace the short link with the long link; wherein the short link is pre-generated based on the long link, a timestamp, and an hourly number.

[0122] The technical solution provided by the embodiments of the present disclosure determines the initial knowledge path and question type to which the user question belongs based on the tree-like knowledge system of the target scenario, and matches the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain the candidate knowledge block, thereby reducing the retrieval space of the candidate knowledge block and improving the efficiency and accuracy of determining the candidate knowledge block; and, by introducing the candidate knowledge path corresponding to the candidate knowledge block into the prompt word, the prompt word retains the semantic features of the user question and the candidate knowledge block, and is embedded in the topological structure of the tree-like knowledge system of the target scenario. The dual-modal prompt of "question-path" can guide the large model to associate the context more accurately, further improving the efficiency and accuracy of answer generation.

[0123] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0124] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0125] Figure 6 It is a block diagram of an electronic device used to implement the question processing method based on the generative large language model according to an embodiment of the present disclosure. Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0126] like Figure 6As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0127] Multiple components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0128] The computing unit 601 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 601 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 that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the question processing method based on the generative large language model. For example, in some embodiments, the question processing method based on the generative large language model can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the question processing method based on the generative large language model described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the question processing method based on the generative large language model in any other appropriate manner (for example, by means of firmware).

[0129] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0130] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0131] Multiple components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0132] The computing unit 601 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 601 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 that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the question processing method based on the generative large language model. For example, in some embodiments, the question processing method based on the generative large language model can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the question processing method based on the generative large language model described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the question processing method based on the generative large language model in any other appropriate manner (for example, by means of firmware).

[0133] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose 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 data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] The program code for implementing the method 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 so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0135] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types 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, audio input, or tactile input).

[0137] The systems and techniques described herein can be implemented in a computing system that includes back-end 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 front-end components (e.g., a user computer with a graphical user interface or a web player through which a user can interact with embodiments of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end 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), and the Internet.

[0138] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0139] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, audio recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.

[0140] Cloud computing refers to a technology system that provides network access to elastically scalable shared pools of physical or virtual resources. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on-demand in a self-service manner. Cloud computing technology provides efficient and powerful data processing capabilities for the application of technologies such as artificial intelligence and blockchain, as well as for model training.

[0141] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed 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. This is not a limitation herein.

[0142] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on 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 scope of protection of this disclosure.

Claims

1. A question processing method based on a generative large language model, comprising: Determine the initial knowledge path and problem type to which the user's problem belongs based on the tree-like knowledge system of the target scenario; According to the question type, matching the user question with the initial knowledge block corresponding to the initial knowledge path to obtain a candidate knowledge block; An answer is generated based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks through a generative large language model.

2. The method according to claim 1, wherein The initial knowledge path extends layer by layer from the root node of the tree-like knowledge system to the leaf nodes; the leaf nodes are associated with at least one knowledge block.

3. The method according to claim 1, wherein The tree-like knowledge system based on the target scenario determines the initial knowledge path and question type to which the user question belongs, including: Match the user questions step by step based on the tree-like knowledge system of the target scenario to obtain potential paths and confidence levels of the potential paths; If the confidence of the first path is equal to or greater than a preset confidence threshold, the problem type is determined to be a focused type, and the first path is used as the initial knowledge path; wherein the first path is the potential path with the highest confidence; If the confidence of the first path is less than the confidence threshold, the problem type is determined to be decentralized, and the first M potential paths are used as the initial knowledge paths; M is equal to or greater than 2.

4. The method according to claim 1, wherein The step of matching the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block includes: If the question type is a focused type, vectorize the user question to obtain a user question vector; Obtaining a vector representation of the initial knowledge block from a pre-built vector database, and determining a similarity between the user question vector and the vector representation of the initial knowledge block; If the similarity is less than a similarity threshold, knowledge blocks are supplemented based on the tree-like knowledge system, and the candidate knowledge blocks are determined from the initial knowledge blocks and the supplemented knowledge blocks.

5. The method according to claim 4, wherein The supplementing of knowledge blocks based on the tree-like knowledge system and determining the candidate knowledge blocks from the initial knowledge blocks and the supplemented knowledge blocks include: Obtaining other leaf nodes at the same level and with the same parent node as the leaf node corresponding to the initial knowledge block from the tree-like knowledge system to obtain corresponding other knowledge blocks; Obtaining vector representations of the other knowledge blocks from the vector database, and determining similarities between the user question vector and the vector representations of the other knowledge blocks; The candidate knowledge block is selected from the initial knowledge block and the other knowledge blocks according to the similarity.

6. The method according to claim 1, wherein The step of matching the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block includes: If the question type is a decentralized type, vectorizing the user question to obtain a user question vector; Obtaining vector representations of the initial knowledge blocks from a pre-built vector database, and determining similarities between the user question vector and the vector representations of the initial knowledge blocks; The candidate knowledge blocks are selected from the initial knowledge blocks according to the similarity.

7. The method according to claim 1, further comprising: According to the priorities between different delimiters in the delimiter group, the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system are processed to obtain knowledge blocks with fixed length intervals.

8. The method according to claim 7, wherein: The process of processing the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system according to the priorities between the different delimiters in the delimiter group to obtain the knowledge blocks with fixed length intervals includes: According to the delimiter priority, a delimiter is selected from the delimiter group to cut the knowledge document corresponding to the leaf node in the tree-like knowledge system to obtain knowledge slices; If the length of the knowledge slice exceeds the fixed length interval, it is downgraded and re-cut using the next separator until a knowledge block of a fixed length interval is obtained; If the knowledge slice is shorter than the fixed length interval, the knowledge slice is temporarily stored and merged with adjacent slices to obtain a knowledge block of a fixed length interval.

9. The method according to claim 1, further comprising: Obtain the knowledge documents corresponding to the leaf nodes in the tree-like knowledge system; Determining whether there is a long link or structured text in the knowledge document; The structured text is in JSON format or source code; the long link is a link whose length exceeds a length threshold; If so, the knowledge document is reduced according to the long link or the structured text.

10. The method according to claim 9, wherein: The reducing the knowledge document according to the long link or the structured text includes: If the knowledge document contains structured text, a description text of the structured text is determined, and the description text is used to replace the structured text in the knowledge document; If a long link exists in the knowledge document, an associated short link is generated according to the long link, a timestamp and a random number, and the long link is replaced by the short link in the knowledge document.

11. The method according to claim 1, wherein The generating of an answer based on the user question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block by using a generative large language model includes: Match the user question with the standard questions in the question-answer database to obtain candidate questions; sorting the candidate questions and the candidate knowledge blocks according to the user questions; According to the ranking results, the user question, the candidate question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block are input into the generative large language model to obtain an answer.

12. The method according to claim 1 or 11, before generating an answer based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks, further comprising: If any candidate knowledge block includes description text of a structured text, the structured text corresponding to the description information is obtained and added to the candidate knowledge block.

13. The method according to claim 1 or 11, after generating an answer based on the user question, the candidate knowledge blocks, and the candidate knowledge paths corresponding to the candidate knowledge blocks, further comprising: If the answer includes a short link, a long link associated with the short link is obtained, and the long link is used to replace the short link; wherein the short link is pre-generated based on the long link, a timestamp, and an hourly number.

14. A question processing device based on a generative large language model, comprising: The path identification module is used to determine the initial knowledge path and question type to which the user's question belongs based on the tree-like knowledge system of the target scenario; A knowledge block matching module is used to match the user question with the initial knowledge block corresponding to the initial knowledge path according to the question type to obtain a candidate knowledge block; The answer generation module is used to generate an answer based on the user question, the candidate knowledge block, and the candidate knowledge path corresponding to the candidate knowledge block through a generative large language model.

15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause a computer to execute the method according to any one of claims 1-13.

17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 13.

Citation Information

Cited By

  • Knowledge base correction method, electronic equipment and computer readable storage medium

    CN121614062A