Search association method and device, electronic equipment and storage medium

By calculating the word frequency and association probability of key phrases, the problems of inaccurate extraction of key phrases and complex knowledge graph query in the knowledge base search in the site are solved, and the user search efficiency and response speed are improved.

CN119066145APending Publication Date: 2024-12-03GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310647198.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-01
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the existing knowledge base search on the site, the extraction of key phrases is inaccurate, resulting in low user search efficiency and complex knowledge graph association relationship query, which cannot respond quickly.

Method used

By obtaining the key phrase table and training corpus, calculate the word frequency and common word frequency of each key phrase, determine the association probability between any two key phrases, assist users in inputting fewer search keywords, and improve search efficiency.

Benefits of technology

It realizes fast-responsive search results, improves user search efficiency, and reduces computing resources and manpower investment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066145A_ABST
    Figure CN119066145A_ABST
Patent Text Reader

Abstract

The invention relates to a search association method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a key phrase table and a training corpus; wherein the key phrase table comprises a plurality of key phrases; obtaining a first word frequency number of each key phrase appearing in the training corpus and a second word frequency number of any two key phrases appearing in the training corpus together; determining an association probability between any two key phrases according to the first word frequency number and the second word frequency number; wherein the association probability is used for indicating the probability of associating another key phrase when one key phrase is searched; and obtaining a search key phrase, and displaying a search association result according to the search key phrase and the association probability. According to the method, the association probability of any two key phrases in the key phrase table is determined, so that the user is assisted to input fewer search key phrases during search, desired search contents can be obtained more quickly and better, and the search efficiency of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of search engines, and in particular to a search association method, device, electronic equipment and storage medium. Background Art

[0002] In recent years, search engines have been one of the most popular technical directions. Among them, in-site knowledge base search is a very important branch. In-site knowledge base search refers to the aggregation of multi-dimensional knowledge documents to form a complete and unified knowledge base system, which facilitates users to conduct fast and real-time searches to obtain knowledge information. When using in-site knowledge base search, users tend to use less input to complete a search.

[0003] In the related art, when extracting key phrases from multi-dimensional knowledge documents, some unimportant short sentence fragments are extracted, while the truly important key phrases are ignored. After obtaining the key phrases, using the knowledge graph to construct the associative relationship between the key phrases requires a lot of computing resources and manpower, and the associative relationship query of the knowledge graph is relatively complex and cannot be responded quickly, resulting in low user search efficiency. Summary of the invention

[0004] Based on this, the purpose of the present disclosure is to provide a search association method, device, electronic device and storage medium, which have the advantage of improving user search efficiency.

[0005] According to a first aspect of an embodiment of the present disclosure, a search association method is provided, comprising the following steps:

[0006] Obtain a key phrase table and training corpus; wherein the key phrase table includes a plurality of key phrases;

[0007] Get the first word frequency of each key phrase in the training corpus and the second word frequency of any two key phrases appearing together in the training corpus;

[0008] Determine the association probability between any two key phrases according to the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating another key phrase when searching for one key phrase;

[0009] Get the search key phrase, and display the search association results based on the search key phrase and association probability.

[0010] According to a second aspect of an embodiment of the present disclosure, a search association device is provided, including:

[0011] A corpus acquisition module is used to acquire a key phrase table and training corpus; wherein the key phrase table includes a number of key phrases;

[0012] A word frequency acquisition module is used to acquire the first word frequency of each key phrase appearing in the training corpus and the second word frequency of any two key phrases appearing together in the training corpus;

[0013] An association probability determination module, used to determine the association probability between any two key phrases according to the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating another key phrase when searching for one key phrase;

[0014] The association result display module is used to obtain the search key phrase and display the search association result according to the search key phrase and the association probability.

[0015] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing any one of the search association methods described above.

[0016] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the search association method as described above is implemented.

[0017] The embodiment of the present disclosure obtains a key phrase table and a training corpus; wherein the key phrase table includes a plurality of key phrases; obtains the first word frequency of each key phrase appearing in the training corpus and the second word frequency of any two key phrases appearing together in the training corpus; determines the association probability between any two key phrases based on the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating with another key phrase when searching for a key phrase; obtains the search key phrase, and displays the search association result based on the search key phrase and the association probability. The present disclosure assists the user in entering fewer search key phrases when searching by determining the association probability of any two key phrases in the key phrase table, so as to obtain the desired search content faster and better, thereby improving the user's search efficiency.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

[0019] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A flowchart of a search association method provided in the first embodiment of the present disclosure;

