Bundled search processing method and apparatus, computer device, and storage medium

By employing a width decay strategy based on bundle search in ultra-long sequence scenarios, the problem of balancing search efficiency and effectiveness in existing technologies is solved, achieving improved efficiency while ensuring search effectiveness.

CN116303892BActive Publication Date: 2026-05-01ZHAOLIAN CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHAOLIAN CONSUMER FINANCE CO LTD
Filing Date
2023-02-07
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In scenarios involving extremely long sequences, existing search methods cannot improve search efficiency while ensuring search effectiveness. In particular, Exhaustive Search has high time complexity, Greedy Search is prone to getting trapped in local optima, and Beam Search is inefficient when the beam width is large.

Method used

By performing a bundle search based on the current object to be matched and the bundle width, an initial search result is obtained. The bundle width is then gradually adjusted by decreasing the width based on the number of bundle searches performed until a threshold is reached, thus ensuring search effectiveness while improving efficiency.

Benefits of technology

In scenarios involving extremely long sequences, by gradually adjusting the bundle width, local optima are avoided, thus improving search efficiency while ensuring search performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303892B_ABST
    Figure CN116303892B_ABST
Patent Text Reader

Abstract

The application relates to a bundle search processing method and device, computer equipment and a storage medium. The method comprises the following steps: performing bundle search on a word table based on a current to-be-matched object and a current bundle width to obtain a current search result, wherein the current search result comprises a plurality of target words which are matched successfully with the current to-be-matched object and the number of which matches the current bundle width; performing width attenuation on the current bundle width according to a bundle width attenuation mode matched by the number of executed bundle searches to obtain a bundle width for next bundle search; taking each target word as a to-be-matched object for next bundle search, and iteratively performing bundle search until the bundle width obtained by attenuation is equal to a bundle width threshold value, and taking the search result at this time as a target to-be-matched object, and performing bundle search on the word table based on the bundle width threshold value to obtain a target search result. By adopting the method, the search efficiency can be improved while ensuring the search effect in an ultra-long sequence scene.
Need to check novelty before this filing date? Find Prior Art

Description

Cluster search processing methods, apparatus, computer equipment and storage media Technical Field

[0001] This application relates to the field of computer technology, and in particular to a beam search processing method, apparatus, computer device, and storage medium. Background Technology

[0002] In existing technologies, search methods such as Exhaustive Search, Greedy Search, and Beam Search are generally applied to various fields such as text generation, machine translation, and speech recognition to complete search tasks.

[0003] However, in scenarios with extremely long sequences (where the output sequence length is quite long after the search), multiple rounds of searching are required. Exhaustive Search calculates the probability of all search results in each search, which, while potentially yielding a globally optimal solution, has high time complexity and is time-consuming, resulting in low search efficiency. Greedy Search has low time complexity, but its small search space makes it prone to getting trapped in local optima, leading to poor search performance. Beam Search, while improving search efficiency when the beam width (search space) is small, is also prone to getting trapped in local optima, affecting search performance. Conversely, while improving search performance when the beam width (search space) is large, it results in low search efficiency. Therefore, in scenarios with extremely long sequences, existing search methods cannot simultaneously improve search efficiency while ensuring search performance. Summary of the Invention

[0004] Therefore, it is necessary to provide a bundle search processing method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve search efficiency while ensuring search performance in ultra-long sequence scenarios, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a beam search processing method. The method includes:

[0006] Based on the current object to be matched and the current bundle width, a bundle search is performed on the vocabulary containing multiple words to obtain the current search results. The current search results include multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current bundle width.

[0007] Based on the bundle width decay method matched by the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search.

[0008] Each target word is used as the matching object for the next bundle search. The bundle search is performed iteratively on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0009] The search results obtained when the bundle width obtained by attenuation is equal to the bundle width threshold are taken as the target objects to be matched, and the vocabulary is subjected to bundle search based on the bundle width threshold to obtain the target search results.

[0010] In one embodiment, based on the current object to be matched and the current bundle width, a bundle search is performed on a vocabulary containing multiple words to obtain the current search results, including:

[0011] Based on the current object to be matched, multiple unfiltered words that successfully match the current object are obtained from the vocabulary through cluster search. Each unfiltered word has its own corresponding probability value.

[0012] Sort the probability values ​​of each of the multiple unfiltered words to obtain the probability value sorting result;

[0013] Based on the number of target words matching the current bundle width and the probability values, multiple target words are selected from the unfiltered words as the current search results.

[0014] In one embodiment, the number of objects to be matched is at least one;

[0015] Based on the current target object, multiple unfiltered words that successfully match the current target object are obtained from the vocabulary through bundle search, including:

[0016] Get the number of words that can be matched for the current object to be matched when performing a cluster search;

[0017] Based on the number of matchable words, multiple unfiltered words that successfully match the current target object are obtained from the vocabulary through cluster search. The number of unfiltered words corresponding to each current target object is consistent with the number of matchable words.

[0018] In one embodiment, multiple target words are selected as the current search results from the unfiltered words according to the number of target words matching the current bundle width and the probability value sorting results, including:

[0019] When the current bundle width is greater than or equal to the bundle width threshold, the current bundle width is determined as the number of target words. Based on the probability value sorting results, multiple target words with the same number as the determined number of target words are selected from multiple unfiltered words, and these multiple target words are used as the current search results.

