Retrieval enhancement generation method and system and related device

By calculating and cacheing candidate text activation values ​​in the knowledge base in advance, and generating reply text with input text, the problem of retrieval enhancement generation hard delay is solved, achieving faster response speed and user experience.

CN119226435AActive Publication Date: 2024-12-31IFLYTEK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411243762.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-31
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

As the complexity of artificial intelligence retrieval application scenarios increases, the hard delay generated by retrieval enhancement affects the user experience, and how to reduce hard delay has become an urgent problem to be solved.

Method used

By obtaining the candidate text in the knowledge base and its activation values ​​and cache them, obtaining the activation values ​​of the input text, selecting the reference text and loading the cached activation values, generating reply text based on the question and reference activation values, reducing duplicate calculations in the inference process.

Benefits of technology

Reduces hard delays in search enhancement generation, improving response speed and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226435A_ABST
    Figure CN119226435A_ABST
Patent Text Reader

Abstract

The invention discloses a retrieval enhancement generation method and system and a related device. The method comprises the steps that all candidate texts in a knowledge base and reference activation values corresponding to the candidate texts are obtained; wherein the reference activation value is obtained by performing activation value calculation on the candidate text; obtaining an input text, and performing activation value calculation on the input text to obtain a problem activation value; obtaining at least one candidate text as a reference text corresponding to the input text, and obtaining a cached reference activation value corresponding to the reference text; a reply text is generated based on the question activation value and the reference activation value. In this way, the hard time delay generated by retrieval enhancement can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a retrieval enhancement generation method, system and related devices. Background Art

[0002] With the continuous development of artificial intelligence technology, more and more users tend to use artificial intelligence to assist in completing some knowledge question-and-answer tasks. Users input questions and artificial intelligence gives answers. As the application scenarios become more and more complex, in order to ensure the accuracy of the answers, the amount of reference knowledge retrieved by artificial intelligence will become more and more, resulting in more and more time-consuming reasoning. The hard delay of the corresponding search enhancement generation is also getting longer and longer, affecting the user experience. In view of this, how to reduce the hard delay of search enhancement generation has become an urgent problem to be solved. Summary of the invention

[0003] The main technical problem solved by the present application is to provide a retrieval enhancement generation method, system and related devices, which can improve and reduce the hard delay of retrieval enhancement generation.

[0004] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a retrieval enhancement generation method, including: obtaining all candidate texts in a knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text; obtaining input text, calculating the activation value of the input text, and obtaining a question activation value; obtaining at least one of the candidate texts as a reference text corresponding to the input text, and obtaining the cached reference activation value corresponding to the reference text; and generating a reply text based on the question activation value and the reference activation value.

[0005] In order to solve the above technical problems, another technical solution adopted by the present application is: to provide a retrieval enhancement generation system, including: a first acquisition module, used to obtain all candidate texts in the knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text; a calculation module, used to obtain input text, calculate the activation value of the input text, and obtain the question activation value; a second acquisition module, used to obtain at least one of the candidate texts as the reference text corresponding to the input text, and obtain the cached reference activation value corresponding to the reference text; a generation module, used to generate a reply text based on the question activation value and the reference activation value.

[0006] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, comprising: a memory and a processor coupled to each other, the memory storing program instructions, and the processor being used to execute the program instructions to implement the method mentioned in the above technical solution.

[0007] In order to solve the above technical problems, another technical solution adopted in the present application is: providing a computer-readable storage medium storing program instructions that can be executed by a processor, wherein the program instructions are used to implement the method mentioned in the above technical solution.

[0008] The beneficial effects of the present application are as follows: Different from the prior art, the retrieval enhancement generation method proposed in the present application obtains all candidate texts in the knowledge base, obtains and caches the corresponding reference activation values ​​obtained by calculating the activation values ​​of the candidate texts, obtains the input text inputted by the object, calculates the activation value of the input text, thereby obtaining the question activation value, obtains at least one candidate text in the knowledge base as the reference text corresponding to the input text, and obtains the cached reference activation value corresponding to the reference text, generates a reply text based on the question activation value corresponding to the input text and the reference activation value corresponding to the reference text, since the activation values ​​of all candidate texts in the knowledge base have been calculated in advance and the corresponding reference activation values ​​have been obtained and cached, after the input text is obtained subsequently, there is no need to re-calculate the activation value of the selected corresponding reference text, and only the corresponding cached reference activation value needs to be loaded and the question activation value of the input text needs to be calculated to generate the reply text, which greatly reduces the amount of initial calculation in the reasoning process, thereby reducing the hard delay of retrieval enhancement generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0010] Figure 1 It is a flowchart of an implementation method of the search enhancement generation method of the present application;