[0021] Figure 2 A schematic diagram of the flow of step S30 in the search association method provided by one embodiment of the present disclosure;

[0022] Figure 3 A schematic flow chart of step S30 in a search association method provided by another embodiment of the present disclosure;

[0023] Figure 4 A schematic diagram of the flow of step S40 in the search association method provided by one embodiment of the present disclosure;

[0024] Figure 5 A flowchart of a search association method provided by another embodiment of the present disclosure;

[0025] Figure 6 A structural block diagram of a search and association device provided in a second embodiment of the present disclosure;

[0026] Figure 7 This is a schematic block diagram of the structure of an electronic device provided in the third embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.

[0028] It should be clear that the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0029] The terms used in the disclosed embodiments are only for the purpose of describing specific embodiments and are not intended to limit the disclosed embodiments. The singular forms of "a", "said" and "the" used in the disclosed embodiments and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0030] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims. In the description of the present disclosure, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present disclosure can be understood according to the specific circumstances.

[0031] In addition, in the description of the present disclosure, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0032] In order to better understand the design solutions of the present disclosure, some search and association methods in the technology are described below.

[0033] In the prior art, when extracting key phrases from natural language text, the TF-IDF bag-of-words model is usually used, which will extract some phrases with high word frequency but not key phrases. After obtaining the key phrases, the knowledge graph is used to construct the associative relationship between the phrases. However, constructing the relationship between the nodes of the knowledge graph is very cumbersome, which requires a lot of computing resources and manpower. In addition, in the in-site search knowledge base, providing user search and association requires high real-time performance. The associative relationship query of the knowledge graph is relatively complex and cannot be responded to quickly, resulting in low user search efficiency.

[0034] To this end, an embodiment of the present disclosure proposes a search association method.

[0035] The search association method provided in the embodiments of the present disclosure may be executed by a search association device, which may be implemented by software and / or hardware, and which may be composed of two or more physical entities or one physical entity.

[0036] The search association device may include one or more processing cores, which may implement the search association method of the present disclosure by pure software or by a combination of software and hardware, such as by at least one hardware form of digital signal processing, field programmable gate array, and programmable logic array; or may integrate one or a combination of several of a central processing unit, an image processor, and a modem. The search association device may run an application program having the search association method, and the application program may be presented in a form adapted to the search association device, such as an APP application program. In some examples, it may also be presented in the form of a system plug-in, a web page plug-in, and the like.

[0037] Example 1

[0038] See also Figure 1 , Figure 1 A flowchart of a search association method provided in the first embodiment of the present disclosure is provided, and the method includes the following steps:

[0039] S10: Obtain a key phrase table and training corpus; wherein the key phrase table includes a plurality of key phrases.

[0040] The key phrase table is a collection of key phrases, and the key phrases are meaningful phrases formed by combining some consecutive keywords. For example, the keywords are "PC, touchless, Android, touch, jump point", and the key phrases are "PC touchless", "touch jump point".

[0041] The training corpus is the corpus obtained by segmenting the original training corpus through the key phrase table. The original training corpus is a natural text language. For example, the original training corpus is "Problem description: S65EB intermittently has a PC no touch failure, Android touch is normal", and the key phrase table includes the key phrases "S65EB, PC no touch, Android touch is normal", then the training corpus is "S65EB PC no touch Android touch is normal", and the three phrases of the training corpus are the key phrases in the key phrase table, separated by spaces.

[0042] S20: Obtain the first word frequency of each key phrase appearing in the training corpus and the second word frequency of any two key phrases appearing together in the training corpus.

[0043] In the disclosed embodiment, a word frequency statistics tool can be used to count the first word frequency of each key phrase in the training corpus and the second word frequency of any two key phrases. Specifically, the word frequency statistics tool includes but is not limited to the word frequency statistics program or code of each natural language processing model tool. For example, the count_ngrams program of the language model tool kenlm.

[0044] S30: determining the association probability between any two key phrases according to the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating another key phrase when searching for one key phrase.

[0045] The association probability refers to the probability that the remaining key phrases in the key phrase table can be associated after the user writes one of the key phrases in the key phrase table in the search input box.

[0046] In the disclosed embodiment, the association probability between any two key phrases can be directly calculated based on the first word frequency and the second word frequency. Specifically, the ratio of the second word frequency to the first word frequency is used as the association probability between any two key phrases. For example, if the second word frequency is 0, it means that the two key phrases have never appeared together in the training corpus, and the association probability is 0. It is also possible to calculate the association probability between any two key phrases based on the first word frequency and the second word frequency, and introduce a Laplace smoothing mechanism. It is also possible to calculate the association probability between any two key phrases based on the first word frequency and the second word frequency, and introduce a mutually exclusive phrase table.