[0020] When the current bundle width is less than the bundle width threshold, the bundle width threshold is used as the current bundle width and determined as the number of target words. Based on the probability value sorting results, multiple target words with the same number as the determined number of target words are selected from multiple unfiltered words, and these multiple target words are used as the current search results.

[0021] In one embodiment, the current bundle width is attenuated according to the bundle width attenuation method matched by the number of bundle searches already performed, to obtain the bundle width for the next bundle search, including:

[0022] When the number of bundle searches performed is less than the bundle search count threshold, obtain the bundle width decay value;

[0023] Based on the bundle width attenuation value, the current bundle width is attenuated once to obtain the bundle width for the next bundle search.

[0024] In one embodiment, the current bundle width is attenuated according to the bundle width attenuation method matched by the number of bundle searches already performed, to obtain the bundle width for the next bundle search, including:

[0025] When the number of bundle searches performed is equal to the bundle search threshold, the number of bundle searches performed is reset to zero, and the bundle width attenuation coefficient is obtained.

[0026] Multiply the bundle width attenuation coefficient by the current bundle width, and use the result of the multiplication as the bundle width for the next bundle search.

[0027] The method further includes:

[0028] When performing the next bundle search, the number of bundle searches already performed is recounted.

[0029] Secondly, this application also provides a beam search processing apparatus. The apparatus includes:

[0030] The current search result acquisition module is used to perform a beam search on a vocabulary containing multiple words based on the current object to be matched and the current beam width to obtain the current search result. The current search result includes multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current beam width.

[0031] The bundle width attenuation module is used to attenuate the current bundle width according to the bundle width attenuation method matched by the number of bundle searches already performed, so as to obtain the bundle width for the next bundle search.

[0032] The bundle search iteration module is used to take each target word as the matching object for the next bundle search, and iteratively perform bundle search on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0033] The target search result acquisition module is used to take the search results when the bundle width obtained by attenuation is equal to the bundle width threshold as the target matching object, and perform a bundle search on the vocabulary based on the bundle width threshold to obtain the target search result.

[0034] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0035] Based on the current object to be matched and the current bundle width, a bundle search is performed on the vocabulary containing multiple words to obtain the current search results. The current search results include multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current bundle width.

[0036] Based on the bundle width decay method matched by the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search.

[0037] Each target word is used as the matching object for the next bundle search. The bundle search is performed iteratively on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0038] The search results obtained when the bundle width obtained by attenuation is equal to the bundle width threshold are taken as the target objects to be matched, and the vocabulary is subjected to bundle search based on the bundle width threshold to obtain the target search results.

[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0040] Based on the current object to be matched and the current bundle width, a bundle search is performed on the vocabulary containing multiple words to obtain the current search results. The current search results include multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current bundle width.

[0041] Based on the bundle width decay method matched by the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search.

[0042] Each target word is used as the matching object for the next bundle search. The bundle search is performed iteratively on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0043] The search results obtained when the bundle width obtained by attenuation is equal to the bundle width threshold are taken as the target objects to be matched, and the vocabulary is subjected to bundle search based on the bundle width threshold to obtain the target search results.

[0044] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0045] Based on the current object to be matched and the current bundle width, a bundle search is performed on the vocabulary containing multiple words to obtain the current search results. The current search results include multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current bundle width.

[0046] Based on the bundle width decay method matched by the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search.

[0047] Each target word is used as the matching object for the next bundle search. The bundle search is performed iteratively on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0048] The search results obtained when the bundle width obtained by attenuation is equal to the bundle width threshold are taken as the target objects to be matched, and the vocabulary is subjected to bundle search based on the bundle width threshold to obtain the target search results.

[0049] The aforementioned bundle search processing method, apparatus, computer equipment, storage medium, and computer program product perform a bundle search based on the current target object and the current bundle width to obtain the current search results. The current search results include multiple target words that successfully match the current target object and whose number matches the current bundle width. Then, according to the bundle width decay method matching the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search. Each target word is used as the target object for the next bundle search, and the bundle search is iteratively performed on the word list until the decayed bundle width equals the bundle width threshold. The search results at this point are then used as the target target object, and a bundle search is performed again based on the bundle width threshold to obtain the target search results. Throughout the process, in scenarios with extremely long sequences, the initial bundle width of the bundle search can be configured to a larger value to ensure that the initial search space is large enough. This avoids getting trapped in local optima due to a small search space, thus ensuring search performance. Subsequently, the bundle width can be gradually reduced according to the corresponding bundle width decay method, thereby gradually reducing the search space. This suppresses the negative impact of a large initial search space on search efficiency and improves search efficiency. In this way, in scenarios with extremely long sequences, search performance can be improved while simultaneously improving search efficiency. Attached Figure Description

[0050] Figure 1 is a flowchart illustrating a cluster search processing method in one embodiment;

[0051] Figure 2 is a flowchart illustrating the process of obtaining multiple unfiltered words based on a preset number of matchable words in one embodiment.

[0052] Figure 3 is a schematic diagram of the process of attenuating the bundle width according to the bundle width attenuation value "1" in one embodiment;

[0053] Figure 4 is a schematic diagram of the process of attenuating the bundle width by combining the bundle width attenuation value "1" and the bundle width attenuation coefficient "0.5" in one embodiment;

