Request processing method and related device
By identifying target categories in a large model and retrieving sentences from top to bottom in a hierarchical sentence structure, the problem of low efficiency in large model retrieval enhancement generation is solved, resulting in a significant improvement in request processing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE GRP HEILONGJIANG CO LTD
- Filing Date
- 2026-01-26
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, the efficiency of retrieval enhancement generation for large models is relatively low, resulting in reduced request processing efficiency.
By determining the target category of the query request and sequentially retrieving relevant sentences from top to bottom in the sentence hierarchy of the target document, a subset of the node set of the adjacent next level is constructed in the sentence hierarchy, and a response result is generated.
It significantly improves the efficiency of request processing by accurately targeting the information retrieval scope and quickly locating matching queries, thereby enhancing the efficiency of query generation.
Smart Images

Figure CN122240750A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a request processing method and related equipment. Background Technology
[0002] Retrieval-enhanced generation refers to the introduction of external knowledge bases, enabling models to dynamically acquire the latest and relevant background information at runtime, thereby significantly enhancing the model's generation capabilities and its ability to handle complex queries. In related technologies, queries are typically based on the full dataset, leading to low efficiency in retrieval-enhanced generation for large models, which in turn reduces the request processing efficiency of large models. Summary of the Invention
[0003] This application provides a request processing method and related equipment, which can improve the request processing efficiency of large models.
[0004] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, a request processing method is provided, the method comprising: in response to receiving a query request, determining a target category matching the query request; for each target document included in the target category, sequentially retrieving sentences related to the query request from top to bottom in the sentence hierarchy corresponding to the target document, wherein each level in the sentence hierarchy except the bottom level is constructed based on a subset of the node set of its adjacent next level, and the node set of the bottom level is the sentence set corresponding to the target document; and generating a response result corresponding to the query request based on the retrieved related sentences.
[0005] Secondly, a request processing apparatus is provided, comprising: a determining module, configured to determine a target category matching the query request in response to receiving a query request; a retrieving module, configured to, for each target document included in the target category, sequentially retrieve sentences related to the query request from top to bottom in the sentence hierarchical structure corresponding to the target document, wherein each level in the sentence hierarchical structure, except for the bottom level, is constructed based on a subset of the node set of its adjacent next level, and the node set of the bottom level is the sentence set corresponding to the target document; and a generating module, configured to generate a response result corresponding to the query request based on the retrieved related sentences.
[0006] Thirdly, an electronic device is provided, including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, the program or instructions, when executed by the processor, perform the steps of the method described in the first aspect.
[0007] Fourthly, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0008] Fifthly, a computer program product is provided, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the steps of the method described in the first aspect.
[0009] In this embodiment, by responding to a received query request, a target category matching the query request is determined. This allows for precise targeting of the subsequent information retrieval scope to the corresponding category. For each target document included in the target category, sentences related to the query request are retrieved sequentially from top to bottom in the sentence hierarchy corresponding to the target document. Each level in the sentence hierarchy, except for the bottom level, is constructed based on a subset of the node set of its adjacent next level. The node set of the bottom level is the set of sentences corresponding to the target document. Based on the retrieved relevant sentences, a response result corresponding to the query request is generated. This hierarchical query approach enables rapid retrieval at the upper level of the sentence hierarchy, achieving fast jumping, and precise location and matching of the query at the lower level of the sentence hierarchy, effectively improving the efficiency of query generation and thus significantly improving the processing efficiency of the request.
[0010] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0012] Figure 1 This paper illustrates a flowchart of a request processing method provided in an embodiment of this application. Figure 2 This illustration shows a schematic diagram of a sentence hierarchical structure provided in an embodiment of this application; Figure 3 This paper illustrates a flowchart of a request processing method provided in an embodiment of this application. Figure 4 This illustration shows a schematic diagram of an architecture of a self-organizing competitive network model provided in an embodiment of this application; Figure 5 This illustration shows another architectural diagram of the self-organizing competitive network model provided in an embodiment of this application; Figure 6This illustration shows a flowchart of a document classification method provided in an embodiment of this application; Figure 7 This invention provides a schematic diagram of the structure of a request processing apparatus according to an exemplary embodiment of the present application. Figure 8 A schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0013] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0014] like Figure 1 The diagram shown is a flowchart illustrating a request processing method provided in an exemplary embodiment of this application. This method can be executed by an electronic device, which may include a terminal device and a network-side device. In other words, the method can be executed by software or hardware installed on the electronic device, and the method may include the following steps: S110: In response to receiving a query request, determine the target category that matches the query request.
[0015] The target category is the domain label to which the query request belongs.
[0016] In this step, by determining the target category corresponding to the query request, the scope of subsequent information retrieval can be precisely locked to the corresponding knowledge document. This narrowing of the retrieval scope can effectively reduce the consumption of computing resources and response latency, and can also significantly improve the accuracy of subsequent answers.
[0017] In some embodiments, determining the target category matching the query request includes: calculating the similarity between the query request and the centroid vector corresponding to each preset category, and selecting the preset category with the highest similarity as the target category matching the query request. For example, assuming the query request is: "What technologies does big data include?", the similarity between the query request and each centroid vector of the big data category, blockchain category, and artificial intelligence category is calculated. The big data category has the highest similarity, therefore, the big data category is selected as the target category for subsequent retrieval.
[0018] S120: For each target document included in the target category, retrieve sentences related to the query request sequentially from top to bottom in the sentence hierarchy structure corresponding to the target document.
[0019] In the sentence hierarchical structure, each level except the bottom level is constructed based on a subset of the node set of its adjacent next level, and the node set of the bottom level is the sentence set corresponding to the target document.
[0020] Each target document corresponds to a set of sentences and a sentence hierarchical structure. The sentence hierarchical structure is built based on the sentence set, which includes sentence vectors corresponding to multiple sentences, and each sentence vector corresponds to a node.
[0021] In this step, a top-down retrieval method allows for rapid location of the target range in the upper-level plane using long connections, while short connections improve query accuracy in the lower-level plane, thereby quickly identifying sentences relevant to the query request. For example, refer to... Figure 2 This is a schematic diagram of a sentence hierarchical structure provided in an embodiment of this application. When querying related sentences, a sentence node can be randomly selected from the top level, i.e., level 3, such as the sentence node in level 3. Points, calculate query request and Points and The sentence node with the highest similarity is obtained by calculating the similarity between adjacent nodes. This method is recursively applied to find the sentence node in the upper-level plane that is semantically most similar to the query request; assuming that the sentence node found in the upper-level plane is... In layer 2, with Centered on a point, calculate the query request and The similarity between adjacent nodes is used to find the sentence node with the most semantic similarity, and so on, until the sentence vector with the most semantic similarity is found in the second layer. Let's assume the most similar sentence is... Point; in the lowest layer, i.e., layer 1, with Using the point as the center, calculate the vector of the query content. The similarity between adjacent nodes is used until the sentence that is semantically closest to the query request is found.
[0022] S130: Based on the retrieved relevant sentences, generate the response result corresponding to the query request.
[0023] In this embodiment, by responding to a received query request, a target category matching the query request is determined. This allows for precise targeting of the subsequent information retrieval scope to the corresponding category. For each target document included in the target category, sentences related to the query request are retrieved sequentially from top to bottom in the sentence hierarchy corresponding to the target document. Each level in the sentence hierarchy, except for the bottom level, is constructed based on a subset of the node set of its adjacent next level. The node set of the bottom level is the set of sentences corresponding to the target document. Based on the retrieved relevant sentences, a response result corresponding to the query request is generated. This hierarchical query approach enables rapid retrieval at the upper level of the sentence hierarchy, achieving fast jumping, and precise location and matching of the query at the lower level of the sentence hierarchy, effectively improving the efficiency of query generation and thus significantly improving the processing efficiency of the request.
[0024] In some embodiments, such as Figure 3 As shown, before determining the target category matching the query request in response to receiving the query request, the method further includes the following steps: S102: Retrieve multiple knowledge documents.
[0025] The plurality of knowledge documents includes the target document.
[0026] S104: Classify the multiple knowledge documents using a self-organizing competitive network model.
[0027] Among them, the self-organizing competition network model is an unsupervised learning artificial neural network. This self-organizing competition network model can learn and organize the inherent structure and pattern of input data through the competition mechanism between neurons, without any pre-labeled training samples.
[0028] S106: For each of the knowledge documents, construct the sentence hierarchical structure corresponding to the knowledge document.
[0029] In this embodiment, the self-organizing competitive network model is used to classify the multiple knowledge documents, which can achieve unsupervised self-organizing classification and make documents in the same category semantically similar, while maximizing the semantic differences between different categories. By constructing a sentence hierarchical structure corresponding to each knowledge document, the efficiency of retrieval and query generation can be improved.
[0030] In some embodiments, classifying multiple knowledge documents using a self-organizing competitive network model may include the following steps: Step 1: Construct the self-organizing competition network model, wherein the self-organizing competition network model includes an input layer, a competition layer and a classification layer. The input layer includes multiple document nodes, each document node corresponding to a knowledge document. The competition layer includes multiple competition nodes. The classification layer includes multiple classification groups, each classification group corresponding to a category. Each document node corresponds to at least one competition node, and each competition node is associated with a classification group.
[0031] In the embodiments of this application, each document node may correspond to each competing node; or, multiple document nodes may be divided into multiple groups, with each group corresponding to one competing node, i.e., each document node corresponds to one competing node; or, each document node may be divided into multiple groups, so that each document node corresponds to at least one competing node. For example, as... Figure 4 As shown, there are z document nodes in total, where each document node corresponds to each competing node. For example, as... Figure 5 As shown, there are z document nodes. These z document nodes are divided into K classification groups, meaning each document node corresponds to one competing node, resulting in a total of K competing nodes. In some embodiments, The range of values can be .
[0032] Step 2: Initialize the initial word vector corresponding to each of the competing nodes.
[0033] For example, initialize the initial word vectors corresponding to the K competing nodes:
[0034] in, Indicates the first A number of competing nodes.
[0035] In some embodiments, random initialization can be performed. To satisfy the normalization condition .
[0036] Step 3: Based on the keyword vectors corresponding to each document node, iteratively update the initial word vectors corresponding to each competing node until the stopping condition is met.
[0037] In some embodiments, before iteratively updating the initial word vector corresponding to each competing node according to the keyword vector corresponding to each document node until the stopping condition is met, the method may further include: for each document node, filtering non-keywords by word frequency and inverse document frequency, and determining keywords from the remaining words by TF-IDF value; vectorizing each keyword, for example, as shown in Table 1, which is a keyword vector illustration table.
[0038] Table 1
[0039] Term frequency (TF) represents the frequency of a word in a document, and is calculated as follows:
[0040] in, For words In the document The number of times it appears in Document The total number of all words in the text.
[0041] Inverse document frequency (IDF) represents the rarity of a word in the entire external knowledge base, and is calculated as follows:
[0042] Total number of documents For including words The number of documents.
[0043] TF-IDF values indicate the importance of a word in a document. A higher TF-IDF value indicates greater word importance within the document. The calculation method is as follows:
[0044] Calculate the TF-IDF value for each word in the document, sort the TF-IDF values in descending order, and select the words with the highest TF-IDF values. The words serve as keywords for this document.
[0045] In this embodiment, word frequency and inverse document frequency can effectively filter out relatively unimportant words and highlight words that are important in the document, thereby representing the document with text composed of keywords.
[0046] In this step, the keyword vector corresponding to each document node can be uniformly represented as a matrix. :
[0047] Among them, the The keyword vector of each document node is , Represents the document vector dimension, where any element Indicates the first The document number A vector of dimension.
[0048] In some embodiments, the step of iteratively updating the initial word vector corresponding to each competing node until a stopping condition is met based on the keyword vector corresponding to each document node includes: calculating the similarity between the keyword vector of each document node and the initial word vector of the corresponding competing node; for each competing node, taking the document node with the highest similarity as the winning node, and adjusting the initial word vector corresponding to the competing node based on the keyword vector corresponding to the winning node.
[0049] It is understandable that calculating document nodes... and the The similarity between competing nodes, where the similarity can be cosine similarity, Euclidean distance, etc.
[0050] Specifically, the closer the cosine similarity is to 0, the more similar the document node is to the competing node. The similarity between the keyword vector of the document node and the initial word vector of each corresponding competing node is calculated to obtain the most similar winning competing node. Due to the winning node in the competition The node most similar to this document node needs to be dynamically adjusted to determine the winning node. This makes the winning node in the competition Adjust the vector in the direction of the keyword vector of the document node. The adjustment rule can be:
[0051] in, For mobility compensation, optionally, It can be 0.01.
[0052] Through the above steps, the keyword vector of each document node is iterated sequentially, updating the initial word vectors of the competing nodes in the competition layer, so that the initial word vectors of the competing nodes move towards the center of the classification group. To optimize the competing nodes in the competition layer, the iteration continues until the iterative change of the competing nodes in the competition layer approaches 0, at which point the iteration stops, and the initial word vectors of the competing nodes corresponding to each classification group are obtained.
[0053] Step 4: Based on the keyword vectors corresponding to each document node and the updated initial word vectors corresponding to each competing node, divide the multiple knowledge documents into multiple classification groups.
[0054] In some embodiments, the knowledge documents are divided into multiple classification groups based on the keyword vectors corresponding to each document node and the updated initial word vectors of each competing node. This includes: for each competing node, calculating the similarity between the keyword vector of each corresponding document node and the updated initial word vector of the competing node, and classifying the knowledge documents corresponding to the document nodes with similarity greater than a first threshold into the classification group corresponding to the competing node.
[0055] It is understandable that the Euclidean distance between the keyword vector of each document node and the updated initial word vector of each competing node in the competition layer is calculated, and the classification group associated with the competing node with the smallest distance is selected as the category corresponding to that document node, thereby minimizing the semantic differences of documents within the same category and maximizing the semantic differences between categories.
[0056] Based on the above embodiments, this application also provides a flowchart of a document classification method, such as... Figure 6 As shown, the method may include the following steps: S610: Obtain the keyword vector corresponding to the knowledge document.
[0057] S620: Initialize the initial point for the competition layer classification.
[0058] S630: Calculate the winning node in each competition layer.
[0059] S640: Assign documents to the corresponding categories.
[0060] In this embodiment, the knowledge document samples are segmented and stop words are removed. The word frequency and inverse document frequency of each external knowledge document are calculated to generate a core word vector for each external knowledge document. The core word vector of the document is used as input to the self-competitive network model. The initial node parameters of the competition layer are randomly initialized. The Euclidean distance between the keyword vector of each document and the initial word vector of the competition layer is iterated sequentially. The competition node with the smallest distance is the winning node. In order to maximize the similarity of nodes in the competition category, the initial point of the winning node should be moved by a fixed step size towards the core word vector. Similar external knowledge documents are classified into the same category to maximize the semantic similarity of documents within the category and the semantic difference of documents between categories. When querying the similarity of statements, the category center point can be used to quickly locate the category, thereby improving the efficiency of retrieval and enhancing query generation.
[0061] It should be noted that the training and application processes of the self-organizing competitive network model follow multiple legal and compliant principles, including legal data sources, compliant data content, compliant data governance, compliant training objectives and plans, compliant training processes, compliant training environments and tools, and compliant ethical verification of training results.
[0062] In some embodiments, constructing the sentence hierarchical structure corresponding to the knowledge document may include the following steps: Step 1: Segment the knowledge document and generate a sentence vector for each sentence to obtain the set of sentences corresponding to the knowledge document.
[0063] In other words, the knowledge document is divided into multiple sentences, and a sentence vector is generated for each sentence. All sentence vectors constitute the sentence set.
[0064] Step 2: Take the sentence set as the corresponding node set at the bottom layer, and take the sentence vector with the smallest distance from the vector center point of the node set as the current processing node. Perform node expansion operation with the current processing node as the center to construct the bottom layer of the sentence hierarchical structure.
[0065] For example, suppose the set of sentences includes Each sentence vector is used to calculate the... The sentence vector with the smallest distance from the vector center is selected as the current processing node to perform node expansion operations and implement the underlying construction. For example, as shown... Figure 2 As shown, layer 1 is the bottom layer, and its current processing node can be... point.
[0066] Step 3: Based on the bottom layer, iteratively construct the hierarchy from bottom to top until a preset stopping condition is met. The construction process of each level includes: obtaining a subset from the node set corresponding to the lower layer adjacent to the current level according to a preset strategy as the node set corresponding to the current level; taking the sentence vector with the smallest distance to the vector center point of the node set corresponding to the current level as the current processing node; and performing a node expansion operation with the current processing node as the center to construct the current level.
[0067] For example, continue to refer to Figure 2 Layer 1 is the bottom layer. After constructing the bottom layer based on the sentence set, when constructing Layer 2, a subset of the node set corresponding to Layer 1 can be used as the node set corresponding to Layer 2 according to a preset strategy. Similarly, when constructing Layer 3, a subset of the node set corresponding to Layer 2 can be used as the node set corresponding to Layer 1 according to a preset strategy. In other words, as the hierarchical plane ascends, each upper layer simplifies the lower layer, containing fewer nodes and acting as a fast channel across longer text spans, improving query efficiency. The lower layers have a larger number of nodes, enabling more detailed queries and improving query accuracy.
[0068] In some embodiments, the preset stopping condition may include: the number of layers constructed has reached a preset number of layers, wherein the preset number of layers can be: ,in, This represents the number of sentence vectors included in the sentence set. For example, suppose... Therefore, layer 1 may include 1024 sentence nodes, layer 2 may include 512 sentence nodes, layer 3 may include 256 sentence nodes, and layer 4 may include 64 sentence nodes. In other embodiments, the top layer, i.e., the last layer constructed, includes more than a preset number of nodes; for example, the preset number of nodes may be 64.
[0069] In some embodiments, the node expansion operation centered on the current processing node includes: calculating the similarity between the current processing node and each sentence node in the node set; determining the sentence nodes with similarity greater than a second threshold as neighboring nodes of the current processing node; and constructing connection edges between the current processing node and the neighboring nodes; for each neighboring node, treating it as a new current processing node; and iteratively performing the node expansion operation based on the updated node set until a preset iteration termination condition is met, wherein, during the iterative execution process, the updated node set does not include the preceding associated nodes of the current processing node.
[0070] For example, continue to refer to Figure 2 Assuming the current processing node corresponding to layer 3 is C, calculate the similarity between C and each sentence vector, take the top q sentence vectors in similarity ranking as C's neighboring nodes, and construct neighboring edges. C's neighboring nodes can be B, D, and E. Then, for each neighboring node, take each neighboring node as the current node to be processed, calculate the top q nodes in similarity ranking as the neighboring nodes of that neighboring node, until the bottom layer is constructed.
[0071] Figure 7 This invention provides a schematic diagram of the structure of a request processing apparatus according to an embodiment of the present application, as shown below. Figure 7 As shown, the request processing device 700 may include: a determination module 710, a retrieval module 720, and a generation module 730.
[0072] In this embodiment, the determining module 710 is used to determine a target category matching the query request in response to receiving a query request; the retrieval module 720 is used to retrieve sentences related to the query request sequentially from top to bottom in the sentence hierarchy structure corresponding to each target document included in the target category, wherein each level in the sentence hierarchy structure except the bottom level is constructed based on a subset of the node set of its adjacent next level, and the node set of the bottom level is the sentence set corresponding to the target document; and the generating module 730 is used to generate a response result corresponding to the query request based on the retrieved related sentences.
[0073] In some embodiments, the request processing apparatus 700 may further include: an acquisition module for acquiring a plurality of knowledge documents, wherein the plurality of knowledge documents includes the target document; a classification module for classifying the plurality of knowledge documents using a self-organizing competitive network model; and a construction module for constructing, for each of the knowledge documents, the sentence hierarchical structure corresponding to the knowledge document.
[0074] In some embodiments, the classification module is specifically used for: constructing the self-organizing competition network model, wherein the self-organizing competition network model includes an input layer, a competition layer, and a classification layer; the input layer includes multiple document nodes, each document node corresponding to a knowledge document; the competition layer includes multiple competition nodes; the classification layer includes multiple classification groups, each classification group corresponding to a category; each document node corresponds to at least one competition node; and each competition node is associated with a classification group; initializing the initial word vector corresponding to each competition node; iteratively updating the initial word vector corresponding to each competition node according to the keyword vector corresponding to each document node until a stopping condition is met; and classifying the multiple knowledge documents into multiple classification groups according to the keyword vector corresponding to each document node and the updated initial word vector corresponding to each competition node.
[0075] In some embodiments, the classification module is specifically configured to: calculate the similarity between the keyword vector of each document node and the initial word vector of the corresponding competing node; for each competing node, take the document node with the highest similarity as the winning node, and adjust the initial word vector of the competing node based on the keyword vector of the winning node.
[0076] In some embodiments, the classification module is specifically used to: for each of the competing nodes, calculate the similarity between the keyword vector of each corresponding document node and the updated initial word vector of the competing node, and classify the knowledge documents corresponding to the document nodes with similarity greater than a first threshold into the classification group corresponding to the competing nodes.
[0077] In some embodiments, the construction module is specifically used for: segmenting the knowledge document into sentences and generating sentence vectors corresponding to each sentence to obtain the sentence set corresponding to the knowledge document; using the sentence set as the node set corresponding to the bottom layer, and taking the sentence vector with the smallest distance to the vector center point of the node set as the current processing node, performing a node expansion operation with the current processing node as the center to construct the bottom layer of the sentence hierarchical structure; based on the bottom layer, iteratively constructing the hierarchy from bottom to top until a preset stopping condition is met, wherein the construction process of each level includes: obtaining a subset from the node set corresponding to the lower layer adjacent to the current level according to a preset strategy as the node set corresponding to the current level, taking the sentence vector with the smallest distance to the vector center point of the node set corresponding to the current level as the current processing node, and performing a node expansion operation with the current processing node as the center to construct the current level.
[0078] In some embodiments, the classification module is specifically used for: calculating the similarity between the current processing node and each sentence node in the node set, determining the sentence nodes with similarity greater than a second threshold as neighboring nodes of the current processing node, and constructing connection edges between the current processing node and the neighboring nodes; for each neighboring node, treating it as a new current processing node, and iteratively performing the node expansion operation based on the updated node set until a preset iteration termination condition is met, wherein, during the iteration execution process, the updated node set does not include the preceding associated nodes of the current processing node.
[0079] The request processing apparatus provided in this application embodiment can achieve... Figures 1-6 The various processes implemented in the method embodiments shown will not be described again here to avoid repetition.
[0080] One of the request processing devices in the embodiments of this application can be a device, or a component, integrated circuit, or chip in an electronic device. The embodiments of this application are not specifically limited.
[0081] One of the request processing devices in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0082] like Figure 8 As shown, this application embodiment also provides an electronic device 800, including a processor 810 and a memory 820. The memory 820 stores a program or instructions that can run on the processor 810. When the program or instructions are executed by the processor 810, they implement the above-mentioned... Figures 1 to 6The various processes in the illustrated embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0083] This application embodiment also provides a readable storage medium storing a program or instructions, which, when executed by a processor, implement the above-described functionality. Figures 1 to 6 The various processes in the illustrated embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0084] The processor mentioned above is the processor in the terminal described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. In some examples, the readable storage medium may be a non-transient readable storage medium.
[0085] This application embodiment also provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the above. Figures 1 to 6 The various processes in the illustrated embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0086] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0087] This application embodiment also provides a computer program / program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the above-described actions. Figures 1 to 6 The various processes in the illustrated embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0088] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0089] From the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of computer software products plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes several instructions to cause the terminal or network-side device to execute the methods described in the various embodiments of this application.
[0090] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other implementations under the guidance of this application without departing from the spirit and scope of the claims. All of these implementations are within the protection scope of this application.
Claims
1. A request processing method, characterized in that, The method includes: In response to receiving a query request, determine the target category that matches the query request; For each target document included in the target category, sentences related to the query request are retrieved sequentially from top to bottom in the sentence hierarchical structure corresponding to the target document. Each level in the sentence hierarchical structure, except for the bottom level, is constructed based on a subset of the node set corresponding to its adjacent next level. The node set corresponding to the bottom level is the sentence set corresponding to the target document. Based on the retrieved relevant sentences, a response result corresponding to the query request is generated.
2. The method according to claim 1, characterized in that, Before determining the target category matching the query request in response to receiving the query request, the method further includes: Acquire multiple knowledge documents, wherein the multiple knowledge documents include the target document; The multiple knowledge documents are classified using a self-organizing competitive network model; For each knowledge document, construct the corresponding sentence hierarchical structure.
3. The method according to claim 2, characterized in that, The method of classifying multiple knowledge documents using a self-organizing competitive network model includes: Construct the self-organizing competition network model, wherein the self-organizing competition network model includes an input layer, a competition layer and a classification layer, the input layer includes multiple document nodes, each document node corresponds to a knowledge document, the competition layer includes multiple competition nodes, the classification layer includes multiple classification groups, each classification group corresponds to a category, each document node corresponds to at least one competition node, and each competition node is associated with a classification group; Initialize the initial word vector corresponding to each of the competing nodes; Based on the keyword vectors corresponding to each document node, iteratively update the initial word vectors corresponding to each competing node until the stopping condition is met; Based on the keyword vectors corresponding to each document node and the updated initial word vectors corresponding to each competing node, the multiple knowledge documents are divided into multiple classification groups.
4. The method according to claim 3, characterized in that, The step of iteratively updating the initial word vector corresponding to each competing node based on the keyword vector corresponding to each document node until the stopping condition is met includes: Calculate the similarity between the keyword vector of each document node and the initial word vector of the corresponding competing node; For each competing node, the document node with the highest similarity is taken as the winning node, and the initial word vector corresponding to the competing node is adjusted based on the keyword vector corresponding to the winning node.
5. The method according to claim 3, characterized in that, The step of dividing multiple knowledge documents into multiple classification groups based on the keyword vectors corresponding to each document node and the updated initial word vectors of each competing node includes: For each competing node, the similarity between the keyword vector of each corresponding document node and the updated initial word vector of the competing node is calculated. The knowledge documents corresponding to the document nodes with similarity greater than a first threshold are assigned to the classification group corresponding to the competing node.
6. The method according to claim 2, characterized in that, The construction of the sentence hierarchical structure corresponding to the knowledge document includes: The knowledge document is segmented into sentences and a sentence vector is generated for each sentence to obtain the set of sentences corresponding to the knowledge document. The sentence set is used as the node set corresponding to the bottom layer, and the sentence vector with the smallest distance to the vector center point of the node set is used as the current processing node. The node expansion operation is performed with the current processing node as the center to construct the bottom layer of the sentence hierarchical structure. Based on the aforementioned bottom layer, hierarchical levels are iteratively constructed from bottom to top until a preset stopping condition is met. The construction process for each level includes: From the set of nodes corresponding to the lower level adjacent to the current level, a subset is obtained according to a preset strategy as the set of nodes corresponding to the current level. The sentence vector with the smallest distance to the vector center point of the set of nodes corresponding to the current level is taken as the current processing node. Then, a node expansion operation is performed with the current processing node as the center to construct the current level.
7. The method according to claim 6, characterized in that, The node expansion operation centered on the current processing node includes: Calculate the similarity between the current processing node and each sentence node in the node set, determine the sentence nodes with similarity greater than a second threshold as the neighbor nodes of the current processing node, and construct the connection edges between the current processing node and the neighbor nodes; For each of the neighboring nodes, it is taken as the new current processing node, and the node expansion operation is iteratively executed based on the updated node set until a preset iteration end condition is met. During the iteration execution, the updated node set does not include the predecessor associated nodes of the current processing node.
8. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the request processing method as described in any one of claims 1-7.
9. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the request processing method as described in any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes program instructions that, when executed by a computer, cause the computer to perform the steps of the request processing method as described in any one of claims 1-7.