[0047] Specifically, taking the key phrase table including N key phrases as an example, according to the association probability between any two key phrases and the association probability between the key phrases and themselves, a probability matrix M1 of size N*N is constructed. Among them, each element of the matrix is ​​the logarithm of the association probability, and the matrix element corresponding to the key phrase and itself is 0. The specific form is as follows:

[0048]

[0049] Among them, phrase i Indicates the key phrase i, phrase j Indicates the key phrase j, C(phrase i ∩phrase j ) represents the frequency of key phrase i and key phrase j appearing together, C(phrase j ) represents the word frequency of key phrase j.

[0050] S40: Obtain a search keyword phrase, and display a search association result according to the search keyword phrase and the association probability.

[0051] Among them, the search key phrase can be a key phrase written by the user in the search input box, or the user can write a keyword in the search input box, the keyword is the first few words or letters of the key phrase, and in response to the keyword, several key phrases are displayed, and the user selects the search key phrase from several key phrases.

[0052] In the disclosed embodiment, after obtaining the association probability between any two key phrases, the association probability between the search key phrase and the remaining key phrases in the key phrase table can be queried, and a preset number of key phrases with top association probabilities are displayed as search association results.

[0053] Specifically, an N*1 matrix M2 is generated according to the search key phrase entered by the user in the search box. In the unit matrix, only the element corresponding to the search key phrase entered in the search box has a value of 1, and the rest of the values ​​are 0. Dot multiplication of matrix M1 and matrix M2 is performed to obtain an N*1 matrix M3. The e index of each element of matrix M3 is calculated to obtain the final probability matrix M4. The elements in matrix M4 are reordered, and the top K results are selected as the search association results.

[0054] The embodiment of the present disclosure is applied, by obtaining a key phrase table and a training corpus; wherein the key phrase table includes a plurality of key phrases; obtaining the first word frequency of each key phrase appearing in the training corpus and the second word frequency of any two key phrases appearing together in the training corpus; determining the association probability between any two key phrases based on the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating with another key phrase when searching for a key phrase; obtaining the search key phrase, and displaying the search association result based on the search key phrase and the association probability. The present disclosure assists the user in entering fewer search key phrases when searching by determining the association probability of any two key phrases in the key phrase table, so as to obtain the desired search content faster and better, thereby improving the user's search efficiency.

[0055] In an optional embodiment, before step S10, steps S11 to S16 are included, which are specifically as follows:

[0056] S11: Obtain the user's historical search terms and the document title clicked by the user; wherein the document title is the document title displayed according to the user's historical search terms.

[0057] S12: Extract the common words in the user's historical search terms and document titles to obtain an original keyword table.

[0058] In the disclosed embodiment, the user's historical search terms q and a set T of document titles clicked by the user after the search are obtained, and the common words in q and set T are taken as potential keywords. For example, if the user searches for q: "No touch on the PC side of the computer", the clicked document title set T includes: "Computer channel no touch H model", "PC problem troubleshooting guide" and "PC channel no touch common problem handling case" document titles. Traverse T and q to find common words, and the common words are: "PC", "computer", "no touch". These common words are combined with the vocabulary in the after-sales field and the product model table, and manually filtered to obtain the original keyword table. Among them, the vocabulary in the after-sales field includes but is not limited to professional vocabulary such as product failure, product repair and product maintenance.

[0059] S13: Obtaining original training corpus; wherein the original training corpus includes original text corpus at a plurality of sentence levels;

[0060] S14: According to the original keyword table, segment the original text corpus at several sentence levels to obtain text corpus.

[0061] In the disclosed embodiment, after-sales knowledge base document data and historical maintenance work order text data are used as original corpus. Among them, after-sales knowledge base documents include but are not limited to pdf, docx, txt, xlsx and pptx type files, as well as web page type documents. The original corpus is first segmented and then sentence-divided to obtain the original training corpus, which includes several sentence-level original text corpora.

[0062] The original training corpus is segmented using the keywords in the original keyword table to obtain the text corpus. For example, for the sentence "No touch on the PC side, touch jump on the Android side", the original keyword table is used to segment the text corpus: "PC, no touch, Android, touch, jump point".

[0063] S15: A new phrase discovery method based on solidification degree is used to discover new phrases in the text corpus and obtain a key phrase table;