[0054] Figure 5 is a flowchart illustrating the bundle search processing method in another embodiment;

[0055] Figure 6 is a structural block diagram of a cluster search processing device in one embodiment;

[0056] Figure 7 is an internal structure diagram of a computer device in one embodiment. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0058] In one embodiment, as shown in Figure 1, a beam search processing method is provided. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0059] Step 102: Based on the current object to be matched and the current bundle width, perform a bundle search on the vocabulary containing multiple words to obtain the current search results. The current search results include multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current bundle width.

[0060] Beam Search generates multiple search results per iteration, but only retains a subset of the best results. The number of retained results is consistent with the beam width of that particular beam search. The beam width, a numerical value, represents the size of the search space. A larger search space results in more retained results, improving subsequent search performance; conversely, a smaller search space results in fewer retained results, reducing subsequent search efficiency.

[0061] Beam search can be applied to fields such as text generation, machine translation, and speech recognition. In text generation and machine translation, a vocabulary can store various text fragments, phrases, and characters. These stored text fragments, phrases, and characters can be used as "words" and matched against the input (the object to be matched) of the beam search. In speech recognition, a vocabulary can store various speech fragments, which can also be used as "words" and matched against the input of the beam search.

[0062] Optionally, the server can perform a bundle search on a vocabulary containing multiple words based on the current object to be matched and the current bundle width, obtain multiple words that match the current object to be matched from the vocabulary, and then select a portion of the obtained words as target words, that is, retain a portion of the search results and use the retained target words as the current search results.

[0063] For example, when the server performs an initial beam search on the vocabulary, it can set the beam width of the initial beam search to a large value. This means that after the initial beam search, a larger number of words are retained as the initial search results. Since subsequent beam searches use the words retained from the previous beam search as input for the next beam search, retaining a large number of words in the initial search results ensures that subsequent beam searches are conducted within a larger search space, thus guaranteeing search effectiveness and potentially leading to a globally optimal solution.

[0064] Step 104: Based on the bundle width attenuation method matched by the number of bundle searches already performed, attenuate the current bundle width to obtain the bundle width for the next bundle search.

[0065] Specifically, the bundle width attenuation method can be a method of reducing the bundle width corresponding to the bundle search, or a method of reducing the search space corresponding to the bundle search, which can be configured according to the actual application scenario. The bundle width attenuation method includes, but is not limited to: controlling the bundle width to attenuate by a fixed value, or multiplying the bundle width by a coefficient less than 1 to achieve the effect of attenuating the bundle width.

[0066] Optionally, the server can pre-configure the matching relationship between the number of bundle searches performed and the bundle width attenuation method, so that the bundle width attenuation method can be determined for each bundle search based on the number of bundle searches performed, and the current bundle width can be attenuated according to the determined bundle width attenuation method to obtain the bundle width for the next bundle search.

[0067] Step 106: Take each target word as the object to be matched in the next bundle search, and iteratively perform bundle search on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0068] The bundle width threshold is the minimum bundle width, which can be specifically defined as the minimum number of words retained during the bundle search process. In other words, after performing a bundle search on the vocabulary, the number of retained words must be greater than or equal to the bundle width threshold. The bundle width threshold can be configured according to the actual application scenario.

[0069] Optionally, the server can use each target word as the object to be matched in the next bundle search, and iteratively use the search results of the previous bundle search as the input for the next bundle search to perform bundle searches on the word list. During this iteration, when performing a bundle search on the word list each time, the above process of selecting the appropriate bundle width decay method based on the number of bundle searches already performed is synchronized to decay the bundle width until the decayed bundle width is equal to the bundle width threshold.

[0070] Step 108: The search results when the bundle width obtained by attenuation is equal to the bundle width threshold are taken as the target matching objects, and the vocabulary is subjected to bundle search based on the bundle width threshold to obtain the target search results.

[0071] Specifically, the number of search results when the bundle width obtained from the attenuation equals the bundle width threshold, and the number of words retained in the target search results, are both consistent with the bundle width threshold. In this embodiment, since the bundle width of the initial bundle search is a large value, when the bundle width attenuates from a large value to be equal to the bundle width threshold, it can indicate that the entire bundle search process has undergone multiple iterations, and it can also indicate that the subsequent bundle search results have approached the global optimum.

[0072] Optionally, the server can obtain the search results when the bundle width obtained by attenuation is equal to the bundle width threshold in the following way: When the bundle width obtained by attenuation is equal to the bundle width threshold, the server can perform a bundle search on the word list based on the object to be matched at this time, obtain multiple unfiltered words, and filter out multiple words from the multiple unfiltered words with a number consistent with the bundle width threshold according to the bundle width threshold, that is, retain some search results, and use the filtered multiple words as the search results when the bundle width obtained by attenuation is equal to the bundle width threshold.

[0073] Furthermore, based on the search results when the bundle width obtained from attenuation equals the bundle width threshold, the server can perform a bundle search on the vocabulary again based on the bundle width threshold, retaining multiple words with the same number as the bundle width threshold, and obtaining the target search results.

