Cross-field retrieval method and device supporting fuzzy intention, medium and electronic equipment
By segmenting word, merging inverted chaining and applying depth-first search algorithms in cross-field search, the problems of high training cost of intent recognition model and inaccurate recall in cross-field search are solved, and the precise search recall and results across multiple fields are achieved Sort.
Patent Information
- Application Number
- CN202411313002.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-03
AI Technical Summary
The prior art is difficult to accurately recall relevant results in cross-field retrieval, and the intent identification model training is expensive and has biased, so it cannot be widely used.
By receiving query strings and word segmentation, searching keywords in multiple cross-field inversion tables for keywords, obtaining splicing inversion chains, combining inversion chains for each keyword, obtaining document content based on the forward-row table, supporting spanning multiple fields The query uses a depth-first search algorithm and preset pruning conditions to filter subfields, calculate the correlation score and sort the results.
It realizes that the relevant search results are recalled accurately without specifying specific fields, which reduces the training cost and error of the intent identification model, and improves the search efficiency and accuracy.
Smart Images

Figure CN119248922A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and more specifically, to a cross-field search method supporting fuzzy intent, a cross-field search device supporting fuzzy intent, a computer-readable storage medium, and an electronic device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims, and no description herein is admitted to be prior art by inclusion in this section.
[0003] Retrieval usually refers to a quick search of the data held based on the keywords provided by the user, so as to return the search results corresponding to the search requirements to the user within the allowable time. In order to improve the search efficiency and shorten the response time, the data held can be indexed before the search begins, and different types of information can be associated with different index fields. For example, articles can be associated with different index fields such as title, author, content, etc., and songs can be associated with different index fields such as song name, artist name, album name, lyrics, etc. In actual search scenarios, users usually do not specify specific index fields, so that the search request spans multiple field contents. For cross-field search requests, the user's search string can currently be identified for intent, and the search string can be understood and rewritten through natural language processing technology, and the processed search string can be used for actual search.
[0004] However, the intent recognition of search strings requires the training and maintenance of complex models, which is difficult to build and has high operating costs. It also requires a large amount of user data training to improve accuracy. Once there is a deviation in the understanding of intent, relevant search results cannot be recalled and cannot be widely used. Summary of the invention
[0005] In this context, embodiments of the present disclosure are intended to provide a cross-field search method supporting fuzzy intent, a cross-field search device supporting fuzzy intent, a computer-readable storage medium, and an electronic device.
[0006] According to a first aspect of an embodiment of the present disclosure, a cross-field retrieval method supporting fuzzy intent is provided, and the method may include: receiving a query string, and performing word segmentation on the query string to obtain at least one keyword; searching for the keyword in multiple cross-field inverted lists, and obtaining corresponding concatenated inverted chains according to the matched concatenated fields; each cross-field inverted list stores a mapping from a concatenated field to a concatenated inverted chain, the concatenated field includes more than two subfields, the concatenated inverted chain is a union of sub-inverted chains corresponding to the more than two subfields, and the sub-inverted chains are a set of document numbers; merging the concatenated inverted chains corresponding to each keyword to obtain a query inverted chain corresponding to the query string; obtaining corresponding query document content in a forward list based on the query inverted chain; the forward list stores a mapping from document numbers to document contents.
[0007] Optionally, before obtaining the corresponding query document content in the forward list based on the query inverted index, the method further includes: determining a hit field for each document number in the query string recall query inverted index based on at least one subfield hit by each keyword in the corresponding concatenated field.
[0008] Optionally, before determining the hit field of each document number in the query string recall query inverted chain based on at least one subfield hit by each keyword on the corresponding concatenated field, it also includes: obtaining original position information of each subfield in the concatenated field and the hit position information of the keyword on the corresponding concatenated field; comparing the original position information with the hit position information to determine at least one subfield hit by the keyword on the corresponding concatenated field.
[0009] Optionally, based on at least one subfield that each keyword hits on the corresponding concatenated field, the hit field of each document number in the query string recall query inverted chain is determined, including: based on a depth-first search algorithm, determining different subfield combinations corresponding to the query string based on the subfields that each keyword hits; filtering the subfield combinations that do not meet the preset pruning conditions to obtain target subfield combinations, and determining the hit field of each document number in the query string recall query inverted chain based on each target subfield combination.
[0010] Optionally, the preset pruning condition includes at least one of the following: the order of subfields in the subfield combination does not backtrack; the number of subfields in the subfield combination is the smallest.
[0011] Optionally, obtaining the corresponding query document content in the forward list based on the query inverted chain also includes: determining a preset weight corresponding to the hit field; calculating a relevance score between the query string and the query document content based on the preset weight, the hit field and the corresponding keyword; and sorting the query document content based on the relevance score.
[0012] Optionally, the steps of constructing a cross-field postings table include: obtaining original fields; concatenating the original fields to obtain a concatenated field; segmenting the concatenated field to obtain two or more sub-fields; obtaining a sub-postings chain corresponding to each sub-field, and using the union of the sub-postings chains as a concatenated postings chain corresponding to the concatenated field to construct a cross-field postings table.
[0013] According to a second aspect of an embodiment of the present disclosure, a cross-field search device supporting fuzzy intent is provided, and the device may include: a query string segmentation module, used to receive a query string, and segment the query string to obtain at least one keyword; a cross-field search module, used to search for the keyword in multiple cross-field inverted lists, and obtain the corresponding spliced inverted chain according to the matched spliced field; each cross-field inverted list stores a mapping from a spliced field to a spliced inverted chain, the spliced field includes more than two sub-fields, the spliced inverted chain is the union of sub-inverted chains corresponding to the more than two sub-fields, and the sub-inverted chain is a set of document numbers; a search result acquisition module, used to merge the spliced inverted chains corresponding to each keyword, and obtain the query inverted chain corresponding to the query string; the search result acquisition module is also used to obtain the corresponding query document content in the forward list based on the query inverted chain; the forward list stores the mapping from the document number to the document content.
[0014] Optionally, the device further includes: an intention reasoning module, configured to determine a hit field for each document number in the query string recall query inverted index chain according to at least one subfield hit by each keyword on the corresponding concatenated field.
[0015] Optionally, the intention reasoning module is also used to obtain the original position information of each subfield in the spliced field, and the hit position information of the keyword on the corresponding spliced field; and, compare the original position information with the hit position information to determine at least one subfield hit by the keyword on the corresponding spliced field.
[0016] Optionally, the intent reasoning module is specifically used to determine different subfield combinations corresponding to the query string based on the subfields hit by each keyword based on a depth-first search algorithm; and to filter the subfield combinations that do not meet the preset pruning conditions to obtain target subfield combinations, and determine the hit field of each document number in the query string recall query inverted chain based on each target subfield combination.
[0017] Optionally, the preset pruning condition includes at least one of the following: the order of subfields in the subfield combination does not backtrack; the number of subfields in the subfield combination is the smallest.
[0018] Optionally, the retrieval result processing module is used to determine the preset weight corresponding to the hit field; calculate the relevance score between the query string and the query document content based on the preset weight, the hit field and the corresponding keyword; and sort the query document content based on the relevance score.
[0019] Optionally, a cross-field inverted list construction module is used to obtain original fields; concatenate the original fields to obtain a concatenated field; segment the concatenated field to obtain two or more sub-fields; and obtain a sub-inverted list chain corresponding to each sub-field, and use the union of the sub-inverted lists as the concatenated inverted list chain corresponding to the concatenated field to construct a cross-field inverted list.
[0020] According to a third 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, any one of the above-mentioned cross-field retrieval methods supporting fuzzy intent is implemented.
[0021] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned cross-field retrieval methods supporting fuzzy intent by executing the executable instructions.
[0022] According to the cross-field retrieval method supporting fuzzy intent in the embodiment of the present disclosure, on the basis of the query string segmentation, the obtained keywords are searched in multiple cross-field inverted tables to obtain the corresponding spliced inverted chains according to the matched spliced fields, wherein each cross-field inverted table stores a mapping from a spliced field to a spliced inverted chain, the spliced field includes more than two subfields, the spliced inverted chain is the union of the sub-inverted chains corresponding to the two or more subfields, and the sub-inverted chain is a set of document numbers; on this basis, the spliced inverted chains corresponding to each keyword are merged to obtain the query inverted chain corresponding to the query string, and then the corresponding query document content is obtained in the forward table based on the query inverted chain, wherein the forward table stores the mapping from the document number to the document content. The method can perform a query across multiple subfields based on the cross-field inverted table for the query string provided by the query party, effectively and accurately recall the retrieval results, and can be widely used. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0024] Figure 1 One of the step flow charts of the cross-field retrieval method supporting fuzzy intent according to an embodiment of the present disclosure is shown.
[0025] Figure 2 A flowchart of the steps of a method for constructing a cross-field inverted list according to an embodiment of the present disclosure is shown.
[0026] Figure 3 A schematic diagram of a cross-field inverted table storage structure of an embodiment of the present disclosure is shown.
[0027] Figure 4 The second step flow chart of the cross-field search method supporting fuzzy intent according to an embodiment of the present disclosure is shown.
[0028] Figure 5 A schematic diagram of the deep optimization search algorithm flow of an embodiment of the present disclosure is shown.
[0029] Figure 6 A schematic diagram of a cross-field search device supporting fuzzy intent according to an embodiment of the present disclosure is shown.
[0030] Figure 7 A schematic diagram of a computer-readable storage medium according to an embodiment of the present disclosure is shown.
[0031] Figure 8 A schematic diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0032] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0033] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0034] According to an embodiment of the present disclosure, a cross-field search method supporting fuzzy intent, a cross-field search device supporting fuzzy intent, a computer-readable storage medium, and an electronic device are provided.
[0035] In this document, any number of elements in the drawings is used for illustration rather than limitation, and any naming is used only for distinction and does not have any limiting meaning.
[0036] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
[0037] In conventional retrieval and recommendation business scenarios, in order to optimize the recall strategy of retrieval results, each document content can be mapped to a document number, and a set of corresponding document numbers under different fields can be established. The field can be extracted from the document content, where the forward index is the index of the document number pointing to the document content, and the inverted index is the document number corresponding to each field, and different fields do not affect each other. When the query party provides a query term, the document number corresponding to the field is used as a candidate set for query or recommendation by matching the field.
[0038] In most search scenarios, the querying party will not explicitly specify the specific fields to be searched, and the query string may also include the contents of multiple fields. In this case, searching under a single field cannot achieve a match, and thus it is impossible to recall appropriate query results.
[0039] To address the above issues, we can currently use intent recognition models to analyze query strings, understand and rewrite query strings through natural language processing technology, and use the processed query strings for actual retrieval. Due to the complex structure of intent recognition models, their training costs are high, time-consuming, and difficult to deploy widely. In addition, the use of intent recognition models to analyze query strings may also result in deviations or errors, resulting in inaccurate recall.
[0040] In the embodiments of the present disclosure, after the query string is segmented, the keywords obtained are searched in multiple cross-field inverted lists; wherein each cross-field inverted list stores a mapping from a spliced field to a spliced inverted chain, the spliced field includes more than two sub-fields, the spliced inverted chain is the union of the sub-inverted chains corresponding to the two or more sub-fields, and the sub-inverted chain is a collection of document numbers. On this basis, cross-field search can be performed directly on each keyword, and the spliced inverted chains corresponding to each keyword are merged to obtain the query inverted chain corresponding to the query string, and then the query document content corresponding to the query string is obtained in the forward list, so that when the query party does not specify a specific search field, the search request spanning multiple field contents can also accurately recall relevant search results.
[0041] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.
[0042] Exemplary application scenarios
[0043] It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principle of the present invention, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0044] The cross-field retrieval method supporting fuzzy intent according to the embodiments of the present disclosure can be applied to a variety of application scenarios involving document content retrieval and recommendation.
[0045] In one application scenario, the document content may be a song, and the document number may be a song number. The concatenated fields may include sub-fields such as the song name field, the artist name field, and the album name field, and the concatenated inverted index may include the union of the sub-inverted indexes corresponding to the sub-fields such as the song name field, the artist name field, and the album name field. The document number may be a song number, such as song number 001 corresponding to the song "Where is Spring", song number 002 corresponding to the song "Only Mom Is Good in the World", and so on. Thus, the song numbers related to the query string can be recalled across the field content.
[0046] In another application scenario, the document content may be a book, and the document number may be a book number. The concatenated fields may include subfields such as the book name field, the author name field, and the publisher field, and the concatenated postings chain may include the union of the sub-postings chains corresponding to the subfields such as the book name field, the author name field, and the publisher field. The document number may be a book number, such as book number 001 corresponding to the book "Journey to the West", book number 002 corresponding to "Water Margin", and so on. Thus, the book numbers related to the query string can be recalled across the field content.
[0047] It can also be applied in other retrieval and recommendation scenarios. The document content may include news, products, etc., and the embodiments of the present disclosure do not impose specific limitations on this.
[0048] Exemplary Methods
[0049] In combination with the above application scenarios, Figure 1 A cross-field retrieval method supporting fuzzy intent according to an exemplary embodiment of the present disclosure is described.
[0050] like Figure 1 One of the step flow charts of the cross-field search method supporting fuzzy intent in the exemplary embodiment of the present disclosure may include the following steps 101 to 104:
[0051] Step 101: Receive a query string and segment the query string to obtain at least one keyword.
[0052] In the embodiments of the present disclosure, the query string is a string provided by the querying party for requesting retrieval or recommendation. The querying party may provide data in various forms such as text, image or audio for querying. When receiving text data, it may be directly used as the query string. When receiving image, audio and other data, the query string may be obtained after text extraction or recognition. On this basis, the query string may be segmented to obtain at least one keyword. Those skilled in the art may select a segmentation scheme based on actual needs, and the embodiments of the present disclosure do not impose specific restrictions on this.
[0053] For example, a query (query string) is received and the query is segmented to obtain token1 (keyword) and token2.
[0054] Step 102: Search for keywords in multiple cross-field postings tables, and obtain corresponding concatenated postings links according to the matched concatenated fields; each cross-field postings table stores a mapping from a concatenated field to a concatenated postings link, the concatenated field includes more than two sub-fields, the concatenated postings link is the union of sub-postings links corresponding to the more than two sub-fields, and the sub-postings links are a collection of document numbers.
[0055] In the embodiments of the present disclosure, multiple cross-field inverted lists are provided. Each cross-field inverted list can store a mapping from a spliced field to a spliced inverted chain. The spliced field can be composed of two or more sub-fields, such as spliced field 1 can include sub-field A, sub-field B and sub-field C, and spliced field 2 can include sub-field D, sub-field E and sub-field F. The embodiments of the present disclosure do not impose specific restrictions on this.
[0056] Furthermore, each subfield has its corresponding child postings link, which is the document number corresponding to the document content associated with the subfield. Therefore, the concatenated postings link corresponding to the concatenated field can be the union of the child postings links corresponding to the subfields it contains, that is, the concatenated postings link is the document number corresponding to the document content associated with the concatenated field.
[0057] On this basis, the keyword is searched in multiple cross-field inverted index tables, and a match can be determined when the keyword hits at least one subfield of the concatenated field, so as to obtain the concatenated inverted index chain corresponding to the matched concatenated field.
[0058] For example, if token1 hits subfield A and matches concatenation field 1, then concatenation postings index 1 corresponding to concatenation field 1 is obtained; if token2 hits subfield E and matches concatenation field 2, then concatenation postings index 2 corresponding to concatenation field 2 is obtained.
[0059] Step 103: merge the concatenated postings links corresponding to each keyword to obtain a query postings link corresponding to the query string.
[0060] In the disclosed embodiment, the concatenated postings lists corresponding to each keyword may be merged based on step 102 to obtain a query postings list corresponding to the query string. At this time, the concatenated postings lists corresponding to the keywords may be merged by determining the intersection so that the obtained query postings list meets the hit of each keyword in the query string.
[0061] For example, the intersection of concatenated postings index 1 corresponding to token1 and concatenated postings index 2 corresponding to token2 is taken to obtain the query postings index corresponding to query.
[0062] Step 104: Obtain the corresponding query document content in the forward-order table based on the query postings chain; the forward-order table stores the mapping from the document number to the document content.
[0063] In the disclosed embodiment, the forward table stores the mapping from document number to document content. Based on the document number contained in the query inverted chain, the specific document content can be located in the forward table, thereby determining the query document content recalled by the query string.
[0064] For example, based on the query inverted index corresponding to the query, the query document content corresponding to the query is obtained in the forward index table.
[0065] In an optional method embodiment of the present disclosure, a step of constructing a cross-field inverted table is also provided. Figure 2 The flowchart of the step of the method for constructing a cross-field inverted list according to the exemplary embodiment of the present disclosure may include the following steps 201 to 204 .
[0066] Step 201: Get the original field.
[0067] In the disclosed embodiment, the original field may be a field directly extracted from the field information of the document content to characterize the characteristics of the document content. When constructing a cross-field inverted index table, the document content to be indexed and its corresponding document number may be determined based on the forward index table.
[0068] For example, taking the document content of the song "Where is Spring" as an example, multiple field information may include the song name "Where is Spring", the artist name "Children's Choir", the album name "Classic Children's Songs", etc. The aforementioned field information can be classified into different fields (original fields) respectively.
[0069] Step 202: concatenate the original fields to obtain concatenated fields.
[0070] In the embodiment of the present disclosure, different original fields obtained can be spliced to obtain a spliced field. Further, attribute information such as the original fields used to construct the spliced field and the splicing order can be recorded.
[0071] For example, by splicing fied, we get the crossfield “Where is Spring; Children’s Choir; Classic Nursery Rhymes”.
[0072] Step 203: Segment the concatenated field to obtain two or more subfields.
[0073] In the embodiment of the present disclosure, the concatenated field can be further segmented, and the segmentation scheme used is consistent with the segmentation scheme for the query string, so as to obtain more than two different subfields. In the segmentation process, the original position information of each subfield in the concatenated field can be further saved.
[0074] For example, the crossfield "where is spring; children's choir; classic nursery rhymes" is segmented to obtain subfields "spring", "choir", "children's rhymes", etc. At this time, the original position information of the subfield can be saved, such as the original position information of "spring" can be recorded as "0:2" in the concatenated field, and "choir" can be recorded as "9:2", etc., including the position of the first character of the subfield and the length of the subfield.
[0075] When recording the original position information, if the subfield appears twice or more in the concatenated field, it can be recorded in the order in which it appears. For example, when the crossfield "Only Mom is Good in the World; Children's Choir; Only Mom is Good in the World" obtained by concatenating fields such as the song name "Only Mom is Good in the World", the artist name "Children's Choir", and the album name "Only Mom is Good in the World" is segmented, and one of the subfields "Mom" is obtained, its original position information in the concatenated field can be recorded as "4:2" and "19:2".
[0076] Step 204: Obtain the sub-postings links corresponding to each sub-field, and use the union of the sub-postings links as the concatenated postings link corresponding to the concatenated field, so as to construct a cross-field postings table.
[0077] In the embodiments of the present disclosure, based on the subfield, the document content containing the subfield can be further obtained, and on this basis, the document number of the document content is constructed as a set as the sub-postings chain corresponding to the subfield. After the sub-postings chain of each subfield is determined, the union of each sub-postings chain can be determined as the spliced postings chain corresponding to the spliced field, thereby constructing a spliced field to spliced postings chain mapping.
[0078] For example, for the crossfield "Where is spring; Children's choir; Classic nursery rhymes", the subfield "spring" is used to determine the document content containing the subfield, and the document number corresponding to the document content is incorporated into the sub-postings chain corresponding to the subfield.
[0079] In an optional implementation of the present disclosure, the document number can be recorded in a roaring bitmap data structure, that is, "1" indicates that the document number of the corresponding bit position exists, and "0" indicates that the document number of the corresponding bit position does not exist. Figure 3 A schematic diagram of a cross-field inverted table storage structure of an exemplary embodiment of the present disclosure is shown, wherein the concatenated field includes a subfield a and a subfield b.
[0080] The document numbers include 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10, which are placed in the corresponding bits.
[0081] On this basis, if the document numbers corresponding to the document content contained in subfield a are 1, 2, 6, 8, and 10, then the corresponding sub-postings chains have bits 1 at 1, 2, 6, 8, and 10, and the remaining bits are 0; and so on, if the document numbers corresponding to the document content contained in subfield b are 3, 4, 5, 9, and 10, then the corresponding sub-postings chains have bits 1 at 3, 4, 5, 9, and 10, and the remaining bits are 0.
[0082] like Figure 4 The second step flow of the cross-field search method supporting fuzzy intent in the exemplary embodiment of the present disclosure may include the following steps 401 to 410:
[0083] Step 401: Receive a query string and segment the query string to obtain at least one keyword.
[0084] In the embodiment of the present disclosure, step 401 may correspond to the relevant description of the aforementioned step 101, and will not be described again here to avoid repetition.
[0085] Step 402: Search for keywords in multiple cross-field postings tables, and obtain corresponding concatenated postings links according to the matched concatenated fields; each cross-field postings table stores a mapping from a concatenated field to a concatenated postings link, the concatenated field includes more than two sub-fields, the concatenated postings link is the union of the sub-postings links corresponding to the more than two sub-fields, and the sub-postings links are a collection of document numbers.
[0086] In the embodiment of the present disclosure, step 402 may correspond to the relevant description of the aforementioned step 102, and will not be described again here to avoid repetition.
[0087] Step 403: merge the concatenated postings links corresponding to each keyword to obtain a query postings link corresponding to the query string.
[0088] In the embodiment of the present disclosure, step 403 may correspond to the relevant description of the aforementioned step 103, and will not be described here to avoid repetition.
[0089] Step 404: Determine the hit field of each document number in the query string recall query inverted index chain according to at least one subfield hit by each keyword in the corresponding concatenated field.
[0090] In the embodiment of the present disclosure, when the keyword is recalling the corresponding sub-postings chain, it may hit one or more sub-fields in the concatenated field, then each document number in the sub-postings chain is recalled by the keyword with the sub-field hit. The sub-field hit by the keyword in the concatenated field can be used as the hit field, and the hit field can characterize the query intent of the query string. On this basis, by counting the sub-fields hit by each keyword in the corresponding concatenated field, the hit field of the query string when recalling each document number in the postings chain can be determined. The statistics of the hit field can be an information supplement to the search results, thereby further improving the reliability of the search results. According to the hit field, the query party can understand the search process from multiple dimensions to determine whether the search results meet expectations; or, it can also be based on the hit field. Further analysis is performed before providing the search results to the query party to decide whether to further filter the search results or adjust the way of displaying the search results to improve the accuracy of the search recall. The embodiment of the present disclosure does not impose specific restrictions on this.
[0091] In an optional implementation of the present disclosure, the following steps 405 to 406 may be included before step 404.
[0092] Step 405: Obtain the original position information of each subfield in the concatenated field, and the hit position information of the keyword in the corresponding concatenated field.
[0093] Step 406: Compare the original position information with the hit position information to determine at least one subfield hit by the keyword in the corresponding concatenated field.
[0094] In the embodiment of the present disclosure, when determining the subfield that hits each keyword on the corresponding concatenated field, the original position information of each subfield in the concatenated subfield and the hit position information of the keyword on the corresponding concatenated field can be obtained. The position information can be represented by the starting position and the length of the string in the concatenated field, or by the starting position and the ending position of the string in the concatenated field, and the embodiment of the present disclosure does not impose any specific restrictions on this.
[0095] When the position information is represented by the starting position of the string in the concatenated field and the length of the string, the original position information can refer to the relevant description of the aforementioned step 203. To avoid repetition, it will not be repeated here. The hit position information can be represented by the "starting position: string length" of the keyword hit in the concatenated field with reference to the original position information. On this basis, the original position information can be compared with the hit position information to determine the subfield actually hit by the keyword in the concatenated field. Among them, when two or more subfields are included in the original position information of the concatenated field, they are regarded as different subfields, so that the keyword can hit different subfields in the concatenated field at the same time.
[0096] In an optional embodiment of the present disclosure, since the segmented words may include different keywords, and the concatenated field also includes different subfields, each keyword may hit one or more subfields, and thus the query string may hit multiple subfields. At this time, step 404 may include the following steps A1 to A2.
[0097] Step A1: Based on a depth-first search algorithm, different subfield combinations corresponding to the query string are determined according to the subfields hit by each keyword.
[0098] In the embodiment of the present disclosure, the query string can be segmented to obtain keywords in the inverted search stage, and then searched in the cross-field inverted table respectively. Further, different sub-field combinations corresponding to the query string can be constructed through the sub-fields hit by each keyword, so as to characterize the possible query intent of the query string based on the sub-fields.
[0099] like Figure 5 The flowchart of the deep optimization search algorithm of the exemplary embodiment of the present disclosure is shown, wherein the query string is segmented to obtain keyword 1, keyword 2 and keyword 3, and it is assumed that there are concatenated fields including subfield A, subfield B and subfield C. Among them, keyword 1 hits subfield A and subfield C, keyword 2 hits subfield A and subfield C, and keyword 3 hits subfield B, and possible subfield combinations are searched based on the deep optimization search algorithm.
[0100] Starting from keyword 1 hitting subfield A, the combination with keyword 2 is searched including subfield combination AA and subfield combination AC, and the combination with keyword 3 is further searched including subfield combination AAB and subfield combination ACB.
[0101] Starting from keyword 1 hitting subfield C, the combination with keyword 2 is searched including subfield combination CA and subfield combination CC, and the combination with keyword 3 is further searched including subfield combination CAB and subfield combination CCB.
[0102] On this basis, the sub-field combination AAB, the sub-field combination ACB, the sub-field combination CAB and the sub-field combination CCB corresponding to the query string are obtained.
[0103] Step A2: Filter the subfield combinations that do not meet the preset pruning conditions to obtain target subfield combinations, and determine the hit field of each document number in the query string recall query inverted index chain according to each target subfield combination.
[0104] In the disclosed embodiment, based on the different subfield combinations corresponding to the query string, a preset pruning condition can be set according to the actual query intent requirement of constructing the query string by keywords, so as to filter the subfield combinations that do not meet the preset pruning and obtain the target subfield combination. The target subfield combination includes the subfields that are hit when the keyword recalls the document number, and the combination of the subfields meets the query intent of the query party based on the preset pruning condition. At this time, the subfields in the target subfield combination can be determined as the hit fields of the document number in the query string recall query inversion chain.
[0105] In an optional embodiment of the present disclosure, the preset pruning condition includes at least one of the following B1 to B2.
[0106] Preset pruning condition B1: the order between subfields in the subfield combination does not backtrack.
[0107] When a subfield combination includes multiple subfields, you can prune those that have sequential backtracking, where sequential backtracking means that a subfield that has already appeared appears repeatedly after being separated by other subfields. For example, the subfield combination ABA. Based on statistical analysis, it can be seen that when the query party constructs a query string, they usually use the field combination method, and will not split the fields and combine them in random order, such as not inserting the artist name into the song name after splitting. Therefore, by pruning the subfield combination that has sequential backtracking, the query intent can be better represented.
[0108] Preset pruning condition B2: the number of subfields in the subfield combination is the smallest.
[0109] When a subfield combination includes multiple subfields, the subfields with a non-minimum number of subfields can be pruned. For example, the number of subfields in the subfield combination ABB is 2, and the number of subfields in the subfield combination ABC is 3. The subfield combination ABC can be pruned. Based on statistical analysis, it can be known that when constructing a query string, the query party usually tends to select fewer different subfields. Therefore, by pruning the subfield combination with a non-minimum number of subfields, the query intent can be better represented.
[0110] Furthermore, it can be considered that multiple subfields in the same original field are more in line with the idea of constructing a query string than spanning multiple original fields.
[0111] The above description of the preset pruning conditions is only for example. Those skilled in the art may set the preset pruning conditions for applications according to actual needs, and the embodiments of the present disclosure do not impose any specific limitations on this.
[0112] like Figure 5 As shown, pruning is performed based on preset pruning conditions in the subfield combinations AAB, ACB, CAB and CCB corresponding to the query string to obtain subfield combinations AAB and CCB, and then the same subfields are merged to obtain subfield combination AB or subfield combination CB.
[0113] Then the hit fields of the query string when recalling the document number are subfield A and subfield B, or subfield C and subfield B.
[0114] Step 407: Obtain the corresponding query document content in the forward-order table based on the query postings chain; the forward-order table stores the mapping from the document number to the document content.
[0115] In the embodiment of the present disclosure, step 407 may correspond to the relevant description of the aforementioned step 104, and will not be described again here to avoid repetition.
[0116] For example, based on the document number in the query inverted index, the corresponding query document content is obtained, and when returning the search results, it can be in the form of [query document content, hit field AB].
[0117] In an embodiment of the present disclosure, the display mode of the obtained query document content may also be adjusted to provide more efficient and accurate search results based on the query intention of the query party. Specifically, in an optional embodiment of the present disclosure, after step 407, the following steps 408 to 410 may also be included.
[0118] Step 408: Determine the preset weight corresponding to the hit field.
[0119] In the embodiments of the present disclosure, a preset weight may be configured for a subfield, and the preset weight may be determined based on a statistical analysis of the query string. For example, the higher the frequency with which the subfield is used in the query string of the query party's history, the higher the preset weight; or the higher the proportion of retrieval results recalled based on the subfield that are triggered by the query party, the higher the preset weight. The embodiments of the present disclosure do not impose any specific restrictions on this.
[0120] On this basis, after the subfield is confirmed as a hit field, the preset weight corresponding to the hit field can be determined for subsequent relevance analysis.
[0121] Step 409: Calculate the relevance score between the query string and the query document content based on the preset weights, the hit fields and the corresponding keywords.
[0122] In the disclosed embodiment, the relevance can be calculated based on the keywords and the corresponding hit fields, and the relevance can be weighted with a preset weight to obtain the relevance score between the query string and the content of the recalled query document. Among them, the keywords and the corresponding hit fields can be used as the relevance score of a single keyword by calculating the BM25 score. By calculating the relevance score between the hit field and the keyword, the interference of other irrelevant subfields in the spliced field can be effectively avoided.
[0123] For example, [query document content, hit field AB], the preset weight of subfield A is 2, and the preset weight of subfield B is 1.
[0124] The BM25 score calculated for keyword 1 and the corresponding hit field A is 0.5, which is multiplied by the preset weight 2 to get 1.
[0125] The BM25 score calculated for keyword 2 and the corresponding hit field B is 0.4, which is multiplied by the preset weight 1 to 0.4.
[0126] On this basis, the calculation results of multiple hit fields are fused to obtain a relevance score of 1.4 between the query string and the query document content.
[0127] Step 410: Sort the query document content based on the relevance score.
[0128] In the embodiment of the present disclosure, on the basis of obtaining the relevance score, the query document content recalled by the hit field can be sorted based on the relevance between the query string and the document content represented by the relevance score, so that the document content with a higher relevance is ranked higher. For example, when a higher relevance score indicates a higher relevance, the query document content recalled by the hit field can be sorted from large to small based on the relevance score.
[0129] According to the cross-field retrieval method supporting fuzzy intent in the embodiment of the present disclosure, on the basis of the query string segmentation, the obtained keywords are searched in multiple cross-field inverted tables to obtain the corresponding spliced inverted chains according to the matched spliced fields, wherein each cross-field inverted table stores a mapping from a spliced field to a spliced inverted chain, the spliced field includes more than two subfields, the spliced inverted chain is the union of the sub-inverted chains corresponding to the two or more subfields, and the sub-inverted chain is a set of document numbers; on this basis, the spliced inverted chains corresponding to each keyword are merged to obtain the query inverted chain corresponding to the query string, and then the corresponding query document content is obtained in the forward table based on the query inverted chain, wherein the forward table stores the mapping from the document number to the document content. The method can perform a query across multiple subfields based on the cross-field inverted table for the query string provided by the query party, effectively and accurately recall the retrieval results, and can be widely used.
[0130] Furthermore, the disclosed embodiments can also confirm the hit fields of each document number when the query string is recalled to query the inverted index, so as to supplement the information of the search results, so as to facilitate the query party to understand the search process in multiple dimensions; in the process of determining the hit fields, all possible sub-field combinations based on the sub-fields hit by the keywords are traversed based on the depth-first search algorithm, and the sub-field combinations are filtered based on the preset pruning conditions to obtain the target sub-field that can represent the query intent of the query string, so as to determine the hit fields based on the target sub-fields; the relevance score between the query string and the query document content can be further calculated based on the hit fields, keywords and preset weights of the hit fields, so as to sort the query document content based on the relevance score, so as to provide the query party with a search result that is more in line with the query intent represented by its query string, thereby improving the search quality.
[0131] Exemplary Devices
[0132] After introducing the cross-field retrieval method supporting fuzzy intent according to the exemplary embodiment of the present disclosure, next, refer to Figure 6 A cross-field search device supporting fuzzy intent according to an exemplary embodiment of the present disclosure is described.
[0133] It should be noted that other specific details of the various functional modules of the cross-field retrieval device supporting fuzzy intent in the embodiment of the present disclosure have been described in detail in the implementation of the cross-field retrieval method supporting fuzzy intent mentioned above, and will not be repeated here.
[0134] Figure 6 The cross-field search device 600 supporting fuzzy intent according to an exemplary embodiment of the present disclosure is shown, comprising: a query string segmentation module 601, for receiving a query string and segmenting the query string to obtain at least one keyword; a cross-field search module 602, for searching for the keyword in multiple cross-field inverted lists, and obtaining the corresponding concatenated inverted chain according to the matched concatenated field; each cross-field inverted list stores a mapping from a concatenated field to a concatenated inverted chain, the concatenated field includes more than two sub-fields, the concatenated inverted chain is the union of sub-inverted chains corresponding to the more than two sub-fields, and the sub-inverted chain is a set of document numbers; a search result acquisition module 603, for merging the concatenated inverted chains corresponding to each keyword to obtain the query inverted chain corresponding to the query string; the search result acquisition module 603 is also used to obtain the corresponding query document content in the forward list based on the query inverted chain; the forward list stores the mapping from the document number to the document content.
[0135] In an optional implementation of the present disclosure, the device further includes: an intention reasoning module, which is used to determine the hit field of each document number in the query string recall query inverted chain based on at least one subfield hit by each keyword on the corresponding concatenated field.
[0136] In an optional implementation of the present disclosure, the intent inference module is further used to obtain the original position information of each subfield in the spliced field, and the hit position information of the keyword on the corresponding spliced field; and, compare the original position information with the hit position information to determine at least one subfield hit by the keyword on the corresponding spliced field.
[0137] In an optional implementation of the present disclosure, the intent reasoning module is specifically used to determine different subfield combinations corresponding to the query string based on the subfields hit by each keyword based on a depth-first search algorithm; and to filter the subfield combinations that do not meet the preset pruning conditions to obtain target subfield combinations, and determine the hit field for each document number in the query string recall query inverted chain based on each target subfield combination.
[0138] In an optional implementation manner of the present disclosure, the preset pruning condition includes at least one of the following: the order between subfields in the subfield combination does not backtrack; the number of subfields in the subfield combination is the smallest.
[0139] In an optional implementation of the present disclosure, a retrieval result processing module is used to determine a preset weight corresponding to a hit field; calculate a relevance score between a query string and the query document content based on the preset weight, the hit field and the corresponding keyword; and sort the query document content based on the relevance score.
[0140] In an optional implementation of the present disclosure, a cross-field postings table construction module is used to obtain original fields; concatenate the original fields to obtain a concatenated field; segment the concatenated field to obtain two or more sub-fields; and obtain a sub-postings chain corresponding to each sub-field, and use the union of the sub-postings chains as the concatenated postings chain corresponding to the concatenated field to construct a cross-field postings table.
[0141] According to the cross-field retrieval device supporting fuzzy intent in the embodiment of the present disclosure, on the basis of the query string segmentation, the obtained keywords are searched in multiple cross-field inverted tables to obtain the corresponding spliced inverted chain according to the matched spliced field, wherein each cross-field inverted table stores a mapping from a spliced field to a spliced inverted chain, the spliced field includes more than two subfields, the spliced inverted chain is the union of the sub-inverted chains corresponding to the two or more subfields, and the sub-inverted chain is a set of document numbers; on this basis, the spliced inverted chains corresponding to each keyword are merged to obtain the query inverted chain corresponding to the query string, and then the corresponding query document content is obtained in the forward table based on the query inverted chain, wherein the forward table stores the mapping from the document number to the document content. The method can perform a query across multiple subfields based on the cross-field inverted table for the query string provided by the query party, effectively and accurately recall the retrieval results, and can be widely used.
[0142] Furthermore, the disclosed embodiments can also confirm the hit fields of each document number when the query string is recalled to query the inverted index, so as to supplement the information of the search results, so as to facilitate the query party to understand the search process in multiple dimensions; in the process of determining the hit fields, all possible sub-field combinations based on the sub-fields hit by the keywords are traversed based on the depth-first search algorithm, and the sub-field combinations are filtered based on the preset pruning conditions to obtain the target sub-field that can represent the query intent of the query string, so as to determine the hit fields based on the target sub-fields; the relevance score between the query string and the query document content can be further calculated based on the hit fields, keywords and preset weights of the hit fields, so as to sort the query document content based on the relevance score, so as to provide the query party with a search result that is more in line with the query intent represented by its query string, thereby improving the search quality.
[0143] It should be noted that although several modules or units of the cross-field retrieval device supporting fuzzy intent are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0144] Exemplary computer-readable storage media
[0145] A computer-readable storage medium according to an exemplary embodiment of the present disclosure is described below.
[0146] In this exemplary embodiment, reference Figure 7 As shown, a program product 700 for implementing the above method according to an exemplary embodiment of the present disclosure is described, such as a portable compact disk read-only memory (CD-ROM) and including program code, and can be run on a device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus, or a device.
[0147] The program product 700 may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0148] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0149] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RE, etc., or any suitable combination of the foregoing.
[0150] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (FAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0151] Exemplary Electronic Devices
[0152] refer to Figure 8 An electronic device according to an exemplary embodiment of the present disclosure is described.
[0153] Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0154] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.
[0155] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 810 can perform the following steps: Figures 1 to 5 Any of the method steps shown, etc.
[0156] The storage unit 820 may include a volatile storage unit, such as a random access storage unit (RAM) 821 and / or a cache storage unit 822 , and may further include a read-only storage unit (ROM) 823 .
[0157] The storage unit 820 may also include a program / utility 824 having a set (at least one) of program modules 825, such program modules 825 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0158] The bus 830 may include a data bus, an address bus, and a control bus.
[0159] The electronic device 800 can also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and this communication can be performed through an input / output (I / O) interface 850. The electronic device 800 also includes a display unit 840, which is connected to the input / output (I / O) interface 850 for display. In addition, the electronic device 800 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs) and / or public networks, such as the Internet) through a network adapter 860. As shown in the figure, the network adapter 860 communicates with other modules of the electronic device 800 through a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0160] It should be noted that, although several modules or submodules of the device are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0161] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0162] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A cross-field retrieval method supporting fuzzy intent, characterized in that: The method comprises: receiving a query string, and performing word segmentation on the query string to obtain at least one keyword; Searching for the keyword in multiple cross-field postings tables, and obtaining corresponding concatenated postings chains according to the matched concatenated fields; each cross-field postings table stores a mapping from the concatenated field to the concatenated postings chain, the concatenated field includes more than two sub-fields, the concatenated postings chain is the union of sub-postings chains corresponding to the more than two sub-fields, and the sub-postings chains are a collection of document numbers; Merging the concatenated postings links corresponding to each of the keywords to obtain a query postings link corresponding to the query string; Based on the query postings chain, the corresponding query document content is obtained in the forward-order table; the forward-order table stores the mapping from the document number to the document content.
2. The method according to claim 1, characterized in that Before acquiring the corresponding query document content in the forward list based on the query postings chain, the method further includes: According to at least one subfield hit by each keyword on the corresponding concatenated field, a hit field of each document number in the query inverted index chain is determined by the query string recall.
3. The method according to claim 2, characterized in that Before determining the hit field of each document number in the query inverted chain recalled by the query string based on at least one subfield hit by each keyword in the corresponding concatenated field, the method further includes: Acquire original position information of each of the subfields in the concatenated field, and hit position information of the keyword on the corresponding concatenated field; The original position information is compared with the hit position information to determine at least one subfield hit by the keyword in the corresponding concatenated field.
4. The method according to claim 2, characterized in that: The step of determining the hit field of each document number in the query inverted chain recalled by the query string according to at least one subfield hit by each keyword on the corresponding concatenated field includes: Based on a depth-first search algorithm, determine different subfield combinations corresponding to the query string according to the subfields hit by each keyword; The subfield combinations that do not meet the preset pruning conditions are filtered to obtain target subfield combinations, and the query string is used to recall the hit field of each document number in the query inverted chain according to each target subfield combination.
5. The method according to claim 4, characterized in that The preset pruning condition includes at least one of the following: The order of the subfields in the subfield combination does not backtrack; The number of the subfields in the subfield combination is the smallest.
6. The method according to claim 2, characterized in that After obtaining the corresponding query document content in the forward list based on the query postings chain, the method further includes: Determine a preset weight corresponding to the hit field; Calculating a relevance score between the query string and the query document content based on the preset weight, the hit field and the corresponding keyword; The query document contents are ranked based on the relevance scores.
7. The method according to claim 1, characterized in that The steps of constructing the cross-field inverted table include: Get the original field; Splicing the original fields to obtain the spliced fields; Segmenting the concatenated field to obtain two or more subfields; The sub-postings chain corresponding to each of the sub-fields is obtained, and the union of the sub-postings chains is used as the concatenated postings chain corresponding to the concatenated field, so as to construct the cross-field postings table.
8. A cross-field search device supporting fuzzy intent, characterized in that: The device comprises: A query string segmentation module, used for receiving a query string and performing segmentation on the query string to obtain at least one keyword; a cross-field search module, configured to search for the keyword in a plurality of cross-field postings tables, and obtain a corresponding concatenated postings chain according to the matched concatenated field; each of the cross-field postings tables stores a mapping from the concatenated field to the concatenated postings chain, the concatenated field includes more than two sub-fields, the concatenated postings chain is a union of sub-postings chains corresponding to the two or more sub-fields, and the sub-postings chain is a collection of document numbers; A search result acquisition module, used for merging the concatenated postings indexes corresponding to each of the keywords to obtain a query postings index corresponding to the query string; The retrieval result acquisition module is further used to acquire the corresponding query document content in the forward-order table based on the query inverted index; the forward-order table stores the mapping from document number to document content.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cross-field retrieval method supporting fuzzy intent according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the cross-field retrieval method supporting fuzzy intent as described in any one of claims 1 to 7 by executing the executable instructions.