Search method, device, electronic device and readable storage medium
By integrating search results into fragments and generating multiple files, the problem of cumbersome user operations is solved, a more intuitive and accurate presentation of search results is achieved, and the user operation process is simplified.
Patent Information
- Application Number
- CN202210480051.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-05
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-05-05
AI Technical Summary
In existing search methods, users need to click on web links multiple times to find search answers, which makes the operation cumbersome.
By obtaining multiple search results that match the target information, integrating them into fragments, and generating multiple files based on the arrangement of the fragments, the final search results are determined and presented directly to the user.
It simplifies user operations, reduces the number of repeated clicks on web links, and improves the accuracy of search results and user experience.
Smart Images

Figure CN114840754B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a search method, device, electronic device and readable storage medium. Background Art
[0002] With the rapid development of the Internet, the amount of information on the Internet has increased rapidly, and people have gradually come to rely on searching on the Internet to quickly obtain the information they need, so that the information obtained is both accurate and rich.
[0003] In the prior art, the search method mainly relies on the semantic understanding of keywords to match relevant web pages for users, and displays them in descending order according to the relevance between each web page and the keyword. Usually, what is displayed to the user is the link of each web page, as well as a simple sentence or a few words in the web page. When the user views the search results, he needs to click on the web page link to view the web page content. Therefore, in order to find a more satisfactory search answer, the user needs to click on the web page link multiple times and then search for the required information in the web page.
[0004] It can be seen that in the prior art, users have to repeatedly click on web links to search for answers, which makes the user operation cumbersome. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a search method that can solve the problem in the prior art that users have to repeatedly click on web links to find search answers, resulting in cumbersome user operations.
[0006] In a first aspect, an embodiment of the present application provides a search method, the method comprising: according to target information, obtaining N1 first search results matching the target information, where N1 is a positive integer; according to the contents of the N1 first search results, determining N2 fragments corresponding to the target information, where N2 is a positive integer, and N1≧N2; arranging and combining the N2 fragments according to N3 arrangement methods to obtain N3 corresponding files, where N3 is a positive integer; determining at least one file as a second search result, and outputting the second search result.
[0007] In a second aspect, an embodiment of the present application provides a search device, comprising: an acquisition module, used to acquire N1 first search results matching the target information according to the target information, where N1 is a positive integer; a first determination module, used to determine N2 fragments corresponding to the target information according to the contents of the N1 first search results, where N2 is a positive integer, and N1≧N2; an arrangement module, used to arrange and combine the N2 fragments according to N3 arrangement methods to obtain N3 corresponding files, where N3 is a positive integer; a second determination module, used to determine at least one file as a second search result, and output the second search result.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0012] Thus, in the embodiment of the present application, based on the target information input by the user, N1 first search results related to the target information are first matched, and then the contents of the N1 first search results are integrated into N2 fragments, and the N2 fragments are further arranged and combined. Among them, based on N3 kinds of arrangement methods, corresponding N3 files can be obtained, so that at least one file is determined among the N3 files as the second search result that is finally output. It can be seen that based on the embodiment of the present application, multiple search results can be screened for content to obtain related content, remove irrelevant content, and then the obtained fragmented content can be integrated to generate a file and directly presented to the user, thereby ensuring that the user can intuitively view more accurate search results, while avoiding users from repeatedly clicking on web links, thereby simplifying user operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flowchart of a search method according to an embodiment of the present application;
[0014] Figure 2 is a probability curve distribution diagram of an embodiment of the present application;
[0015] Figure 3 is a display schematic diagram of an electronic device according to an embodiment of the present application;
[0016] Figure 4 is a block diagram of a search device according to an embodiment of the present application;
[0017] Figure 5It is one of the hardware structure diagrams of the electronic device according to the embodiment of the present application;
[0018] Figure 6 This is the second schematic diagram of the hardware structure of the electronic device according to the embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings of the embodiments of the present application to clearly describe the technical solutions of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present application belong to the scope of protection of this application.
[0020] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0021] The search method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0022] Figure 1 A flow chart of a search method according to an embodiment of the present application is shown. The method is applied to an electronic device and includes:
[0023] Step 110: According to the target information, obtain N1 first search results matching the target information, where N1 is a positive integer.
[0024] Prior to this step, the present application may further include the step of receiving user input of target information.
[0025] The application scenario is as follows: the user enters target information in the search box and clicks the "Search" control.
[0026] Optionally, the target information includes text, images and other forms.
[0027] Therefore, in this step, semantic extraction is performed on the target information, and the top N1 first search results with the highest relevance are searched according to the semantic matching degree.
[0028] Optionally, the first search result includes multiple forms such as pages, links, and fragments.
[0029] Step 120: Determine N2 segments corresponding to the target information according to the contents of the N1 first search results, where N2 is a positive integer and N1≧N2.
[0030] In this step, N1 first search results are converted into N2 segments, so that the N2 segments can be subsequently integrated to generate one search result.
[0031] Step 130: Arrange and combine the N2 segments according to N3 arrangements to obtain N3 corresponding files, where N3 is a positive integer.
[0032] In this step, the N2 segments are arranged and combined to generate a corresponding file.
[0033] Optionally, N3 arrangement modes are provided. In one arrangement mode, N2 segments are arranged and combined in sequence to generate a file. Accordingly, N3 corresponding files can be generated in the end.
[0034] Optionally, the file includes various forms such as pages and pictures.
[0035] Step 140: Determine at least one file as a second search result, and output the second search result.
[0036] Among the N3 files, at least one file matching the target information is determined and presented to the user as the second search result that is finally output.
[0037] Thus, in the embodiment of the present application, based on the target information input by the user, N1 first search results related to the target information are first matched, and then the contents of the N1 first search results are integrated into N2 fragments, and the N2 fragments are further arranged and combined. Among them, based on N3 kinds of arrangement methods, corresponding N3 files can be obtained, so that at least one file is determined among the N3 files as the second search result that is finally output. It can be seen that based on the embodiment of the present application, multiple search results can be screened for content to obtain related content, remove irrelevant content, and then the obtained fragmented content can be integrated to generate a file and directly presented to the user, thereby ensuring that the user can intuitively view more accurate search results, while avoiding users from repeatedly clicking on web links, thereby simplifying user operations.
[0038] In the process of the search method of another embodiment of the present application, step 120 includes:
[0039] Sub-step A1: extracting target content matching the target information from the content corresponding to a first search result, and using the target content to generate a segment, thereby obtaining N1 segments.
[0040] In this step, a Bidirectional Encoder Representations from Transformer (BERT) model is used to determine the starting position and the ending position in the content corresponding to the first search result.
[0041] For example, the first search result is a webpage link, and the content corresponding to the first search result is the webpage content. Usually, a webpage contains a lot of content, which may include some advertisement content and title content. Even if it is the main text, only some paragraphs may contain content related to the target information.
[0042] Therefore, in this step, based on the first search result obtained in the preliminary search, the starting position and the ending position are determined in the content corresponding to the first search result according to the target information, so as to extract the content between the starting position and the ending position as the target content and generate a segment corresponding to the first search result.
[0043] Correspondingly, N1 first search results can extract N1 fragments.
[0044] Optionally, the extracted segments may retain their original formats for use in extracting feature information from the segments.
[0045] Sub-step A2: when the similarity between at least two fragments is greater than a first threshold, retain one of the at least two fragments according to feature information of the at least two fragments to obtain N2 fragments.
[0046] The feature information of at least two fragments includes: semantic matching information, source page address information, and author information.
[0047] In this step, the N1 fragments are deduplicated.
[0048] For example, the similarity between the segments is calculated. For a segment set with a similarity greater than 90%, the semantic matching degree r of each segment in the set, the first score count of the webpage address, and the semantic matching degree r of each segment in the set are calculated. url 、Author's second score count author , get the A value of each fragment, and keep the fragment corresponding to the maximum A value. The calculation method of the A value is: r*(ln(count url +count author +1)).
[0049] For example, the snippet may be from a web page, the first score of the web page address may be based on the number of times the address is linked during crawling, and the second score of the author may be based on the number of times the author is cited.
[0050] The semantic matching information includes the semantic matching degree, the source page address information includes the first score of the web page address, and the author information includes the second score of the author.
[0051] For example, for fragment one, fragment two and fragment three, fragment one is compared with fragment two and fragment three respectively. If the similarity between fragment one and fragment two is greater than 90%, and the similarity between fragment one and fragment three is also greater than 90%, then fragment one, fragment two and fragment three can form a set with a similarity greater than 90%. In this set, the A value of each fragment is calculated respectively, and the fragment corresponding to the maximum value is retained.
[0052] Exemplarily, in this step, the obtained fragment set is (a1, a2...a N2 ).
[0053] In this embodiment, the content corresponding to the first search result includes a large amount of redundant content, so the content corresponding to the first search result is first extracted; then, the extracted content is deduplicated. It can be seen that based on this embodiment, users can avoid spending time viewing duplicate content and irrelevant content, simplifying user operations.
[0054] In the process of the search method of another embodiment of the present application, step 130 includes:
[0055] Sub-step B1: Arrange the N2 fragments at the first position respectively to obtain N2 first positions.
[0056] Sub-step B2: Based on the N2 first positions, respectively obtain the matching values of the other fragments arranged at the second position in the N2 fragments except the fragment at the first position, and obtain N2*(N2-1) matching values.
[0057] Sub-step B3: Among the N2*(N2-1) matching values, retain the arrangement corresponding to the largest first N3 matching values.
[0058] Sub-step B4: In any of the N3 arrangements, obtain the matching values of the N2 segments arranged at the M+1th position except the segments at the first M positions, and obtain N3*(N2-M) matching values.
[0059] Sub-step B5: Among the N3*(N2-M) matching values, retain the arrangement corresponding to the largest first N3 matching values.
[0060] Here, M is a positive integer, and in the repeated steps, M is equal to 2, 3, ... (N2-1) respectively.
[0061] In this embodiment, the N2 segments are arranged and combined according to the sequence relationship and causal relationship between the N2 segments.
[0062] On the one hand, the sequential relationship and causal relationship between each fragment are reflected in "probability".
[0063] Here, “probability” means that after the position of a fragment is determined, the probability of another fragment being arranged at the next position is calculated.
[0064] For example, first, fragment a i Arrange at a certain position and calculate fragment a j The probability of being arranged in the next position p(a j |a i ).
[0065] Formula 1: p(a j |a i )=p 引用关系 (a j |a i )+p 长浏览关系 (a j |a i )+Σ c∈C (a j |c)*r ac .
[0066] If fragment a i and fragment a j There are citation relationships and referenced relationships between them, such as a i Quote a j , then a i is a j The post-order relationship; on the contrary, a i By a j Citation, then a i is a j The pre-order relationship between the two parties can be used to obtain the p in formula 1 based on the reference relationship and the referenced relationship between the two parties. 引用关系 (a j |a i ). Correspondingly, when fragment a i and fragment a j When there is a citation relationship and a cited relationship between them, the relationship between them is a "strong relationship", p 引用关系 (a j |a i ) is used to indicate the strength of a strong relationship.
[0067] For example, in fragment a i A hyperlink is provided to open a fragment j , so in fragment a iIn the example, fragment a is referenced by hyperlink. j , it can be seen that fragment a i and fragment a j There is a citation relationship and a referenced relationship between them. Based on the relationship between the two, we can get p 引用关系 (a j |a i ).
[0068] In addition, there are "weak relationships" between fragments.
[0069] The first kind of "weak relationship" is: according to statistics from fragment a i Jump to segment a j After browsing time, get p 长浏览关系 (a j |a i ), where the longer the browsing time, the stronger the weak relationship, that is, p 长浏览关系 (a j |a i ) is larger.
[0070] The second kind of "weak relationship" is: according to the fragment a i Related page set C jumps to fragment a j The sum of the probabilities of c∈C (a j |c)*r ac , r ac Used to represent a j The semantic match with page c.
[0071] Among them, a i The relevant page set C is composed of i Jump to a j The middle page is composed of.
[0072] On the other hand, the sequential relationship and causal relationship between each fragment are also reflected in the characteristic information of the fragment itself.
[0073] The characteristic information of a segment refers to the characteristic information of another segment that may be arranged at the next position after the position of a segment is determined.
[0074] For example, fragment a j The contribution of w(a j )=f(feature information), where the feature information includes whether it is bolded, whether it is highlighted, the number of times the text is cited / cited, the degree of match of the search term, the average stay time of the user, the number of times the fragment is copied / selected under the relevant search term, etc. j )=f(feature information) and perform min-max normalization to obtain Formula 2:
[0075]
[0076] In Formula 2, W is used to represent the contribution diversity of N2 fragments.
[0077] Therefore, combining the above two aspects, multiplying formula 1 and formula 2 to obtain the matching value, that is, formula 3:
[0078]
[0079] According to Formula 3, when a certain segment is determined to be arranged in a certain position, the matching values of other segments arranged in the next position except the segment are calculated, and then the largest first N3 matching values are determined among all the matching values as the partial sorting in the N3 sorting modes. This process is repeated until the sorting of N2 segments in the N3 sorting modes is completed.
[0080] Among them, other fragments besides the above-mentioned fragments do not include the fragments arranged in the current arrangement combination.
[0081] The fragment arranged at the first position may be any fragment, that is, the probability of each fragment being arranged at the first position is 1 / N2.
[0082] For example, assume that there are four fragments a1, a2, a3, and a4, where N2=4 and N3=6. First, arrange the four fragments in the first position respectively, and calculate the matching values of the fragments arranged in the second position in turn, so that twelve matching values can be obtained, namely 4*3, and the six largest matching values are taken, and the permutations and combinations where these six matching values are located are retained. For the six groups of permutations and combinations retained, the first position and the second position have been determined, and then, in each group of permutations and combinations, the matching values of the unarranged fragments in the group arranged in the third position are calculated in turn, and twelve matching values can be obtained, namely 6*(4-2), and then the six largest matching values are taken, and the permutations and combinations where these six matching values are located are retained. For the six groups of permutations and combinations retained, the first position, the second position, and the third position have been determined, and then, in each group of permutations and combinations, the matching values of the unarranged fragments in the group arranged in the fourth position are calculated in turn, and six matching values can be obtained, namely 6*(4-3).
[0083] Among them, step B4 and step B5 are two repeated steps, that is, step B4 and step B5 are used to complete the sorting of one position except the first position and the second position, so M is equal to 2, 3... (N2-1) in sequence. When M=N2-1, it is actually arranging the fragments at the last position. In this case, in each group of permutations and combinations, only one position is left, corresponding to one fragment, and it can also be directly arranged without calculating the matching value. In this embodiment, the case of M=N2-1 is limited to fully illustrate the arrangement process of N2 fragments.
[0084] Correspondingly, based on the foregoing example, in each group of permutations and combinations, the unpermuted segments in the group are directly arranged at the fourth position.
[0085] In this embodiment, a method for arranging N2 fragments according to the order and causal relationship between each fragment is provided, so that the content of the file formed by the arrangement and combination of the N2 fragments is more coherent, smooth and fluent; at the same time, this embodiment provides multiple files to facilitate the selection of better results from multiple files.
[0086] In more embodiments, in addition to considering the sequential relationship and causal relationship between segments, the segments can be further processed at word granularity to ensure that the final generated file is more coherent.
[0087] In the process of the search method of another embodiment of the present application, before step 140, the method further includes:
[0088] Step C1: In any file, when the first fragment is arranged in the first position, if the probability of the second fragment being arranged in the second position meets the preset condition, the second fragment and the fragments arranged thereafter are deleted, and the second position is the next position of the first position, and the N2 fragments include the first fragment and the second fragment.
[0089] The preconditions include at least one of the following:
[0090] When the first segment is arranged at the first position, the probability that the second segment is arranged at the second position is less than a second threshold;
[0091] When the first segment is arranged at the first position, the probability fluctuation amplitude of the second segment being arranged at the second position is greater than the third threshold.
[0092] In this embodiment, since the various segments in the file are from different first search results, after the new file is generated, there may be incoherence between the segments, such as semantic incomprehension and repeated expressions. In order to further improve the file, the length of the file content can be trimmed to trim the incoherent parts such as semantic incomprehension, so as to obtain a file of optimal length.
[0093] Optionally, based on the coherence of the file content, some incoherent segments are cut out, and the probability that the subsequent segment is arranged after the preceding segment can reflect the coherence between the segments. Therefore, the probability that the subsequent segment is arranged after the preceding segment can be used as a basis to check for incoherent places in the file.
[0094] Taking any file as an example, the set of segments included in the file is (c1, c2…c N2 ). Referring to the above embodiment, the probability p(c i+1 |c i ). Thus, according to all p(c i+1 |c i ), draw a curve graph of the probability distribution (see Figure 2 ).exist Figure 2 In the figure, the horizontal axis is used to represent the N2 positions arranged in sequence, and the vertical axis is used to represent the probability of the fragment being arranged at the position.
[0095] Correspondingly, the cropping method provided in this embodiment is to find Figure 2 The outlier point in the curve shown is used as the clipping point to clip all the segments at and after the position. When there are multiple outliers, the first outlier point can be used as the reference.
[0096] Optionally, the method for determining the outlier includes at least one of the following:
[0097] The position where the probability is less than the second threshold is regarded as an outlier; the position where the probability fluctuation amplitude is greater than the third threshold is regarded as an outlier. The probability fluctuation amplitude can be determined by calculating the variance, such as finding the point that deviates from the mean by three standard deviations based on the 3σ law.
[0098] In this embodiment, a probability curve distribution diagram is obtained based on the probability of each fragment being arranged in the corresponding position, so that the abnormal points in the diagram are regarded as the positions where the splicing between the fragments is incoherent, and then based on these incoherent positions, the file content is deleted so that the fragments finally retained are coherent.
[0099] In more embodiments, the cropping method may also be: only discarding a single segment that is not coherent with the previous context, and the remaining segments may be spliced with other segments.
[0100] In the process of the search method of another embodiment of the present application, step 140 includes:
[0101] Sub-step D1: Determine at least one file as a second search result based on the characteristic information of N3 files.
[0102] The characteristic information of the file includes: related information between two adjacent segments in the file, characteristic information of each segment in the file, and matching information between each segment in the file and target information.
[0103] In this embodiment, it is necessary to find a better answer among N3 files to present to the user.
[0104] In this embodiment, a method for determining a second search result is provided.
[0105] For reference, use Formula 4:
[0106] v=b1*v1+b2*v2+b3*v3+b4*v4+b5*v5+b6*v6+b7*v7.
[0107] Among them, v1 is used to represent Figure 2 The area of the graph formed by the curve under the dotted box and the coordinate axis. The curve under the dotted box is used to represent the fragments retained after cropping. The larger the v1, the longer the file content and the higher the fluency.
[0108] v2 is the difference between the maximum probability and the minimum probability in the file. v2 reflects the fluency of the entire file content. The smaller v2 is, the higher the fluency is.
[0109] v3 is used to represent the maximum probability in the file.
[0110] v4 is used to indicate the minimum probability in the file. A v4 that is too small indicates a non-smooth condition.
[0111] v5 is used to represent the average semantic matching degree between each segment in the file and the target information.
[0112] v6 is used to represent the average of the first fractions of the page addresses of each fragment in the file.
[0113] v7 is used to represent the mean of the second scores of the authors of each segment in the file.
[0114] b1~b7 are coefficients, b2, b3, and b4 are negative numbers.
[0115] The explanation of probability in this embodiment can refer to the above embodiment. The first score of the page address can be based on the number of times the address is linked during crawling, and the second score of the author can be based on the number of times the author is cited.
[0116] Furthermore, based on Formula 4, for each file, v1 to v7 are weightedly fused to obtain a weight value v.
[0117] In one solution, the file corresponding to the largest weight value v may be determined as the second search result.
[0118] In another solution, the files corresponding to the first several largest weight values v may be determined as the second search results.
[0119] In this embodiment, the relevant information between two adjacent fragments in the file includes the probability of existence between each two adjacent fragments; the feature information of each fragment in the file includes the first score of the page address of each fragment and the second score of the author of each fragment; the matching information between each fragment in the file and the target information includes the semantic matching degree between each fragment and the target information.
[0120] In this embodiment, the correlation between adjacent segments in the file, the feature information of each segment itself, and the matching information between each segment and the target information are comprehensively considered, and finally a relatively smooth file is selected and presented to the user as a search answer.
[0121] In a search method according to another embodiment of the present application, when outputting the second search results, reference links corresponding to each fragment in the second search results may also be displayed for the user to view the original content.
[0122] For example, see Figure 3 , the answer text, i.e. the second search result, is displayed. In addition, the conventional search results (i.e. the first search result) are also displayed, such as links.
[0123] in, Figure 3 The retrieval question in the search includes target information, and the target information can be the entire content of the retrieval question or the keywords in the retrieval question.
[0124] In summary, the purpose of this application is to provide a method for automatically generating search answers and quickly displaying them to users. During the search process, semantic retrieval and matching are first performed on the user's search terms, and fragments are extracted from the preliminary searched web pages to remove redundant results. Then, based on the strength relationship between the fragments, the probability of the order between the two is calculated, and the contribution of the fragments themselves to the results is combined to generate candidate files. Furthermore, the fluency of the file content is judged, abnormal points are found and trimmed, and finally sorted according to semantic matching, authority and fluency, and the better files are displayed to the user, which is convenient for the user to quickly browse the search results, ensuring both search efficiency and accuracy, and improving the user experience.
[0125] The search method provided in the embodiment of the present application can be executed by a search device. In the embodiment of the present application, the search device provided in the embodiment of the present application is described by taking the search method executed by the search device as an example.
[0126] Figure 4 A block diagram of a search device according to another embodiment of the present application is shown, the device comprising:
[0127] An acquisition module 10 is used to acquire N1 first search results matching the target information according to the target information, where N1 is a positive integer;
[0128] A first determination module 20, configured to determine N2 segments corresponding to target information according to the contents of N1 first search results, where N2 is a positive integer and N1≧N2;
[0129] an arrangement module 30, configured to arrange and combine the N2 segments in N3 arrangement modes to obtain N3 corresponding files, where N3 is a positive integer;
[0130] The second determining module 40 is used to determine at least one file as a second search result and output the second search result.
[0131] Thus, in the embodiment of the present application, based on the target information input by the user, N1 first search results related to the target information are first matched, and then the contents of the N1 first search results are integrated into N2 fragments, and the N2 fragments are further arranged and combined. Among them, based on N3 kinds of arrangement methods, corresponding N3 files can be obtained, so that at least one file is determined among the N3 files as the second search result that is finally output. It can be seen that based on the embodiment of the present application, multiple search results can be screened for content to obtain related content, remove irrelevant content, and then the obtained fragmented content can be integrated to generate a file and directly presented to the user, thereby ensuring that the user can intuitively view more accurate search results, while avoiding users from repeatedly clicking on web links, thereby simplifying user operations.
[0132] Optionally, the first determining module 20 includes:
[0133] An extraction unit, configured to extract target content matching the target information from content corresponding to a first search result, wherein the target content is used to generate a segment, thereby obtaining N1 segments;
[0134] A first retaining unit is configured to retain one of the at least two fragments according to feature information of the at least two fragments when the similarity between the at least two fragments is greater than a first threshold, so as to obtain N2 fragments;
[0135] The feature information of at least two fragments includes: semantic matching information, source page address information, and author information.
[0136] Optionally, the arrangement module 30 includes:
[0137] an arranging unit, used for arranging the N2 fragments at the first position respectively, to obtain N2 first positions;
[0138] A first acquisition unit is used to acquire, based on the N2 first positions, the matching values of the other fragments arranged at the second positions in the N2 fragments except the fragment at the first position, to obtain N2*(N2-1) matching values;
[0139] A second retaining unit is used to retain the arrangement corresponding to the largest first N3 matching values among the N2*(N2-1) matching values;
[0140] A second acquisition unit is used to acquire, in any one of the N3 arrangements, matching values of the other fragments arranged at the M+1th position among the N2 fragments except the fragments at the first M positions, to obtain N3*(N2-M) matching values;
[0141] A third retaining unit is used to retain the arrangement corresponding to the largest first N3 matching values among the N3*(N2-M) matching values;
[0142] Here, M is a positive integer, and in the repeated steps, M is equal to 2, 3, ... (N2-1) respectively.
[0143] Optionally, the device further comprises:
[0144] a deleting module, configured to, in any file, when the first segment is arranged in the first position, delete the second segment and the segments arranged thereafter if the probability that the second segment is arranged in the second position meets a preset condition, the second position being the position next to the first position, and the N2 segments including the first segment and the second segment;
[0145] The preconditions include at least one of the following:
[0146] When the first segment is arranged at the first position, the probability that the second segment is arranged at the second position is less than a second threshold;
[0147] When the first segment is arranged at the first position, the probability fluctuation amplitude of the second segment being arranged at the second position is greater than the third threshold.
[0148] Optionally, the second determining module 40 includes:
[0149] a determining unit, configured to determine at least one file as a second search result based on the feature information of the N3 files;
[0150] The characteristic information of the file includes: related information between two adjacent segments in the file, characteristic information of each segment in the file, and matching information between each segment in the file and target information.
[0151] The search device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (NetVork Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0152] The search device in the embodiment of the present application may be a device having an action system. The action system may be an Android action system, an iOS action system, or other possible action systems, which are not specifically limited in the embodiment of the present application.
[0153] The search device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.
[0154] Alternatively, if Figure 5 As shown, an embodiment of the present application also provides an electronic device 100, including a processor 101, a memory 102, and a program or instruction stored in the memory 102 and executable on the processor 101. When the program or instruction is executed by the processor 101, each step of any of the above-mentioned search method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0155] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0156] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0157] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0158] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0159] Among them, the processor 1010 is used to obtain N1 first search results matching the target information according to the target information, where N1 is a positive integer; determine N2 fragments corresponding to the target information according to the contents of the N1 first search results, where N2 is a positive integer, and N1≧N2; arrange and combine the N2 fragments according to N3 arrangement methods to obtain N3 corresponding files, where N3 is a positive integer; determine at least one file as a second search result, and output the second search result.
[0160] Thus, in the embodiment of the present application, based on the target information input by the user, N1 first search results related to the target information are first matched, and then the contents of the N1 first search results are integrated into N2 fragments, and the N2 fragments are further arranged and combined. Among them, based on N3 kinds of arrangement methods, corresponding N3 files can be obtained, so that at least one file is determined among the N3 files as the second search result that is finally output. It can be seen that based on the embodiment of the present application, multiple search results can be screened for content to obtain related content, remove irrelevant content, and then the obtained fragmented content can be integrated to generate a file and directly presented to the user, thereby ensuring that the user can intuitively view more accurate search results, while avoiding users from repeatedly clicking on web links, thereby simplifying user operations.
[0161] Optionally, the processor 1010 is further used to extract target content matching the target information from the content corresponding to the first search result, and the target content is used to generate a fragment to obtain N1 fragments; when the similarity between at least two fragments is greater than a first threshold, retain one of the at least two fragments based on feature information of the at least two fragments to obtain the N2 fragments; wherein the feature information of the at least two fragments includes: semantic matching information, source page address information, and author information.
[0162] Optionally, the processor 1010 is further used to arrange the N2 fragments in the first position respectively to obtain N2 first positions; based on the N2 first positions, respectively obtain the matching values of the fragments other than the fragment at the first position in the N2 fragments arranged in the second position to obtain N2*(N2-1) matching values; among the N2*(N2-1) matching values, retain the arrangement corresponding to the largest first N3 matching values; in any of the N3 arrangement methods, obtain the matching values of the fragments other than the fragment at the first M positions in the N2 fragments arranged in the M+1th position to obtain N3*(N2-M) matching values; among the N3*(N2-M) matching values, retain the arrangement corresponding to the largest first N3 matching values; wherein M is a positive integer, and in the repeated steps, M is equal to 2, 3...(N2-1) respectively.
[0163] Optionally, the processor 1010 is also used to, in any file, when the first fragment is arranged in the first position, if the probability of the second fragment being arranged in the second position meets a preset condition, delete the second fragment and the fragment arranged thereafter, the second position being the next position of the first position, and the N2 fragments including the first fragment and the second fragment; wherein the preset condition includes at least one of the following: when the first fragment is arranged in the first position, the probability of the second fragment being arranged in the second position is less than a second threshold value; when the first fragment is arranged in the first position, the probability fluctuation amplitude of the second fragment being arranged in the second position is greater than a third threshold value.
[0164] Optionally, the processor 1010 is further used to determine at least one file as a second search result based on feature information of N3 files; wherein the feature information of the file includes: related information between two adjacent fragments in the file, feature information of each fragment in the file, and matching information between each fragment in the file and the target information.
[0165] In summary, the purpose of this application is to provide a method for automatically generating search answers and quickly displaying them to users. During the search process, semantic retrieval and matching are first performed on the user's search terms, and fragments are extracted from the preliminary searched web pages to remove redundant results. Then, based on the strength relationship between the fragments, the probability of the order between the two is calculated, and the contribution of the fragments themselves to the results is combined to generate candidate files. Furthermore, the fluency of the file content is judged, abnormal points are found and trimmed, and finally sorted according to semantic matching, authority and fluency, and the better files are displayed to the user, which is convenient for the user to quickly browse the search results, ensuring both search efficiency and accuracy, and improving the user experience.
[0166] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video image obtained by the image capture device (such as a camera) in the video image capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and an action rod, which will not be repeated here. The memory 1009 can be used to store software programs and various data, including but not limited to applications and action systems. The processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes the action system, user pages and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1010.
[0167] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0168] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0169] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned search method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0170] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0171] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned search method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0172] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0173] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned search method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0174] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0175] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0176] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A search method, It is characterized in that The method comprises: According to the target information, obtain N1 first search results matching the target information, where N1 is a positive integer; Determine N2 segments corresponding to the target information according to the contents of the N1 first search results, where N2 is a positive integer and N1≧N2; the N2 segments are obtained by integrating the contents of the N1 first search results; Arrange and combine the N2 fragments according to N3 arrangements to obtain N3 corresponding files, where N3 is a positive integer; determining at least one file as a second search result, and outputting the second search result; The arranging and combining the N2 fragments according to N3 arrangement modes includes: Arranging the N2 fragments at the first position respectively to obtain N2 first positions; Based on the N2 first positions, respectively obtain the matching values of the other fragments arranged at the second positions in the N2 fragments except the fragment at the first position, to obtain N2*(N2-1) matching values; Among the N2*(N2-1) matching values, keep the arrangement corresponding to the largest first N3 matching values; In any of the N3 arrangements, obtain the matching values of the other fragments arranged at the M+1th position among the N2 fragments except the fragments at the first M positions, and obtain N3*(N2-M) matching values; Among the N3*(N2-M) matching values, keep the arrangement corresponding to the largest first N3 matching values; Here, M is a positive integer, and in the repeated steps, M is equal to 2, 3, ... (N2-1) respectively.
2. The method according to claim 1, It is characterized in that The determining, according to the content of the N1 first search results, N2 segments corresponding to the target information includes: Extracting target content matching the target information from content corresponding to the first search result, wherein the target content is used to generate a segment, thereby obtaining N1 segments; When the similarity between the at least two segments is greater than a first threshold, retaining one of the at least two segments according to feature information of the at least two segments, to obtain the N2 segments; The feature information of the at least two fragments includes: semantic matching information, source page address information, and author information.
3. The method according to claim 1, It is characterized in that Before determining at least one file as the second search result, the method further includes: In any file, when the first segment is arranged in the first position, if the probability of the second segment being arranged in the second position meets a preset condition, the second segment and the segment arranged thereafter are deleted, the second position is the position next to the first position, and the N2 segments include the first segment and the second segment; The preset condition includes at least one of the following: When the first segment is arranged at the first position, the probability that the second segment is arranged at the second position is less than a second threshold; When the first segment is arranged at the first position, the probability fluctuation amplitude of the second segment being arranged at the second position is greater than a third threshold.
4. The method according to claim 1, It is characterized in that The determining at least one file as a second search result includes: Determine at least one file as a second search result based on the characteristic information of the N3 files; The characteristic information of the file includes: related information between two adjacent segments in the file, characteristic information of each segment in the file, and matching information between each segment in the file and the target information.
5. A search device, It is characterized in that The device comprises: An acquisition module, configured to acquire, according to the target information, N1 first search results matching the target information, where N1 is a positive integer; A first determination module is used to determine N2 segments corresponding to the target information according to the content of the N1 first search results, where N2 is a positive integer and N1≧N2; the N2 segments are obtained by integrating the content of the N1 first search results; an arrangement module, configured to arrange and combine the N2 fragments according to N3 arrangement modes to obtain N3 corresponding files, where N3 is a positive integer; A second determination module, configured to determine at least one file as a second search result, and output the second search result; The arrangement module comprises: an arranging unit, used for arranging the N2 fragments at the first position respectively to obtain N2 first positions; A first acquisition unit is used to respectively acquire, based on the N2 first positions, matching values of the other fragments arranged at the second positions in the N2 fragments except the fragment at the first position, to obtain N2*(N2-1) matching values; A second retaining unit is used to retain the arrangement corresponding to the largest first N3 matching values among the N2*(N2-1) matching values; A second acquisition unit is used to acquire, in any one of the N3 arrangements, matching values of the other fragments arranged at the M+1th position among the N2 fragments except the fragments at the first M positions, to obtain N3*(N2-M) matching values; A third retaining unit is used to retain the arrangement corresponding to the largest first N3 matching values among the N3*(N2-M) matching values; Here, M is a positive integer, and in the repeated steps, M is equal to 2, 3, ... (N2-1) respectively.
6. The device according to claim 5, It is characterized in that The first determining module includes: An extraction unit, configured to extract target content matching the target information from content corresponding to the first search result, wherein the target content is used to generate a segment, thereby obtaining N1 segments; a first retaining unit, configured to retain one of the at least two fragments according to feature information of the at least two fragments when the similarity between the at least two fragments is greater than a first threshold, so as to obtain the N2 fragments; The feature information of the at least two fragments includes: semantic matching information, source page address information, and author information.
7. The device according to claim 5, It is characterized in that The device also includes: a deleting module, configured to, in any file, when a first segment is arranged in a first position, delete the second segment and a segment arranged thereafter if a probability that a second segment is arranged in a second position meets a preset condition, wherein the second position is a position next to the first position, and the N2 segments include the first segment and the second segment; The preset condition includes at least one of the following: When the first segment is arranged at the first position, the probability that the second segment is arranged at the second position is less than a second threshold; When the first segment is arranged at the first position, the probability fluctuation amplitude of the second segment being arranged at the second position is greater than a third threshold.
8. The device according to claim 5, It is characterized in that The second determining module includes: a determining unit, configured to determine at least one file as a second search result based on the feature information of the N3 files; The characteristic information of the file includes: related information between two adjacent segments in the file, characteristic information of each segment in the file, and matching information between each segment in the file and the target information.
9. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the search method according to any one of claims 1 to 4 are implemented.
10. A readable storage medium, It is characterized in that The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the search method according to any one of claims 1 to 4 are implemented.