[0074] In the above-described bundle search processing method, the bundle search processing method, apparatus, computer equipment, storage medium, and computer program product perform a bundle search based on the current target object and the current bundle width to obtain the current search result. The current search result includes multiple target words that successfully match the current target object and whose number matches the current bundle width. Then, according to the bundle width decay method matching the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search. Each target word is used as the target object for the next bundle search, and the bundle search is iteratively performed on the word list until the decayed bundle width equals the bundle width threshold. The search result at this point is used as the target target object, and a bundle search is performed again based on the bundle width threshold to obtain the target search result. Throughout the process, in scenarios with extremely long sequences, the initial bundle width of the bundle search can be configured to a larger value to ensure that the initial search space is large enough. This avoids getting trapped in local optima due to a small search space, thus ensuring search performance. Subsequently, the bundle width can be gradually reduced according to the corresponding bundle width decay method, thereby gradually reducing the search space. This suppresses the negative impact of a large initial search space on search efficiency and improves search efficiency. In this way, in scenarios with extremely long sequences, search performance can be improved while simultaneously improving search efficiency.

[0075] In one embodiment, based on the current object to be matched and the current bundle width, a bundle search is performed on a vocabulary containing multiple words to obtain the current search results, including:

[0076] Based on the current object to be matched, multiple unfiltered words that successfully match the current object are obtained from the vocabulary through cluster search. Each unfiltered word has its own corresponding probability value.

[0077] Sort the probability values ​​of each of the multiple unfiltered words to obtain the probability value sorting result;

[0078] Based on the number of target words matching the current bundle width and the probability values, multiple target words are selected from the unfiltered words as the current search results.

[0079] The higher the probability value of an unfiltered term, the closer it is to the desired search result, and thus the better the search result.

[0080] Optionally, the server can match the current object to be matched with words stored in the word list, obtain multiple unfiltered words that successfully match the current object from the word list, obtain the probability value of each of the multiple unfiltered words, sort the probability values ​​of the multiple unfiltered words to obtain the probability value sorting result, and select multiple target words as the current search results in descending order of probability value according to the number of target words that match the current bundle width and the probability value sorting result. That is, a portion of the unfiltered words are retained, and the number of retained unfiltered words is the same as the number of target words. The selected multiple target words are used as the current search results.

[0081] In this embodiment, for each bundle search, the number of words to be retained in that bundle search is determined based on the bundle width corresponding to that bundle search. Since the bundle width in this embodiment gradually decreases, as the vocabulary is iterated through bundle searches, the number of words retained in each subsequent bundle search will gradually decrease, thereby gradually reducing the search space and improving the search efficiency of the bundle search.

[0082] In one embodiment, the number of objects to be matched is at least one;

[0083] Based on the current target object, multiple unfiltered words that successfully match the current target object are obtained from the vocabulary through bundle search, including:

[0084] Get the number of words that can be matched for the current object to be matched when performing a cluster search;

[0085] Based on the number of matchable words, multiple unfiltered words that successfully match the current target object are obtained from the vocabulary through cluster search. The number of unfiltered words corresponding to each current target object is consistent with the number of matchable words.

[0086] The number of matchable words is a fixed value. When performing a cluster search, all objects to be matched have the same number of matchable words. This can be configured in advance according to the actual application scenario.

[0087] Optionally, before performing the initial bundle search on the vocabulary, the server can pre-configure the number of matchable words for all objects to be matched. For each current object to be matched, during the bundle search, multiple unfiltered words that successfully match the current object to be matched can be obtained from the vocabulary based on the number of matchable words.

[0088] For example, taking the current objects to be matched as A and B, and the number of matchable words as 4, as shown in Figure 2, a flowchart is provided to obtain multiple unfiltered words based on a preset number of matchable words. The main process includes the following: The server can obtain multiple unfiltered words A1, A2, A3, and A4 from the word list based on the object to be matched A, and can also obtain multiple unfiltered words B1, B2, B3, and B4 from the word list based on the object to be matched B, and the number of unfiltered words B1, B2, B3, and B4 corresponding to the current cluster search are A1, A2, A3, A4, B1, B2, B3, and B4.

[0089] In this embodiment, by configuring the number of matchable words, it is ensured that the number of unfiltered words corresponding to each object to be matched is consistent with the number of matchable words each time a cluster search is performed. This ensures that the influence of each object to be matched on the cluster search is balanced, and avoids affecting the search results due to the inconsistent number of unfiltered words corresponding to each object to be matched.

[0090] In one embodiment, multiple target words are selected as the current search results from the unfiltered words according to the number of target words matching the current bundle width and the probability value sorting results, including:

[0091] When the current bundle width is greater than or equal to the bundle width threshold, the current bundle width is determined as the number of target words. Based on the probability value sorting results, multiple target words with the same number as the determined number of target words are selected from multiple unfiltered words, and these multiple target words are used as the current search results.

[0092] When the current bundle width is less than the bundle width threshold, the bundle width threshold is used as the current bundle width and determined as the number of target words. Based on the probability value sorting results, multiple target words with the same number as the determined number of target words are selected from multiple unfiltered words, and these multiple target words are used as the current search results.

[0093] Optionally, when the current bundle width is greater than or equal to the bundle width threshold, the server can determine the current bundle width as the number of target words, and based on the probability value sorting results, select multiple target words from multiple unfiltered words that have the highest probability value and whose number matches the determined number of target words, and use these multiple target words as the current search results; when the current bundle width is less than the bundle width threshold, the server can use the bundle width threshold as the current bundle width and determine it as the number of target words, that is, the number of target words at this time matches the bundle width threshold, and then based on the probability value sorting results, select multiple target words from multiple unfiltered words that have the highest probability value and whose number matches the determined number of target words, and use these multiple target words as the current search results.