[0011] Figure 2 It is a flowchart of another implementation method of the search enhancement generation method of the present application;

[0012] Figure 3 yes Figure 2 Step S204 corresponds to a flowchart of an implementation method;

[0013] Figure 4 It is a schematic diagram of an implementation method of a path score attenuation scheme of the present application;

[0014] Figure 5 It is a structural schematic diagram of an implementation method of the search enhancement generation system of the present application;

[0015] Figure 6 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0016] Figure 7 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0018] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.

[0019] The search enhancement generation method proposed in this application is implemented by a smart terminal, which can be a smart device that at least integrates a corresponding reply function, or an application on a smart device. The smart device can be a mobile phone, a tablet computer, or a personal computer.

[0020] See also Figure 1 , Figure 1 : is a flowchart of an implementation method of the search enhancement generation method of the present application, the method comprising:

[0021] S101: Obtain all candidate texts in the knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text.

[0022] Specifically, all candidate texts in the knowledge base are obtained, and corresponding reference activation values ​​obtained by calculating activation values ​​for the candidate texts and cached are obtained.

[0023] It is understandable that the knowledge base usually contains knowledge points processed from various types of data into specifications, for example, various types of documents such as txt, word, pdf, excel, jpg, wav, etc. are processed into candidate texts according to certain rules.

[0024] In one application, all candidate texts in the knowledge base are obtained, and corresponding reference activation values ​​obtained by calculating activation values ​​of the candidate texts using an activation function are obtained.

[0025] In some application scenarios, activation functions such as ReLU function, Sigmoid function or Softmax function can be used to calculate the activation value of the candidate text to obtain the corresponding reference activation value.

[0026] In another application mode, all candidate texts in the knowledge base are obtained, and activation values ​​of the candidate texts are calculated using a long text processing strategy to obtain corresponding reference activation values.

[0027] In some application scenarios, long text processing strategies such as extended context windows and chunking techniques can be used to calculate activation values ​​for candidate texts to obtain corresponding reference activation values.

[0028] In summary, this application does not limit how to calculate the activation value of the candidate text to obtain the corresponding reference activation value.

[0029] S102: Obtain input text, calculate activation value of the input text, and obtain question activation value.

[0030] Specifically, the input text input by the object is obtained, and the activation value of the input text is calculated to obtain the question activation value.

[0031] In one application mode, after obtaining the input text input by the user object, the activation value of the input text is calculated using the activation function to obtain the problem activation value.

[0032] In some application scenarios, after obtaining the input text of the object input, the activation value of the input text can be calculated using an activation function such as a ReLU function, a Sigmoid function, or a Softmax function to obtain a corresponding problem activation value.

[0033] In another application mode, after obtaining the input text input by the object, the activation value of the input text is calculated using the long text processing strategy to obtain the question activation value.

[0034] In some application scenarios, long text processing strategies such as extended context windows and chunking techniques can be used to calculate the activation value of the input text to obtain the corresponding question activation value.

[0035] In summary, this application does not restrict how to calculate the activation value of the input text to obtain the corresponding question activation value.

[0036] S103: Obtain at least one candidate text as a reference text corresponding to the input text, and obtain a cached reference activation value corresponding to the reference text.

[0037] Specifically, at least one candidate text in the knowledge base is obtained as a reference text corresponding to the input text, and a cached reference activation value corresponding to the reference text is obtained.

[0038] In one application, all candidate texts in the knowledge base are obtained, the similarities between the candidate texts and the input texts are compared and sorted, the top k candidate texts are selected as reference texts corresponding to the input texts, and the cached reference activation values ​​corresponding to the reference texts are obtained.

[0039] In another application mode, keywords of the input text are extracted, candidate texts containing corresponding keywords are obtained from the knowledge base as reference texts corresponding to the input texts, and cached reference activation values ​​corresponding to the reference texts are obtained.

[0040] S104: Generate a reply text based on the question activation value and the reference activation value.

[0041] Specifically, based on the question activation value corresponding to the input text and the reference activation value corresponding to the reference text, a reply text is generated.

[0042] In one application mode, the question activation value and the reference activation value are concatenated to obtain a corresponding concatenated activation value, and a reply text is generated based on the concatenated activation value.