[0064] S16: According to the key phrase table, the original training corpus is segmented to obtain training corpus.

[0065] The principle of the new phrase discovery method based on solidification is to count the word frequency of n-gram, select the words with high solidification in ngram, and then segment the sentence according to ngram. The segmented phrases are used as candidate new words, and then backtracking filtering is used to remove new words with incorrect combinations.

[0066] In the disclosed embodiment, a new phrase discovery method based on solidification is used to discover new phrases in a text corpus, and isolated keywords are continuously merged to obtain key phrases. For example, through the new phrase discovery method, "PC, no touch" in the text corpus can be merged into a meaningful fault phenomenon phrase: "PC no touch", and "Android, touch, jump point" can be merged into another meaningful fault phenomenon phrase: "touch jump point", and a key phrase table can be obtained through iteration and manual filtering.

[0067] Through the original keyword list and the new phrase discovery method based on coagulation degree, the key phrase list and training corpus can be automatically and quickly obtained.

[0068] In an optional embodiment, step S15 includes steps S151 to S157, which are specifically as follows:

[0069] S151: Count the third word frequency of each keyword appearing in the text corpus and the fourth word frequency of each n-gram appearing in the text corpus; wherein n is greater than or equal to 2; and the n-gram is n keywords appearing consecutively.

[0070] The frequency of the third word and the frequency of the fourth word can be counted using a word frequency counting tool. The specific word frequency counting tool is the same as the word frequency counting tool used in step S20, and will not be described here. N-grams include but are not limited to 2grams, 3grams, and 4grams.

[0071] S152: taking the n-gram whose fourth word frequency is greater than or equal to the preset word frequency threshold as the first n-gram.

[0072] The preset word frequency threshold is related to the number of loop iterations. Specifically, the formula for the preset word frequency threshold is as follows:

[0073] count i =20*α i , i∈{0, 1, ..., N-1}

[0074] Where i is the number of loop iterations, N is the total number of loop iterations, and α is a fixed parameter ranging from 0.5 to 1.

[0075] S153: Calculate the solidification degree of each first n-gram according to the third word frequency and the fourth word frequency.

[0076] Among them, the formula for calculating the solidification degree, taking 3gram as an example, is as follows:

[0077]

[0078] Among them, abc represents 3gram, ab and bc represent 2gram, a and c represent 1gram, the probabilities p(ab), p(bc) and P(abc) can be converted into the corresponding third word frequencies, and the probabilities p(a) and p(c) can be converted into the corresponding fourth word frequencies.

[0079] S154: taking the first n-gram whose freezing degree is greater than or equal to the preset freezing degree threshold as a candidate phrase of a first candidate phrase table, and obtaining the first candidate phrase table.

[0080] The preset coagulation degree threshold is related to the value of n.

[0081] In the embodiment of the present disclosure, the preset freezing degree thresholds of 2gram, 3gram, and 4gram may be set to 3, 9, and 27, respectively.

[0082] S155: According to the first candidate phrase list, the text corpus is segmented and the words are merged to obtain a second candidate phrase list.

[0083] In the disclosed embodiment, the first candidate phrase table is used to traverse the text corpus for segmentation and word merging. The merging rule is that as long as there is a sub-segment in the merged segment that appears in the first candidate phrase table, it is merged to obtain the second candidate phrase table. Among them, taking the merged segment as a 3gram as an example, the 3gram form is "abc", including three keywords a, b, c, and the sub-segments of the 3gram include "ab" and "bc". If the sub-segment "ab" or "bc" appears in the first candidate phrase table, the 3gram is merged to obtain a 1gram in the form of "abc". If the sub-segments "ab" or "bc" do not appear in the first candidate phrase table, the 3gram is not merged.

[0084] S156: Perform backtracking filtering on the second candidate phrase list to obtain a third candidate phrase list.

[0085] In the embodiment of the present disclosure, the longest phrase threshold m is defined, m=max_len(ngram). Specifically, ngram is taken as 4gram, m=4. Each phrase in the second candidate phrase table is traversed. If the phrase length is less than 4, it is detected whether the phrase appears in the first candidate phrase table. If so, the phrase is used as a candidate phrase in the third candidate phrase table. If the phrase length is greater than or equal to 4, it is detected whether each sub-segment of the phrase appears in the first candidate phrase table. If so, the phrase is used as a candidate phrase in the third candidate phrase table.

[0086] S157: According to the third candidate phrase table, the word frequency statistics, coagulation degree calculation, segmentation and word merging of the text corpus are performed in a loop iteration until the number of loop iterations meets the preset number of iterations, thereby obtaining a key phrase table.