[0094] In this embodiment, when the current bundle width is not less than the bundle width threshold, the number of words to be retained is determined based on the current bundle width. When the current bundle width is less than the bundle width threshold, the number of words to be retained is determined based on the bundle width threshold, ensuring that the number of words to be retained is not less than the bundle width threshold.

[0095] In one embodiment, the current bundle width is attenuated according to the bundle width attenuation method matched by the number of bundle searches already performed, to obtain the bundle width for the next bundle search, including:

[0096] When the number of bundle searches performed is less than the bundle search count threshold, obtain the bundle width decay value;

[0097] Based on the bundle width attenuation value, the current bundle width is attenuated once to obtain the bundle width for the next bundle search.

[0098] The beamwidth attenuation value is a positive integer and can be configured according to the actual application scenario. The threshold for the number of beam searches can also be configured according to the actual application scenario.

[0099] Optionally, during the bundle search of the vocabulary, the server counts the number of bundle searches performed each time a bundle search is performed. When the number of bundle searches performed is less than the bundle search threshold, the server can perform a width decay on the current bundle width based on the bundle width decay value, and subtract the bundle width decay value from the current bundle width to obtain the bundle width for the next bundle search.

[0100] For example, taking the target object for the initial bundle search as "s", the number of matching words as "4", the bundle width of the initial bundle search as "4" (in this application, to ensure search effect, in the case of ultra-long sequences, the initial bundle width will be configured to a larger value. The configuration of the initial bundle width in this embodiment is only for illustrative purposes and does not limit the configuration of the initial bundle width), the bundle search number threshold as "3", the bundle width decay value as "1", and the bundle width threshold as "2" as an example, as shown in Figure 3, a flowchart is provided to attenuate the bundle width according to the bundle width decay value. The main process includes:

[0101] During the initial cluster search, the server can first obtain multiple unfiltered words a1, a2, a3, and a4 from the vocabulary based on the object to be matched s. Since the cluster width "4" of the initial cluster search is greater than the cluster width threshold "2", the obtained unfiltered words a1, a2, a3, and a4 are all retained and used as the objects to be matched in the next cluster search. At the same time, the number of cluster searches that have been performed is counted.

[0102] During the second bundle search, the server can use bundle search to obtain the corresponding unfiltered words for each of the objects to be matched, a1, a2, a3, and a4, from the vocabulary. It also counts the number of bundle searches performed. Since the number of bundle searches performed is "2", which is less than the bundle search threshold "3", the bundle width "4" from the first bundle search is attenuated by a bundle width attenuation value of "1", resulting in a attenuated bundle width "3". Furthermore, because the attenuated bundle width "3" is greater than the bundle width threshold, the server can use the attenuated bundle width "3" and the unfiltered words b1 to b4 as a basis for further analysis. 16 Their respective probability values, from b1 to b 16 The three target words b2, b5, and b8 with the highest probability values ​​were selected and used as the matching objects for the third cluster search.

[0103] In this embodiment, when the number of times the cluster search has been performed is less than the threshold number of times the cluster search has been performed, the initial cluster width can be gradually reduced according to a fixed cluster width attenuation value, rather than being reduced abruptly (a sudden reduction of the cluster space will affect the search effect). This can further improve the search efficiency while ensuring the cluster search effect.

[0104] In one embodiment, the current bundle width is attenuated according to the bundle width attenuation method matched by the number of bundle searches already performed, to obtain the bundle width for the next bundle search, including:

[0105] When the number of bundle searches performed is equal to the bundle search threshold, the number of bundle searches performed is reset to zero, and the bundle width attenuation coefficient is obtained.

[0106] Multiply the bundle width attenuation coefficient by the current bundle width, and use the result of the multiplication as the bundle width for the next bundle search.

[0107] The method further includes:

[0108] When performing the next bundle search, the number of bundle searches already performed is recounted.

[0109] The bundle width attenuation coefficient is a decimal less than 1 and can be configured according to the actual application scenario.

[0110] Optionally, during the beam search of the vocabulary, the server counts the number of beam searches performed each time a beam search is performed. When the number of beam searches performed equals the beam search threshold, the server can reset the number of beam searches performed to zero, obtain the beam width decay coefficient, multiply the beam width decay coefficient by the current beam width to perform gradient decay on the current beam width, use the result of the multiplication as the beam width for the next beam search, and recount the number of beam searches performed in the next beam search.

[0111] For example, taking the target object for the initial bundle search as "s", the number of matching words as "5", the bundle width of the initial bundle search as "5" (this initial bundle width configuration is only for illustrative purposes and does not limit the configuration of the initial bundle width), the bundle search count threshold as "3", the bundle width attenuation value as "1", the bundle width attenuation coefficient as "0.5", and the bundle width threshold as "2" as an example, as shown in Figure 4, a flowchart is provided to attenuate the bundle width by combining the bundle width attenuation value and the bundle width attenuation coefficient. The main process includes:

[0112] During the initial cluster search, the server can first obtain multiple unfiltered words a1, a2, a3, a4, and a5 from the vocabulary based on the object to be matched s, with the number of words matching being the same. Since the cluster width of the initial cluster search is "5", the obtained unfiltered words a1, a2, a3, a4, and a5 are all used as the objects to be matched in the next cluster search, and the number of cluster searches already performed is counted.