[0043] In one application scenario, the question activation value and the reference activation value are concatenated to obtain the corresponding concatenated activation value, and the concatenated activation value is input into a pre-trained intelligent analysis model to obtain a reply text generated by the intelligent analysis model. Since the reference activation value has been pre-calculated and cached, when generating the corresponding reply text, it is only necessary to calculate the question activation value of the input text and load the corresponding reference activation value. There is no need to repeat the operation on the reference text, which greatly reduces the response calculation amount of the first character in the reply text reasoning process caused by the excessive length of the reference text, that is, the first response calculation amount, and at the same time reduces the overall time for generating subsequent characters of the reply text, thereby reducing the hard delay of retrieval enhancement generation.

[0044] Optionally, the intelligent analysis model is a large language model, which may include but is not limited to deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), long short-term memory networks (LSTM), and generative pre-trained Transformer models, etc. No specific restrictions are made on the specific structure and deployment of the large language model.

[0045] In another application, the question activation value and the reference activation value are concatenated to obtain a corresponding concatenated activation value, and the emotional and cognitive information of the external common sense library is combined to generate a reply text, thereby further improving the accuracy of reply text generation.

[0046] The retrieval enhancement generation method proposed in the present application obtains all candidate texts in the knowledge base, obtains and caches the corresponding reference activation values ​​obtained by calculating the activation values ​​of the candidate texts, obtains the input text inputted by the object, calculates the activation value of the input text, thereby obtaining the question activation value, obtains at least one candidate text in the knowledge base as the reference text corresponding to the input text, and obtains the cached reference activation value corresponding to the reference text, generates a reply text based on the question activation value corresponding to the input text and the reference activation value corresponding to the reference text, because the activation values ​​of all candidate texts in the knowledge base have been calculated in advance and the corresponding reference activation values ​​have been obtained and cached, after the input text is obtained subsequently, there is no need to re-calculate the activation value of the selected corresponding reference text, and only the corresponding cached reference activation value needs to be loaded and the question activation value of the input text needs to be calculated to generate the reply text, which greatly reduces the amount of initial calculation in the reasoning process, thereby reducing the hard delay of retrieval enhancement generation.

[0047] See also Figure 2 , Figure 2 It is a flowchart of another embodiment of the search enhancement generation method of the present application. The method comprises:

[0048] S201: Obtain all candidate texts in the knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text.

[0049] Specifically, all candidate texts in the knowledge base are obtained, and corresponding reference activation values ​​obtained by calculating activation values ​​for the candidate texts and cached are obtained.

[0050] S202: Obtain input text, calculate activation value of the input text, and obtain question activation value.

[0051] Specifically, the input text input by the object is obtained, and the activation value of the input text is calculated to obtain the question activation value.

[0052] S203: Acquire input text features corresponding to the input text, and acquire candidate text features corresponding to the candidate text.

[0053] Specifically, input text features corresponding to the input text inputted using the object are obtained, and candidate text features corresponding to the candidate texts are obtained.

[0054] S204: Based on the input text features and the candidate text features, select at least one candidate text as a reference text corresponding to the input text.

[0055] Specifically, based on the input text features corresponding to the input text and the candidate text features corresponding to the candidate texts, at least one candidate text is selected as the reference text corresponding to the input text.

[0056] In one application, see Figure 3 , Figure 3 yes Figure 2 Step S204 in the flowchart corresponds to an implementation method. Step S204 specifically includes:

[0057] S301: Selecting a first number of candidate texts based on input text features and candidate text features.

[0058] Specifically, a first number of candidate texts are selected based on input text features corresponding to the input text and candidate text features corresponding to the candidate texts.

[0059] Optionally, BM-25 (Best Matching-25) or a vectorization scheme based on a Bert model may be used to select a first number of candidate texts according to input text features corresponding to the input text and candidate text features corresponding to the candidate texts. BM-25 and a vectorization scheme based on a Bert model are both prior arts and will not be described in detail herein.

[0060] S302: Determine a path score corresponding to each character based on the input text feature and the characters in the selected candidate text.

[0061] Specifically, based on the input text feature corresponding to the input text and the characters in the selected candidate text, a path score corresponding to each character is determined.

[0062] In one application, characters in the selected candidate text are obtained, and the probability value corresponding to each character is determined based on the input text features corresponding to the input text and each character; the attenuation weight corresponding to the character is obtained, and the path score corresponding to each character is determined based on the probability value and attenuation weight of each character; wherein the attenuation weight decreases with the order of the characters in the candidate text.