[0087] In the disclosed embodiment, the above steps S151 to S156 are repeated to obtain a final candidate phrase list, and the final candidate phrase list is manually filtered to obtain a key phrase list.

[0088] By adopting a cyclic fixed-round iteration method, a key phrase table can be automatically and quickly generated.

[0089] In an alternative embodiment, see Figure 2 , step S30, including steps S31 to S33, are as follows:

[0090] S31: summing the first word frequency and the total number of key phrases in the training corpus to obtain a first summation result;

[0091] S32: summing the first word frequency and 1 to obtain a second summation result;

[0092] S33: taking the ratio of the second summation result to the first summation result as the association probability between any two key phrases; or taking the ratio of the second word frequency to the first word frequency as the association probability between any two key phrases.

[0093] In one embodiment of the present disclosure, based on the Naive Bayesian probability calculation formula, the association probability between any two key phrases can be calculated. The Naive Bayesian probability calculation formula is:

[0094]

[0095] Among them, P(A) is fixed. To make P(B|A) larger, we can convert it into P(A|B)*P(B) to make it larger. P(B) can be converted into the word frequency of B C(B), and P(A|B) is calculated according to the conditional probability formula.

[0096] Through the Naive Bayes probability calculation formula, the association probability between any two key phrases can be automatically and quickly determined.

[0097] In another embodiment of the present disclosure, a Laplace smoothing mechanism is introduced when calculating the association probability. The association probability calculation formula is as follows:

[0098]

[0099] Where V represents the total number of key phrases in the training corpus.

[0100] Using Naive Bayes can very realistically reflect the probability distribution of the training corpus, that is, only when there is a certain collocation relationship between key phrases in the training corpus, the model will give a specific probability, otherwise the probability is 0. Because the training corpus cannot cover all the corresponding relationships in the real scene, by introducing the Laplace smoothing mechanism, a small probability is given to some key phrases that do not have a collocation relationship in the training corpus to improve generalization. Assuming that the two key phrases A and B are related in the real scene, and there is no co-occurrence of A and B in the training corpus, after adding the Laplace smoothing mechanism, it is also possible to associate key phrase B after inputting key phrase A.

[0101] In an alternative embodiment, see Figure 3 , step S30, including steps S34 to S35, are as follows:

[0102] S34: clustering a number of key phrases in the key phrase table to obtain clusters;

[0103] S35: Determine mutually exclusive key phrases from the clusters, and set the association probability between any two mutually exclusive key phrases to 0.

[0104] In actual scenarios, mutually exclusive key phrases should not be associated. In the disclosed embodiment, by introducing a mutually exclusive phrase table, the association probability between mutually exclusive key phrases is removed. Specifically, hierarchical clustering is used to find key phrases in the key phrase table that have similar texts but opposite semantics, i.e., mutually exclusive key phrases. For example, the texts of "black screen with backlight" and "black screen without backlight" are similar but have opposite semantics, and the association probability between these mutually exclusive key phrases is set to 0.

[0105] Optionally, use hierarchical clustering to find key phrases with similar text and semantics in the key phrase table, that is, synonymous key phrases. For example, "hdmi input no signal" and "hdmi channel no signal" are synonymous key phrases. These synonymous key phrases are post-processed. The post-processing strategy is: when a key phrase is associated with the key phrase "hdmi input no signal", it is guaranteed that the key phrase "hdmi input no signal" with similar text meaning will not be associated at the same time.

[0106] By introducing a mutually exclusive phrase table, the accuracy of the association probability is improved, thereby improving the accuracy of the search.

[0107] In an optional embodiment, before step S40, steps S41 to S43 are included, which are specifically as follows:

[0108] S41: Generate a prefix tree of the key phrases according to the key phrase table;

[0109] S42: Obtain input keywords, and display several key phrases according to the keywords and the prefix tree;

[0110] S43: In response to selecting any one key phrase from a plurality of key phrases, obtaining a search key phrase.

[0111] In the disclosed embodiment, prefix extraction is performed on each key phrase in the key phrase table to construct a prefix tree with characters as tree nodes. For example, the key phrase table includes "pc automatic shutdown, pc automatic restart, pc automatic black screen", and the prefix "pc automatic" is extracted to construct a tree structure of pc-automatic-shutdown, pc-automatic-restart, and pc-automatic-black-screen, where p is a tree node, c is a first-level child node, self is a second-level child node, dynamic is a third-level child node, off, heavy, and black are fourth-level child nodes, and machine, start, and screen are fifth-level child nodes. The user enters a single character p, and associates to c. The user selects c, and associates to from,... Through the prefix tree, it is convenient for users to quickly write search key phrases when searching.