[0113] During the second bundle search, the server can obtain the corresponding unfiltered words for each of the objects to be matched (a1, a2, a3, a4, a5) from the vocabulary. Since the number of bundle searches performed ("2") is less than the bundle search threshold ("3"), the server will reduce the bundle width ("5") of the first bundle search by a bundle width attenuation value ("1"), resulting in a reduced bundle width ("4"). Furthermore, because the reduced bundle width ("4") is greater than the bundle width threshold, the server can use the reduced bundle width ("4") and the unfiltered words b1 to b5 as a basis for matching. 25 Their respective probability values, from b1 to b 25 The four target words with the highest probability values ​​were selected from the list: b2, b6, b9, and b. 18 and b2, b6, b9, b 18 As the target to be matched in the third cluster search.

[0114] During the third cluster search, the server can determine the matching objects b2, b6, b9, b 18 Unselected words c1 to c2 were obtained from the vocabulary list. 20 Since the number of bundle searches performed is "3", which equals the bundle search threshold of "3", the server will attenuate the bundle width of the second bundle search by a bundle width attenuation coefficient of "0.5". Because the attenuated bundle width is "2", the bundle width threshold of "2" will be used as the bundle width for the third bundle search, without filtering words c1 to c. 20 The two target words c4 and c8 with the highest probability values ​​were selected and used as the matching objects for the fourth cluster search.

[0115] During the fourth bundle search, since the bundle width and bundle width threshold were equal during the three bundle searches (i.e., c4 and c8 are search results where the bundle width equals the bundle width threshold), the server can use c4 and c8 as target objects to be matched. Based on the bundle width threshold, it performs another bundle search on the word list, obtaining multiple unfiltered words d1 to d2. 10 And never selected words d1~d 10 The two target words d4 and d5 with the highest probability values ​​are selected from the cluster search. Then, the cluster search is stopped, and the target search results are output as: s→a1→b2→c4→d4 and s→a2→b6→c8→d5.

[0116] Optionally, assuming the remaining conditions are the same as those in Figure 4, but the number of matching words is "4" and the initial bundle width is "4", then in the first and second bundle searches, the bundle width is attenuated according to the bundle width attenuation value. In the third bundle search, since the attenuated bundle width "1.5" is less than the bundle width threshold "2", "2" words are selected to be retained as target words, and the target words retained at this time are used as the matching objects for the next bundle search. Based on the bundle width threshold, the word list is bundle searched again to obtain the target search results.

[0117] Optionally, in scenarios with extremely long sequences, the initial bundle width can be attenuated a certain number of times according to a fixed bundle width attenuation value to avoid a sudden reduction in the bundle space size, which could affect the search performance. When the number of bundle searches already performed equals the bundle search count threshold, the bundle width is attenuated once according to the bundle width attenuation coefficient to accelerate the reduction of the bundle space, further improving search efficiency. The number of bundle searches already performed is then reset to zero. In the next bundle search, the number of bundle searches already performed is recounted, and the process of attenuating the bundle width by combining the bundle width attenuation value and the bundle width attenuation coefficient is repeated until the attenuated bundle width equals the bundle width threshold.

[0118] In this embodiment, the bundle width is reduced by combining the gradual attenuation strategy (attenuating according to the bundle search attenuation value) and the gradient attenuation strategy (attenuating in a gradient manner according to the bundle search attenuation coefficient). This can gradually reduce the search space while ensuring the search effect (while still configuring the initial bundle width to a large value), thus effectively improving the search efficiency.

[0119] In one embodiment, as shown in Figure 5, a flowchart of another beam search processing method is provided, which specifically includes the following steps:

[0120] Step 502: Obtain the number of words that can be matched for the current object to be matched when performing a cluster search. Based on the number of words that can be matched, obtain multiple unfiltered words that successfully match the current object to be matched from the word list through a cluster search. The number of unfiltered words corresponding to each current object to be matched is consistent with the number of words that can be matched, and each unfiltered word has its own corresponding probability value.

[0121] Step 504: Sort the probability values ​​of the multiple unfiltered words to obtain the probability value sorting result;

[0122] Step 506: When the current bundle width is greater than or equal to the bundle width threshold, the current bundle width is determined as the number of target words. Based on the probability value sorting result, multiple target words with the same number as the determined number of target words are selected from multiple unfiltered words, and the multiple target words are used as the current search results.

[0123] Step 508: When the current bundle width is less than the bundle width threshold, the bundle width threshold is used as the current bundle width and determined as the number of target words. Based on the probability value sorting result, multiple target words with the same number as the determined number of target words are selected from multiple unfiltered words, and the multiple target words are used as the current search results.

[0124] Step 510: When the number of bundle searches performed is less than the bundle search count threshold, obtain the bundle width decay value, and perform a width decay on the current bundle width based on the bundle width decay value to obtain the bundle width for the next bundle search.

[0125] Step 512: When the number of bundle searches performed is equal to the bundle search threshold, the number of bundle searches performed is cleared to zero, the bundle width attenuation coefficient is obtained, the bundle width attenuation coefficient is multiplied by the current bundle width, and the result of the multiplication is used as the bundle width for the next bundle search. When performing the next bundle search, the number of bundle searches performed is counted again.