[0063] Specifically, characters in the selected candidate text are obtained, and the probability value corresponding to each character is determined based on the input text features corresponding to the input text and each character, and the attenuation weight corresponding to each character is obtained, thereby determining the path score corresponding to each character based on the probability value and attenuation weight of each character.

[0064] In one application scenario, for each character, a sliding window is generated with the current character as the center, the decay weight corresponding to the character in the sliding window is obtained, and the path score corresponding to the current character is determined based on the probability value and decay weight corresponding to the character in the sliding window.

[0065] Specifically, for each character, a sliding window is generated with the current character as the center, the decay weights corresponding to all characters in the sliding window are obtained, and the path score corresponding to the current character is determined based on the probability values ​​and decay weights corresponding to the characters in the sliding window.

[0066] It should be noted that for a large model, when an input text is obtained, the output is the distribution probability on the dictionary dimension, and multiple decoding paths will be formed based on multiple characters of the multiple outputs and the corresponding probability distribution. In order to measure the quality of a decoding path, there will generally be a path score, and in the existing path scoring scheme, a character decoding may get an extremely high score, that is, an extreme value, and the existence of an extreme value will affect the final path score result, which means that the later the decoded word in a text, the lower the confidence of its corresponding decoding score. Therefore, this application considers the problem of extreme values ​​and score confidence, and generates a sliding window centered on the current character to obtain the attenuation weights corresponding to all characters in the sliding window, and the attenuation weights decrease with the order of the characters in the candidate text. Based on the probability value and attenuation weight corresponding to the character in the sliding window, the path score corresponding to the current character is determined, thereby reducing the impact of extreme values ​​and improving the accuracy of the output results of the large model.

[0067] In a specific application scenario, please refer to Figure 4 , Figure 4 This is a schematic diagram of an implementation method of the path score attenuation scheme of the present application. The path score calculation process provided by the present application is as follows:

[0068]

[0069] Among them, t is the position corresponding to the current character, the window range is tk to t+k, the window length is 2k+1, and r is the attenuation factor. The attenuation factor can be configured according to the actual situation. i ∈(tk, t+k), p ti is the probability value of the current character.

[0070] S303: Based on the path scores corresponding to at least some of the characters, select a second number of candidate texts as reference texts corresponding to the input text; wherein the second number is smaller than the first number.

[0071] Specifically, based on the path scores corresponding to at least some of the characters, a second number of candidate texts that is smaller than the first number is selected as reference texts corresponding to the input text.

[0072] In one application scenario, every two candidate texts corresponding to the input text are taken as text pairs, and the score difference of the path scores between characters at the same position in the text pair is determined; in response to the score difference exceeding a preset threshold, the candidate texts with higher path scores in the text pair are arranged in a preset order until the selected candidate texts are sorted to obtain a candidate text sequence; and a second number of candidate texts are selected from the candidate text sequence in the preset order as reference texts corresponding to the input text.

[0073] Specifically, every two candidate texts corresponding to the input text are taken as text pairs, the path scores between the corresponding characters at the same position in the text pair are determined, and their score difference is calculated. When the score difference exceeds a preset threshold, the candidate texts with relatively high path scores in the text pair are arranged in a preset order until all the selected candidate texts of the first number are sorted to obtain a corresponding candidate text sequence. A second number of candidate texts less than the first number are selected from the candidate text sequence in the preset order as reference texts corresponding to the input text. By screening the reference texts from the candidate texts, the accuracy of subsequent reply text generation can be further improved. For multiple candidate texts, it is only necessary to calculate the path scores corresponding to some characters in the candidate texts to obtain the reference text, without calculating the path scores of all candidate texts, thereby reducing the calculation time and further reducing the hard delay of retrieval enhancement generation.

[0074] Optionally, the first number can be 100, 50, etc., the second number can be 10, 5, etc., the preset threshold can be determined according to actual conditions, and the preset order can be sorting the path scores from high to low, or from low to high. This application does not make any specific limitations on this.

[0075] In a specific application scenario, please continue to refer to Figure 4 , candidate text doc1 and candidate text doc2 are taken as text pairs, and sliding windows of the same length are generated from the front to the back with the current character as the center, and the path scores of the characters at the same position are calculated according to the above formula, which are s1 and s2 respectively, and the path score of s1 is higher than that of s2. When the difference in the path scores between s1 and s2 exceeds a threshold, the candidate text doc1 corresponding to s1 is ranked as a higher priority before the candidate text doc2 corresponding to s2.