[0112] In an alternative embodiment, see Figure 4 , step S40, including steps S401 to S402, are as follows:

[0113] S401: Obtaining association probabilities between a search key phrase and all key phrases in a key phrase table;

[0114] S402: Selecting a preset number of key phrases with top probability values ​​from the association probabilities as search association results, and displaying the search association results.

[0115] In the disclosed embodiment, by querying the association probability between the search key phrase and the remaining key phrases in the key phrase table, a preset number of key phrases with top association probabilities can be automatically and quickly displayed as search association results.

[0116] In an alternative embodiment, see Figure 5 , the search association method includes steps S51 to S53, which are as follows:

[0117] S51: in response to a selection operation of a target key phrase in the displayed search association results, obtaining a first association probability between the search key phrase and each key phrase in the key phrase table and a second association probability between the target key phrase and each key phrase in the key phrase table; wherein the target key phrase is any key phrase in the displayed search association results;

[0118] S52: multiplying the first association probability, the second association probability, and the word frequency of each key phrase in the key phrase table to obtain a product result of each key phrase;

[0119] S53: Selecting a preset number of top-ranked key phrases from the product results as target search association results, and displaying the target search association results.

[0120] In the disclosed embodiment, in response to the user inputting a search key phrase, the search association results are displayed. For example, the search key phrase is "pc no touch", and the search association results are "f70eb", "f86ec", and "f75ef". After the user selects "f70eb" from the search association results, it is necessary to associate the next key phrase based on "pc no touch f70eb". Specifically, the above scenario is understood as an association scenario of multiple key phrases. After inputting key phrases A, C, D, and E, the probability of associating key phrase B is calculated. The probability calculation formula is as follows:

[0121]

[0122] Among them, the key phrases A, C, D, and E are independent of each other. So P(A, C, D, E|B) can be transformed into:

[0123] P(A,C,D,E|B)=P(A|B)P(C|B)P(D|B)P(E|B)

[0124] P(B) can be converted into the word frequency of B C(B), P(A,C,D,E) is fixed, so the above formula can be finally converted into:

[0125] P(B|A,C,D,E)=P(A|B)P(C|B)P(D|B)P(E|B)C(B)

[0126] Among them, the value range of B is all potential key phrases except A, C, D, and E, and C(B) is the word frequency of key phrase B in the corpus. Finally, several probability values ​​can be obtained, and the key phrases with higher probability values ​​are used as the target search association results.

[0127] Through naive Bayes probability calculation, when multiple key phrases are entered in the search box, the next key phrase can be automatically and quickly associated.

[0128] Example 2

[0129] The following is an embodiment of the device of the present disclosure, which can be used to execute the content of the method in Embodiment 1 of the present disclosure. For details not disclosed in the embodiment of the device of the present disclosure, please refer to the content of the method in Embodiment 1 of the present disclosure.

[0130] See also Figure 6 , which shows a schematic diagram of the structure of a search association device provided by a second embodiment of the present disclosure. The search association device 6 provided by the embodiment of the present disclosure includes:

[0131] Corpus acquisition module 61, used to acquire a key phrase table and training corpus; wherein the key phrase table includes a plurality of key phrases;

[0132] A word frequency acquisition module 62, used to acquire a first word frequency of each key phrase appearing in the training corpus and a second word frequency of any two key phrases appearing together in the training corpus;

[0133] The association probability determination module 63 is used to determine the association probability between any two key phrases according to the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating another key phrase when searching for one key phrase;

[0134] The association result display module 64 is used to obtain the search key phrase and display the search association result according to the search key phrase and the association probability.

[0135] Optionally, an associative probability determination module includes:

[0136] A first summation result obtaining unit, used for summing the first word frequency and the total number of key phrases in the training corpus to obtain a first summation result;

[0137] A second summation result obtaining unit, used for summing the first word frequency and 1 to obtain a second summation result;

[0138] The association probability obtaining unit is used to use the ratio of the second summation result to the first summation result as the association probability between any two key phrases; or use the ratio of the second word frequency to the first word frequency as the association probability between any two key phrases.

[0139] Optionally, an associative probability determination module includes:

[0140] A cluster obtaining unit, used for clustering a plurality of key phrases in the key phrase table to obtain clusters;

[0141] The association probability setting unit is used to determine mutually exclusive key phrases from the clusters and set the association probability between any two mutually exclusive key phrases to 0.