[0126] Step 514: Take each target word as the matching object for the next bundle search, and iteratively perform bundle search on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0127] Step 516: The search results when the bundle width obtained by attenuation is equal to the bundle width threshold are taken as the target matching objects, and the vocabulary is subjected to bundle search based on the bundle width threshold to obtain the target search results.

[0128] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0129] Based on the same inventive concept, this application also provides a beam search processing apparatus for implementing the beam search processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more beam search processing apparatus embodiments provided below can be found in the limitations of the beam search processing method described above, and will not be repeated here.

[0130] In one embodiment, as shown in FIG6, a cluster search processing device is provided, including: a current search result acquisition module 602, a cluster width attenuation module 604, a cluster search iteration module 606, and a target search result acquisition module 608, wherein:

[0131] The current search result acquisition module is used to perform a beam search on a vocabulary containing multiple words based on the current object to be matched and the current beam width to obtain the current search result. The current search result includes multiple target words in the vocabulary that successfully match the current object to be matched, and the number of target words matches the current beam width.

[0132] The bundle width attenuation module is used to attenuate the current bundle width according to the bundle width attenuation method matched by the number of bundle searches already performed, so as to obtain the bundle width for the next bundle search.

[0133] The bundle search iteration module is used to take each target word as the matching object for the next bundle search, and iteratively perform bundle search on the word list until the bundle width obtained by decay is equal to the bundle width threshold.

[0134] The target search result acquisition module is used to take the search results when the bundle width obtained by attenuation is equal to the bundle width threshold as the target matching object, and perform a bundle search on the vocabulary based on the bundle width threshold to obtain the target search result.

[0135] In the aforementioned bundle search processing apparatus, the bundle search processing method, apparatus, computer equipment, storage medium, and computer program product perform a bundle search based on the current target object and the current bundle width to obtain the current search result. The current search result includes multiple target words that successfully match the current target object and whose number matches the current bundle width. Then, according to the bundle width decay method matched with the number of bundle searches already performed, the current bundle width is decayed to obtain the bundle width for the next bundle search. Each target word is used as the target object for the next bundle search, and the bundle search is iteratively performed on the word list until the bundle width obtained by decay equals the bundle width threshold. The search result at this time is used as the target target object, and a bundle search is performed again based on the bundle width threshold to obtain the target search result. Throughout the process, in scenarios with extremely long sequences, the initial bundle width of the bundle search can be configured to a larger value to ensure that the initial search space is large enough. This avoids getting trapped in local optima due to a small search space, thus ensuring search performance. Subsequently, the bundle width can be gradually reduced according to the corresponding bundle width decay method, thereby gradually reducing the search space. This suppresses the negative impact of a large initial search space on search efficiency and improves search efficiency. In this way, in scenarios with extremely long sequences, search performance can be improved while simultaneously improving search efficiency.

[0136] In one embodiment, the current search result acquisition module is further configured to obtain multiple unfiltered words that successfully match the current object to be matched from the word list through a bundle search based on the current object to be matched. Each unfiltered word has its own corresponding probability value. The probability values ​​of the multiple unfiltered words are sorted to obtain the probability value sorting result. Then, according to the number of target words that match the current bundle width and the probability value sorting result, multiple target words are selected from the unfiltered words as the current search results.

[0137] In one embodiment, the cluster search processing device further includes an unfiltered word acquisition module. The unfiltered word acquisition module is used to acquire the number of matchable words of the current object to be matched when performing a cluster search, and then, based on the number of matchable words, to obtain multiple unfiltered words that successfully match the current object to be matched from the word list through cluster search. The number of unfiltered words corresponding to each current object to be matched is consistent with the number of matchable words.

[0138] In one embodiment, the cluster search processing device further includes a target word filtering module. The target word filtering module is used to: when the current cluster width is greater than or equal to a cluster width threshold, determine the current cluster width as the number of target words, and based on the probability value sorting result, filter out multiple target words from multiple unfiltered words whose number matches the determined number of target words, and use these multiple target words as the current search results; when the current cluster width is less than a cluster width threshold, use the cluster width threshold as the current cluster width and determine it as the number of target words, and based on the probability value sorting result, filter out multiple target words from multiple unfiltered words whose number matches the determined number of target words, and use these multiple target words as the current search results.

[0139] In one embodiment, the bundle width attenuation module is further configured to obtain a bundle width attenuation value when the number of bundle searches performed is less than the bundle search count threshold, and perform a width attenuation on the current bundle width based on the bundle width attenuation value to obtain the bundle width for the next bundle search.

[0140] In one embodiment, the bundle width attenuation module is further configured to: clear the number of bundle searches already performed to zero when the number of bundle searches already performed is equal to the bundle search count threshold; obtain the bundle width attenuation coefficient; multiply the bundle width attenuation coefficient by the current bundle width; use the result of the multiplication as the bundle width for the next bundle search; and recount the number of bundle searches already performed when performing the next bundle search.

[0141] Each module in the aforementioned cluster search processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0142] In one embodiment, a computer device, which may be a server, is provided, and its internal structure is shown in Figure 7. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores beam search processing data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a beam search processing method.