[0076] S205: Obtain the cached reference activation value corresponding to the reference text.

[0077] Specifically, a pre-calculated and cached reference activation value corresponding to the reference text is obtained.

[0078] S206: Generate a reply text based on the question activation value and the reference activation value.

[0079] Specifically, based on the question activation value corresponding to the input text and the reference activation value corresponding to the reference text, a reply text is generated.

[0080] In one application method, the question activation value and the reference activation value are concatenated to obtain the prompt activation value; the prompt activation value is input into the intelligent analysis model to obtain the response text output by the intelligent analysis model.

[0081] Specifically, the question activation value corresponding to the input text and the reference activation value corresponding to the reference text are concatenated to obtain the prompt activation value, and then the prompt activation value is input into the intelligent analysis model to obtain the reply text output by the intelligent analysis model.

[0082] It is understandable that after being pre-trained, the intelligent analysis model can quickly generate a reply text that matches the prompt activation value based on the prompt activation value.

[0083] In one application scenario, the question activation value and the reference activation value are concatenated to obtain the corresponding concatenated activation value, and the concatenated activation value is input into a pre-trained intelligent analysis model to obtain a reply text generated by the intelligent analysis model. Since the reference activation value has been pre-calculated and cached, when generating the corresponding reply text, it is only necessary to calculate the question activation value of the input text and load the corresponding reference activation value. There is no need to repeat the operation on the reference text, which greatly reduces the response calculation amount of the first character in the reply text reasoning process caused by the excessive length of the reference text, that is, the first response calculation amount, and at the same time reduces the overall time for generating subsequent characters of the reply text, thereby reducing the hard delay of retrieval enhancement generation.

[0084] See also Figure 5 , Figure 5 The retrieval enhancement generation system 50 includes a first acquisition module 500 , a calculation module 501 , a second acquisition module 502 and a generation module 503 .

[0085] Specifically, the first acquisition module 500 is used to acquire all candidate texts in the knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text.

[0086] The calculation module 501 is used to obtain input text, calculate the activation value of the input text, and obtain the question activation value.

[0087] The second acquisition module 502 is used to acquire at least one candidate text as a reference text corresponding to the input text, and acquire a cached reference activation value corresponding to the reference text.

[0088] The generating module 503 is used to generate a reply text based on the question activation value and the reference activation value.

[0089] Optionally, the second acquisition module 502 is also used to obtain input text features corresponding to the input text, and to obtain candidate text features corresponding to the candidate text; based on the input text features and the candidate text features, select at least one candidate text as the reference text corresponding to the input text; and obtain a cached reference activation value corresponding to the reference text.

[0090] Optionally, the second acquisition module 502 is also used to select a first number of candidate texts based on input text features and candidate text features; determine the path score corresponding to each character based on the input text features and the characters in the selected candidate text; and select a second number of candidate texts as reference texts corresponding to the input text based on the path scores corresponding to at least some of the characters; wherein the second number is less than the first number.

[0091] Optionally, the second acquisition module 502 is also used to obtain characters in the selected candidate text, determine the probability value corresponding to each character based on the input text features and each character; obtain the attenuation weight corresponding to the character, and determine the path score corresponding to each character based on the probability value and attenuation weight of each character; wherein the attenuation weight decreases with the order of the character in the candidate text.

[0092] Optionally, the second acquisition module 502 is also used to generate a sliding window with the current character as the center for each character, obtain the attenuation weight corresponding to the character in the sliding window, and determine the path score corresponding to the current character based on the probability value and attenuation weight corresponding to the character in the sliding window.

[0093] Optionally, the second acquisition module 502 is also used to take every two candidate texts corresponding to the input text as a text pair, and determine the score difference of the path scores between characters at the same position in the text pair; in response to the score difference exceeding a preset threshold, arrange the candidate texts with higher path scores in the text pair in a preset order until the selected candidate texts are sorted to obtain a candidate text sequence; and select a second number of candidate texts from the candidate text sequence in the preset order as reference texts corresponding to the input text.

[0094] Optionally, the generation module 503 is further used to concatenate the question activation value and the reference activation value to obtain a prompt activation value; input the prompt activation value into the intelligent analysis model to obtain a reply text output by the intelligent analysis model.