[0142] Optional, association result display module, including:

[0143] An association probability acquisition unit, used to acquire the association probability between the search key phrase and all key phrases in the key phrase table;

[0144] The association result display unit is used to select a preset number of key phrases with top probability values ​​from the association probabilities as search association results, and display the search association results.

[0145] Optionally, search for Lenovo devices, including:

[0146] A first association probability acquisition module is used to acquire a first association probability between the search key phrase and each key phrase in the key phrase table and a second association probability between the target key phrase and each key phrase in the key phrase table in response to a selection operation of a target key phrase in the displayed search association result; wherein the target key phrase is any key phrase in the displayed search association result;

[0147] A product result obtaining module, used for multiplying the first association probability, the second association probability and the word frequency of each key phrase in the key phrase table to obtain the product result of each key phrase;

[0148] The target search association result display module is used to select a preset number of key phrases with top rankings from the product results as the target search association results, and display the target search association results.

[0149] The embodiment of the present disclosure is applied by obtaining a key phrase table and a training corpus; wherein the key phrase table includes a plurality of key phrases; obtaining the first word frequency of each key phrase appearing in the training corpus and the second word frequency of any two key phrases appearing together in the training corpus; determining the association probability between any two key phrases based on the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating with another key phrase when searching for a key phrase; obtaining the search key phrase, and displaying the search association result based on the search key phrase and the association probability. The present disclosure assists the user in entering fewer search key phrases when searching by determining the association probability of any two key phrases in the key phrase table, so as to obtain the desired search content faster and better, thereby improving the user's search efficiency.

[0150] Example 3

[0151] The following is an embodiment of the device disclosed herein, which can be used to execute the contents of the method in Embodiment 1 and Embodiment 2 of the present disclosure. For details not disclosed in the embodiment of the device disclosed herein, please refer to the contents of the method in Embodiment 1 and Embodiment 2 of the present disclosure.

[0152] See also Figure 7 The present disclosure further provides an electronic device 300, which may be a computer, a mobile phone, a tablet computer, etc. In an exemplary embodiment of the present disclosure, the electronic device 300 is a computer, which includes: at least one processor 301, at least one memory 302, at least one display, at least one network interface 303, a user interface 304, and at least one communication bus 305.

[0153] The user interface 304 is mainly used to provide an input interface for the user and obtain data input by the user. Optionally, the user interface may also include a standard wired interface or a wireless interface.

[0154] The network interface 303 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0155] The communication bus 305 is used to realize the connection and communication between these components.

[0156] Among them, the processor 301 may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor can integrate one or more combinations of central processing unit (Central Processing Unit, CPU), image processor (Graphics Processing Unit, GPU) and modem. Among them, the CPU mainly processes the operating system, user interface and application program, etc.; the GPU is responsible for rendering and drawing the content to be displayed by the display layer; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor, but implemented by a single chip.

[0157] Among them, the memory 302 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory may also be optionally at least one storage device located away from the aforementioned processor. As Figure 7 As shown, the memory as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application program.

[0158] The processor can be used to call the application of the search association method stored in the memory, and specifically execute the method steps of the above-mentioned embodiment 1. The specific execution process can refer to the specific instructions shown in embodiment 1, which will not be repeated here.

[0159] Example 4

[0160] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and the instructions are suitable for being loaded by a processor and executing the method steps of the above-mentioned embodiment 1. The specific execution process can refer to the specific description shown in the embodiment, and will not be repeated here. The device where the storage medium is located can be a personal computer, a laptop computer, a smart phone, a tablet computer and other electronic devices.

[0161] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.

[0162] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0163] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the function selected in the process. Figure 1 A process or multiple processes and / or boxes Figure 1function selected in a box or multiple boxes.

[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 steps for the function selected in a box or multiple boxes.

[0165] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0166] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0167] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0168] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0169] The above are only embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims of the present disclosure.

Claims

1. A search association method, It is characterized in that The steps include: Obtaining a key phrase table and training corpus; wherein the key phrase table includes a plurality of key phrases; Obtaining a first word frequency of each of the key phrases appearing in the training corpus and a second word frequency of any two key phrases appearing together in the training corpus; Determining the association probability between the two arbitrary key phrases according to the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating another key phrase when searching for one key phrase; A search key phrase is obtained, and a search association result is displayed according to the search key phrase and the association probability.