[0143] Those skilled in the art will understand that the structure shown in Figure 7 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0144] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0145] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0146] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0148] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0150] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A cluster search processing method, characterized in that, The method includes: performing a beam search on a vocabulary containing multiple words based on the current target object and the current beam width to obtain a current search result, wherein the current search result includes multiple target words in the vocabulary that successfully match the current target object, and the number of target words matches the current beam width; reducing the current beam width according to a beam width decay method matched by the number of beam searches performed to obtain the beam width for the next beam search; using each target word as the target object for the next beam search, iteratively performing a beam search on the vocabulary until the beam width obtained by the decay equals a beam width threshold; using the search result where the beam width obtained by the decay equals the beam width threshold as the target target object, and performing a beam search on the vocabulary based on the beam width threshold. The process involves performing a bundle search to obtain the target search result. The step of attenuating the current bundle width according to the bundle width attenuation method matched to the number of bundle searches performed to obtain the bundle width for the next bundle search includes: when the number of bundle searches performed is less than a bundle search count threshold, obtaining a bundle width attenuation value; performing a width attenuation on the current bundle width based on the bundle width attenuation value to obtain the bundle width for the next bundle search; when the number of bundle searches performed is equal to the bundle search count threshold, resetting the number of bundle searches performed to zero and obtaining a bundle width attenuation coefficient; multiplying the bundle width attenuation coefficient by the current bundle width, using the result as the bundle width for the next bundle search, and recounting the number of bundle searches performed before the next bundle search.

2. The method according to claim 1, characterized in that, The step of performing a beam search on a vocabulary containing multiple words based on the current target object and the current beam width to obtain the current search result includes: obtaining multiple unfiltered words that successfully match the current target object from the vocabulary through beam search, each of which has its own corresponding probability value; sorting the probability values ​​of the multiple unfiltered words to obtain a probability value sorting result; and selecting multiple target words from the unfiltered words as the current search result according to the number of target words that match the current beam width and the probability value sorting result.

3. The method according to claim 2, characterized in that, The number of objects to be matched is at least one; The step of obtaining multiple unfiltered words that successfully match the current target object from the vocabulary through a cluster search based on the current target object includes: obtaining the number of words that can be matched by the current target object when performing a cluster search; Based on the number of matchable words, multiple unfiltered words that successfully match the current target object are obtained from the word list through cluster search, and the number of unfiltered words corresponding to each current target object is consistent with the number of matchable words.

4. The method according to claim 2, characterized in that, The step of selecting multiple target words as current search results from the unfiltered words according to the number of target words matching the current bundle width and the probability value sorting result includes: when the current bundle width is greater than or equal to a bundle width threshold, determining the current bundle width as the number of target words, and selecting multiple target words from the multiple unfiltered words whose number matches the determined number of target words according to the probability value sorting result, and selecting the multiple target words as current search results; when the current bundle width is less than a bundle width threshold, determining the bundle width threshold as the current bundle width as the number of target words, and selecting multiple target words from the multiple unfiltered words whose number matches the determined number of target words according to the probability value sorting result, and selecting the multiple target words as current search results.

5. A cluster search processing device, characterized in that, The device includes: a current search result acquisition module, configured to perform a bundle search on a vocabulary containing multiple words based on the current target object and the current bundle width, to obtain a current search result, wherein the current search result includes multiple target words in the vocabulary that successfully match the current target object, and the number of target words matches the current bundle width; a bundle width attenuation module, configured to attenuate the current bundle width according to a bundle width attenuation method matched by the number of bundle searches performed, to obtain the bundle width for the next bundle search; a bundle search iteration module, configured to iteratively perform a bundle search on the vocabulary using each target word as the target object for the next bundle search, until the bundle width obtained by attenuation equals a bundle width threshold; and a target search result acquisition module, configured to obtain a target search result when the bundle width obtained by attenuation equals the bundle width. The search results at the specified threshold are used as the target matching objects, and a bundle search is performed on the vocabulary based on the bundle width threshold to obtain the target search results. The bundle width attenuation module is further configured to: obtain a bundle width attenuation value when the number of bundle searches performed is less than the bundle search count threshold; perform a width attenuation on the current bundle width based on the bundle width attenuation value to obtain the bundle width for the next bundle search; and reset the number of bundle searches performed to zero and obtain a bundle width attenuation coefficient when the number of bundle searches performed equals the bundle search count threshold; multiply the bundle width attenuation coefficient by the current bundle width, use the result as the bundle width for the next bundle search, and recount the number of bundle searches performed before performing the next bundle search.

6. The apparatus according to claim 5, characterized in that, The current search result acquisition module is also used to obtain multiple unfiltered words that successfully match the current object to be matched from the word list through bundle search based on the current object to be matched. Each unfiltered word has its own corresponding probability value. The probability values ​​of the multiple unfiltered words are sorted to obtain the probability value sorting result. Then, according to the number of target words that match the current bundle width and the probability value sorting result, multiple target words are selected from the unfiltered words as the current search results.

7. The apparatus according to claim 6, characterized in that, The cluster search processing device also includes an unfiltered word acquisition module. The unfiltered word acquisition module is used to obtain the number of matchable words for the current object to be matched when performing a cluster search. Then, based on the number of matchable words, it obtains multiple unfiltered words that successfully match the current object to be matched from the word list through cluster search. The number of unfiltered words corresponding to each current object to be matched is consistent with the number of matchable words.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data search method and device and computer storage medium

    CN110674387A

  • Improved cluster search strategy and question-answering system

    CN110851673A