[0095] See also Figure 6 , Figure 66 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 60 includes: a memory 601 and a processor 602 coupled to each other. The memory 601 stores program instructions, and the processor 602 is used to execute the program instructions to implement the method mentioned in any of the above embodiments. For the description of the relevant content, please refer to the detailed description of the above method embodiment, which will not be repeated here. Specifically, the electronic device 60 includes but is not limited to: a desktop computer, a laptop computer, a tablet computer, a server, etc., which are not limited here. In addition, the processor 602 can also be called a CPU (Center Processing Unit). The processor 602 may be an integrated circuit chip with signal processing capabilities. The processor 602 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 602 can be implemented by an integrated circuit chip.

[0096] See also Figure 7 , Figure 7 The computer-readable storage medium 70 stores program instructions 700 that can be executed by a processor, and the program instructions 700 are used to implement the method mentioned in any of the above embodiments.

[0097] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0098] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.

[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0101] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A search enhancement generation method, characterized in that: include: Obtain all candidate texts in the knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text; Obtaining input text, and calculating activation values ​​for the input text to obtain a question activation value; Acquire at least one of the candidate texts as a reference text corresponding to the input text, and acquire the cached reference activation value corresponding to the reference text; A reply text is generated based on the question activation value and the reference activation value.

2. The method according to claim 1, characterized in that The obtaining at least one of the candidate texts as a reference text corresponding to the input text, and obtaining the cached reference activation value corresponding to the reference text, comprises: Acquire input text features corresponding to the input text, and acquire candidate text features corresponding to the candidate text; Based on the input text features and the candidate text features, selecting at least one of the candidate texts as a reference text corresponding to the input text; Obtain the cached reference activation value corresponding to the reference text.

3. The method according to claim 2, characterized in that The selecting at least one of the candidate texts as a reference text corresponding to the input text based on the input text feature and the candidate text feature includes: Selecting a first number of candidate texts based on the input text features and the candidate text features; Determine a path score corresponding to each character based on the input text feature and the selected characters in the candidate text; Based on the path scores corresponding to at least some of the characters, a second number of the candidate texts are selected as reference texts corresponding to the input text; wherein the second number is smaller than the first number.

4. The method according to claim 3, characterized in that The step of determining a path score corresponding to each character based on the input text feature and the selected characters in the candidate text includes: Obtaining characters in the selected candidate text, and determining a probability value corresponding to each character based on the input text feature and each character; Obtain the decay weight corresponding to the character, and determine the path score corresponding to each character based on the probability value and the decay weight of each character; wherein the decay weight decreases with the order of the character in the candidate text.

5. The method according to claim 4, characterized in that The acquiring the decay weight corresponding to the character, and determining the path score corresponding to each character based on the probability value and the decay weight of each character, comprises: For each character, a sliding window is generated with the current character as the center, and the decay weight corresponding to the character in the sliding window is obtained. Based on the probability value and the decay weight corresponding to the character in the sliding window, the path score corresponding to the current character is determined.

6. The method according to claim 3, characterized in that The selecting a second number of the candidate texts as reference texts corresponding to the input text based on the path scores corresponding to at least some of the characters comprises: Taking every two candidate texts corresponding to the input text as a text pair, determining the score difference of the path score between characters at the same position in the text pair; In response to the score difference exceeding a preset threshold, the candidate texts with higher path scores in the text pairs are arranged in a preset order until the selected candidate texts are sorted to obtain a candidate text sequence; The second number of candidate texts are selected from the candidate text sequence in the preset order as reference texts corresponding to the input text.

7. The method according to claim 1, characterized in that The step of generating a reply text based on the question activation value and the reference activation value comprises: Concatenate the question activation value and the reference activation value to obtain a prompt activation value; The prompt activation value is input into the intelligent analysis model to obtain a reply text output by the intelligent analysis model.

8. A search enhancement generation system, characterized in that: include: A first acquisition module is used to acquire all candidate texts in the knowledge base and their corresponding reference activation values; wherein the reference activation value is obtained by calculating the activation value of the candidate text; A calculation module, used for obtaining input text, performing activation value calculation on the input text, and obtaining a question activation value; A second acquisition module, configured to acquire at least one of the candidate texts as a reference text corresponding to the input text, and acquire the cached reference activation value corresponding to the reference text; A generating module is used to generate a reply text based on the question activation value and the reference activation value.

9. An electronic device, characterized in that: The method comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Search recommendation method and device, equipment and storage medium

    CN111274366A

  • Text matching method and device and electronic equipment

    CN116127005A

  • Text processing method and training method and device of text processing model

    CN116542258A