2. The search association method according to claim 1, Features: The step of determining the association probability between the arbitrary two key phrases according to the first word frequency and the second word frequency includes: Summing the first word frequency and the total number of key phrases in the training corpus to obtain a first summation result; Add the first word frequency to 1 to obtain a second sum result; The ratio of the second summation result to the first summation result is used as the association probability between the two arbitrary key phrases; or the ratio of the second word frequency to the first word frequency is used as the association probability between the two arbitrary key phrases.

3. The search association method according to claim 1, Features: The step of determining the association probability between the arbitrary two key phrases according to the first word frequency and the second word frequency includes: Clustering a plurality of the key phrases in the key phrase table to obtain clusters; Mutually exclusive key phrases are determined from the clusters, and the association probability between any two mutually exclusive key phrases is set to zero.

4. The search association method according to claim 1, Features: The step of obtaining a search key phrase and displaying a search association result according to the search key phrase and the association probability comprises: Obtaining association probabilities between the search key phrase and all key phrases in the key phrase table; A preset number of key phrases with top probability values ​​are selected from the association probabilities as search association results, and the search association results are displayed.

5. The search association method according to claim 1, It is characterized in that Also includes: In response to a selection operation of a target key phrase in the displayed search association results, a first association probability between the search key phrase and each key phrase in the key phrase table and a second association probability between the target key phrase and each key phrase in the key phrase table are obtained; wherein the target key phrase is any key phrase in the displayed search association results; Multiplying the first association probability, the second association probability, and the word frequency of each key phrase in the key phrase table to obtain a product result of each key phrase; A preset number of key phrases ranked high are selected from the product results as target search association results, and the target search association results are displayed.

6. The search association method according to any one of claims 1 to 5, Features: Before the step of obtaining the key phrase table and the training corpus, the following steps are included: Acquire the user's historical search terms and the document title clicked by the user; wherein the document title is the document title displayed according to the user's historical search terms; Extracting the common words of the user's historical search terms and the document title to obtain an original keyword table; Acquire original training corpus; wherein the original training corpus includes original text corpus at a plurality of sentence levels; According to the original keyword table, segmenting the original text corpora at the plurality of sentence levels to obtain text corpora; Based on the new phrase discovery method of solidification degree, new phrase discovery is performed on the text corpus to obtain a key phrase table; The original training corpus is segmented according to the key phrase table to obtain training corpus.

7. The search association method according to claim 6, Features: The method for discovering new phrases based on solidification degree, the step of discovering new phrases on the text corpus and obtaining a key phrase table, comprises: Count the third word frequency of each keyword appearing in the text corpus and the fourth word frequency of each n-gram grammar appearing in the text corpus; wherein n is greater than or equal to 2; and the n-gram grammar is n keywords appearing consecutively; Taking the n-gram whose fourth word frequency is greater than or equal to the preset word frequency threshold as the first n-gram; Calculating the solidification degree of each of the first n-grams according to the third word frequency and the fourth word frequency; Taking the first n-gram whose solidification degree is greater than or equal to a preset solidification degree threshold as a candidate phrase of a first candidate phrase table, to obtain the first candidate phrase table; According to the first candidate phrase list, segmenting and merging words on the text corpus to obtain a second candidate phrase list; Performing backtracking filtering on the second candidate phrase list to obtain a third candidate phrase list; According to the third candidate phrase table, word frequency statistics, coagulation degree calculation, segmentation and word merging are performed on the text corpus in a loop iteration until the number of loop iterations meets the preset number of iterations, thereby obtaining a key phrase table.

8. The search association method according to any one of claims 1 to 5, Features: Before the step of obtaining the search key phrase and displaying the search association result according to the search key phrase and the association probability, the method includes: Generate a prefix tree of key phrases according to the key phrase table; Obtaining an input keyword, and displaying a plurality of key phrases according to the keyword and the prefix tree; In response to selecting any one of the key phrases from the plurality of key phrases, a search key phrase is obtained.

9. A search and association device, It is characterized in that include: A corpus acquisition module, used to acquire a key phrase table and training corpus; wherein the key phrase table includes a plurality of key phrases; A word frequency acquisition module, used for acquiring a first word frequency of each key phrase appearing in the training corpus and a second word frequency of any two key phrases appearing together in the training corpus; an association probability determination module, configured to determine the association probability between the two arbitrary key phrases according to the first word frequency and the second word frequency; wherein the association probability is used to indicate the probability of associating another key phrase when searching for one key phrase; The association result display module is used to obtain a search key phrase and display a search association result according to the search key phrase and the association probability.

10. An electronic device, It is characterized in that include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the search association method as described in any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the search association method as described in any one of claims 1 to 8 is implemented.