Information retrieval method and device, electronic equipment and computer storage medium

Through the information retrieval method of independently vectorized and spliced ​​multi-field combined text, the noise and context sparse problems caused by field length differences in traditional search are solved, the search accuracy is improved, and more accurate search results are achieved.

CN119025567APending Publication Date: 2024-11-26SHENZHEN CLOUD INTEGRAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410903719.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Traditional keyword searches in multi-field combined texts have increased noise and sparse contexts due to the difference in text lengths of different fields, resulting in a decrease in retrieval accuracy. The prior art has not effectively solved this problem.

Method used

By converting multiple text elements in user search terms independently, generating single-field vectors of each search field and splicing them into a higher-dimensional combination vector to perform matching queries in structured data tables to avoid typos , misspelling or semantic ambiguity to offset the noise impact caused by inconsistent text lengths in different fields.

Benefits of technology

It improves the accuracy of information retrieval, minimizes search errors caused by inconsistent text length and sparse context, and enhances the accuracy of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025567A_ABST
    Figure CN119025567A_ABST
Patent Text Reader

Abstract

The invention discloses an information retrieval method and device, electronic equipment and a computer storage medium, and belongs to the technical field of computers. The method comprises the steps that a user search word is obtained, search fields in a structured data table are obtained, the structured data table comprises multiple pieces of entity data, and each piece of entity data comprises text content corresponding to the multiple search fields; extracting a plurality of text elements in the user search terms by adopting the search fields; performing vector conversion on the plurality of text elements to obtain a first single-field vector corresponding to each search field; splicing the first single-field vectors to obtain a first combined vector; and querying target entity data matched with the first combination vector in the structured data table, and outputting the target entity data as a search result of the user search term. By means of the method and device, the technical problem that in the related technology, due to the difference of the lengths of different field texts, noise is increased, and finally the retrieval precision is lowered is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an information retrieval method, device, electronic device and computer storage medium. Background Art

[0002] With the explosive growth of the Internet and digital information, people need more efficient and accurate search tools to find the information they need from a large amount of data. Traditional keyword searches can only provide results based on a single field or simple text matching, which limits the accuracy and efficiency of the search. Therefore, word embedding technology came into being and plays a vital role in natural language processing. Word embedding can convert text into word vectors. Search engines implemented using word vector similarity retrieval can effectively prevent search errors caused by typos or semantic ambiguity.

[0003] In the related art, when converting multi-field combined text into word vectors, the entire combined text is uniformly vectorized. However, due to the difference in the length of texts in different fields, this will bring about problems such as increased noise and sparse context, which will ultimately lead to a decrease in retrieval accuracy.

[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention

[0005] The present application provides an information retrieval method, device, electronic device and computer storage medium to solve the above-mentioned technical problems existing in the related technologies.

[0006] According to an embodiment of the present application, an information retrieval method is provided, including: obtaining a user search term, obtaining a search field in a structured data table, wherein the structured data table includes multiple entity data, each entity data includes text content corresponding to several search fields; using the search field to extract multiple text elements in the user search term; performing vector conversion on the multiple text elements respectively to obtain a first single-field vector corresponding to each search field; splicing the first single-field vectors to obtain a first combined vector; querying the structured data table for target entity data that matches the first combined vector, and outputting the target entity data as the search result of the user search term.

[0007] According to another embodiment of the present application, an information retrieval device is provided, including: a first acquisition module, used to acquire user search terms and search fields in a structured data table, wherein the structured data table includes multiple entity data, and each entity data contains text content corresponding to several search fields; an extraction module, used to extract multiple text elements in the user search terms using the search fields; a first conversion module, used to perform vector conversion on the multiple text elements respectively, to obtain a first single-field vector corresponding to each search field; a first splicing module, used to splice the first single-field vectors to obtain a first combined vector; and a matching module, used to query the structured data table for target entity data that matches the first combined vector, and output the target entity data as the search result of the user search term.

[0008] Optionally, the first conversion module includes: a judgment unit, used to judge whether the text element is extracted for each search field in the structured data table; a conversion unit, used to perform vector conversion on the at least one text element to obtain a first single field vector of the first search field if the first search field extracts at least one text element; if the second search field does not extract a text element, use a zero vector as the first single field vector of the second search field.

[0009] Optionally, the first splicing module includes: a normalization unit, used to normalize each of the first single-field vectors respectively to obtain a first intermediate vector; a first acquisition unit, used to obtain a splicing order of multiple search fields in the structured data table; and a first splicing unit, used to splice each of the first intermediate vectors according to the splicing order to obtain a first combined vector.

[0010] Optionally, the first splicing module includes: a second acquisition unit, used to obtain the target weight corresponding to each of the first single-field vectors; a first calculation unit, used to multiply each of the first single-field vectors by the corresponding target weight to obtain a second intermediate vector; and a second splicing unit, used to splice each of the second intermediate vectors to obtain a first combined vector.

[0011] Optionally, the second acquisition unit includes an acquisition subunit, used to acquire initial weights corresponding to each of the first single-field vectors, wherein the sum of the initial weights is 1; an adjustment unit, used to discard the initial weights corresponding to the zero vectors if there are zero vectors and non-zero vectors in the first single-field vectors; and readjust the initial weights of the non-zero vectors to obtain target weights of each of the non-zero vectors, wherein the sum of the target weights is 1.

[0012] Optionally, the matching module includes a reading unit for reading a second combination vector, wherein the second combination vector is a combination vector corresponding to each entity data in the structured data table; a second calculation unit for calculating the similarity between the first combination vector and the second combination vector; and an output unit for taking the entity data corresponding to several second combination vectors with the highest similarity as target entity data to be matched with the first combination vector.

[0013] Optionally, the information retrieval device also includes a second acquisition module, which is used to obtain the text content corresponding to the search field in the entity data for each entity data in the structured data table; a second conversion module, which is used to perform vector conversion on the text content corresponding to each search field separately to obtain a second single-field vector; and a second splicing module, which is used to splice the second single-field vectors to obtain a second combined vector corresponding to the entity data.

[0014] According to another embodiment of the present application, a computer storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned device embodiments when running.

[0015] According to another embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the program stored in the memory.

[0016] According to yet another embodiment of the present application, a computer program product comprising instructions is also provided, which enables the computer to execute the steps in the above method when the computer program product is executed on the computer.

[0017] Through the embodiments of the present application, a user search term is obtained, and a search field in a structured data table is obtained, wherein the structured data table includes multiple entity data, and each entity data contains text content corresponding to several search fields; the search field is used to extract multiple text elements in the user search term; vector conversion is performed on the multiple text elements respectively to obtain a first single-field vector corresponding to each search field; the first single-field vectors are spliced ​​to obtain a first combination vector; the structured data table is queried for target entity data matching the first combination vector, and the target entity data is output as a search result of the user search term. When searching for multi-field combined text, each field data is independently vectorized and then spliced ​​into a higher-dimensional combination vector. While avoiding typos, spelling errors or semantic ambiguities, the unified vectorization of all information is offset to the greatest extent, and the influence of additional noise and context sparsity caused by inconsistent text lengths of individual fields in the vector is improved. Retrieval accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present application;

[0020] Figure 2 is a flow chart of an information retrieval method according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a process for generating a second combination vector in an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a process of generating a first combination vector in an embodiment of the present application;

[0023] Figure 5 It is a schematic diagram of the process of combined vector retrieval in an embodiment of the present application;

[0024] Figure 6 It is a structural block diagram of an information retrieval device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Example 1

[0028] The method embodiment provided in the first embodiment of the present application can be executed in a mobile phone, a computer, a tablet or a similar computing device. Taking running on a computer as an example, Figure 1 is a hardware structure block diagram of a computer in an embodiment of the present application. Figure 1 As shown, the computer may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to an information retrieval method in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, an information retrieval method is provided. Figure 2 is a flow chart of an information retrieval method according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0032] Step S10, obtaining a user search term and obtaining a search field in a structured data table, wherein the structured data table includes a plurality of entity data, and each entity data contains text content corresponding to a plurality of search fields;

[0033] Step S20, extracting a plurality of text elements in the user search term using the search field;

[0034] Reference Figure 4 and Figure 5 When performing information retrieval, obtain the user search term and the search field in the structured data table, wherein the structured data table includes multiple entity data, each entity data contains the text content corresponding to the above search field, wherein the text lengths of the text contents stored in each search field are inconsistent, and null values ​​are allowed to appear, that is, each entity data corresponds to a multi-field combination text; use the search field to extract multiple text elements in the user search term.

[0035] In an example of this embodiment, there are N pieces of entity data E in the structured data table D, which is represented by D={E i |i∈[1,N]}, each entity data has three fields: A, B, and C (the text lengths of the contents stored in A, B, and C are inconsistent, and null values ​​are allowed). j ∈D, use E jA 、E jB 、E jC Represent the actual values ​​of the A, B, and C fields of the j-th entity respectively.

[0036] Optionally, text elements can be extracted using a large language model. By utilizing the semantic understanding ability of the large language model, different categories of element texts can be extracted according to the search fields. For example, element text a corresponding to field A, element text b corresponding to field B, and element text c corresponding to field C can be obtained.

[0037] Step S30, performing vector conversion on the plurality of text elements respectively to obtain a first single field vector corresponding to each search field;

[0038] Step S40, concatenating the first single field vectors to obtain a first combined vector;

[0039] Step S50: searching the structured data table for target entity data that matches the first combination vector, and outputting the target entity data as a search result of the user's search term.

[0040] The text elements under each search field are respectively converted into vectors to obtain the first single-field vector corresponding to each search field. Then, the first single-field vectors are concatenated to obtain a first combination vector. The target entity data matching the first combination vector is searched in the structured data table, and the target entity data is output as the search result of the user's search term.

[0041] Through this embodiment, a user search term is obtained, and a search field in a structured data table is obtained, wherein the structured data table includes multiple entity data, each entity data contains text content corresponding to several search fields; multiple text elements in the user search term are extracted using the search field; multiple text elements are respectively vectorized to obtain a first single field vector corresponding to each search field; each first single field vector is spliced ​​to obtain a first combination vector; target entity data matching the first combination vector is queried in the structured data table, and the target entity data is output as a search result of the user search term. When searching for multi-field combined text, each field data is independently vectorized and then spliced ​​into a higher-dimensional combination vector. While avoiding typos, spelling errors or semantic ambiguity, the unified vectorization of all information is offset to the greatest extent, and the influence of additional noise and context sparsity caused by inconsistent text lengths of a single field in the vector is improved. Retrieval accuracy.

[0042] In one implementation of this embodiment, performing vector conversion on the multiple text elements respectively to obtain a first single field vector corresponding to each search field includes:

[0043] S31, for each search field in the structured data table, determining whether the text element is extracted;

[0044] S32, if at least one text element is extracted from the first search field, performing vector conversion on the at least one text element to obtain a first single field vector of the first search field;

[0045] S33: If no text element is extracted from the second search field, a zero vector is used as a first single field vector of the second search field.

[0046] In this embodiment, when text elements of different search fields are converted into vectors independently, it includes the case where one text element or multiple text elements are extracted from the search field, or the case where no text element is extracted from the search field.

[0047] This implementation manner determines whether a text element is extracted for each search field in a structured data table. If a text element is extracted by the first search field, a vector conversion is performed on the text element to serve as the first single-field vector of the first search field. If multiple text elements are extracted by the first search field, the multiple text elements are concatenated to generate a text segment, and the text segment is vector converted to serve as the first single-field vector corresponding to the first search field. If no text element is extracted by the second search field, a zero vector is used as the first single-field vector of the second search field.

[0048] In one example, the user enters the search word TS in the search bar, and uses the search fields A, B, and C in the structured data table D to extract the element text {a1, a2} corresponding to field A and the text element {c1} corresponding to field C from TS. No element text is extracted from field B. Based on the above extraction, a1 and a2 are concatenated and then processed by the vector model (Embedding model). e Get the single field vector V of field A SA ; c1 passes through the vector model f e Then we get the single field vector V of field C SC ; If no feature text is extracted from field B, a zero vector is used instead, that is, a single field vector V of field B SB is a zero vector. After passing through the vector model, an n-dimensional vector is obtained, where the value of n depends on the vector model parameters.

[0049] In another implementation of this embodiment, concatenating the first single-field vectors to obtain a first combined vector includes:

[0050] A41, normalizing each of the first single field vectors to obtain a first intermediate vector;

[0051] A42, obtaining a concatenation order of multiple search fields in the structured data table;

[0052] A43: splice the first intermediate vectors according to the splicing order to obtain a first combined vector.

[0053] Before splicing the first single field vectors, this embodiment normalizes the first single field vectors respectively to obtain the first intermediate vectors. When splicing, the splicing is performed according to the splicing order of multiple search fields in the structured data table to facilitate subsequent vector similarity matching.

[0054] In this implementation, the following normalization formula may be used to normalize each first single field vector to obtain a first intermediate vector: The normalization formula is: (i∈[1,n],x i ∈V), where n is the vector dimension, xi is the value corresponding to the i-th dimension, and v is the entire n-dimensional vector. In an example, the first single-field vector V obtained in the above implementation is SA 、V SC After f norm Get the first intermediate vector V S ′ A 、V S ′ C , zero vector V SBKeep the value unchanged and assign it to the first intermediate vector V S ′ B .

[0055] Before concatenation, each vector is normalized. During online query, the step of calculating the modulus of each vector is omitted. Instead, the dot product between the vectors is directly calculated as the similarity, which saves computing resources and time and improves search efficiency.

[0056] In another implementation of this embodiment, concatenating the first single-field vectors to obtain a first combined vector includes:

[0057] B41, obtaining target weights corresponding to the first single-field vectors;

[0058] B42, multiplying each of the first single field vectors by the corresponding target weight to obtain a second intermediate vector;

[0059] B43, concatenate the second intermediate vectors to obtain a first combined vector.

[0060] In different query scenarios, the importance of different fields may be different. In this embodiment, in the query stage, the target weight corresponding to each first single field vector is obtained, each first single field vector is multiplied by the corresponding target weight to obtain a second intermediate vector, and each second intermediate vector is spliced ​​to obtain a first combined vector. In one example: If there are m search fields involved in the query (the search fields in this example include A, B, and C, that is, m is 3), then the first single field vector is spliced ​​with each second intermediate vector after multiplying the weight to obtain a query vector with a dimension of mn; or the normalized first intermediate vector is multiplied with the weight and then spliced. In one example: V S ′ A 、V S ′ B 、V S ′ C Concatenate in order to get the first combined vector V S , whose dimension is 3n.

[0061] In this embodiment, the target weight can be a fixed weight for each field that is set in advance according to the query scenario and the importance ratio of each field, or it can be dynamically adjusted according to the extraction of element text, etc. In this embodiment, there is no restriction on the weight setting method. This embodiment directly considers the weight of the search information during the search and can adjust it. There is no need to output the entity and then perform fine sorting, so as to achieve faster and more complete weighted calculation.

[0062] Optionally, obtaining a target weight corresponding to each of the first single-field vectors includes:

[0063] b1, obtaining initial weights corresponding to the first single field vectors, wherein the sum of the initial weights is 1;

[0064] b2, if there are zero vectors and non-zero vectors in the first single field vector, discard the initial weight corresponding to the zero vector;

[0065] b3, readjusting the initial weights of the non-zero vectors to obtain target weights of the non-zero vectors, wherein the sum of the target weights is 1.

[0066] In this embodiment, if there is a zero vector in the first single-field vector, it means that the zero vector field has not extracted valid information or has not been successfully extracted, so the initial weight corresponding to the zero vector is discarded and the remaining weight is reallocated to the non-zero vector to obtain the target weight of the non-zero vector.

[0067] In one example, for entity E in structured data table D, the initial weights of the three fields A, B, and C in the search are set to 0.5, 0.3, and 0.2 respectively according to their importance. SB If it is equal to the zero vector, the initial weight of field B is discarded, and the weights of fields A and C are adjusted to Therefore, the weights are multiplied by

[0068] Through the weight adjustment method of this embodiment, in the narrow situation where some fields are invalid or missing, the weight adjustment mechanism can dynamically adapt to the changes, ensuring that the retrieval system can still perform reasonable sorting or matching based on the remaining valid fields without being disturbed by invalid fields, thereby further improving the retrieval accuracy.

[0069] In one implementation of this embodiment, searching the structured data table for target entity data matching the first combination vector includes:

[0070] S51, reading a second combination vector, wherein the second combination vector is a combination vector corresponding to each entity data in the structured data table;

[0071] S52, calculating the similarity between the first combined vector and the second combined vector;

[0072] S53: taking entity data corresponding to a plurality of second combination vectors with the highest similarity as target entity data matching the first combination vector.

[0073] Read the second combination vector V corresponding to each entity data in the structured data table j , calculate the first combination vector V SWith the second combined vector V j The similarity between them is calculated, and the query results are returned based on the similarity. The top corresponding product information with the highest similarity to the first combination vector among all the second combination vectors is returned. The top value is set according to actual needs.

[0074] In this implementation, the similarity value may be calculated using the following similarity calculation formula:

[0075]

[0076] V j ,V j ∈D V ), where S is the similarity, V S is the first combination vector, V j is the second combined vector, n is the vector dimension, N is the number of entities, D V are all the second combination vectors in the vector database, ai and bi are V S and V j The corresponding element value.

[0077] In practical applications, the sum of the weights of each field can be set to 1, or the value range of each field weight can be [0,1]. In this way, there are two cases for setting the similarity (assuming that the second combination vector is composed of m single-field vectors): setting the sum of the weights of m fields to 1, the maximum similarity is 1; setting the weights of m fields to any value in [0,1], the maximum similarity is m.

[0078] In this implementation, before reading the second combination vector, the method further includes:

[0079] Step C1, for each piece of entity data in the structured data table, obtaining text content corresponding to the search field in the entity data;

[0080] Step C2, performing vector conversion on the text content corresponding to each search field separately to obtain a second single-field vector;

[0081] Step C3: concatenate the second single-field vectors to obtain a second combined vector corresponding to the entity data.

[0082] In this embodiment, refer to Figure 3 , the entity information in the structured data table is also preprocessed by single-field vectorization and concatenation to generate a second combination vector corresponding to each entity data.

[0083] Specifically, for each entity data in the structured data table, the text content T corresponding to the search field in the entity data is obtained, and the vector model f eConvert the text T into an n-dimensional vector V, that is, V = f e (T). Using the vector model f e The non-empty text in the entity is converted into an n-dimensional vector, and the empty text is replaced by an n-dimensional zero vector to obtain a second single-field vector. In an example: Assume that in entity j, E jA 、E jB There is a specific value, E jc Is a null value. jA 、E jB Use f e Convert to n-dimensional feature vector V jA 、V jB , V jC is equal to an n-dimensional zero vector.

[0084] The obtained non-zero second single-field vectors are normalized respectively, and the zero vector remains unchanged to obtain the single-field vector to be combined. The normalization formula f in the above implementation mode can be used. norm In one example: V JA ′ 、V JB ′ and V JC ′ The second combination vector of entity j is obtained by sequential concatenation, and its dimension is 3n.

[0085] Repeat the above steps until all entities in the structured data table have obtained their corresponding second combination vectors. Use B+Tree to build an index for the second combination vector set to obtain a vector data table. In an example: After all entities in D are processed above, the vectors are indexed to obtain a vector data table D V = {V j |j∈[1,N]}.

[0086] Through this embodiment, the influence of different lengths of each field of the text on the accuracy of vector retrieval can be reduced; illustratively, the structured data includes three fields: product name, ingredients and efficacy, wherein the product name of one multi-field combination text has 20 characters, and the product name of another multi-field combination text has only 5 characters. If both multi-field combination texts are uniformly vectorized, since the longer field may contain more non-critical information, these information will interfere with the actual meaningful signal as noise when converted into word vectors, resulting in an overestimation of the matching degree of the short name text. The user inputs "I want to buy a facial cleanser", and after the user's input is converted into a vector, it is searched with the above two product vectors, and the accuracy of the one with fewer characters is higher. However, through this embodiment, the multi-field combination text is first vectorized by a single field, and then spliced, to achieve independent retrieval of categories and categories, efficacy and efficacy, etc., effectively eliminating the influence of the length of the product name on the retrieval results of the same user input, and the dependence of the vector model on the training data structure. In this way, the generalization ability of the model on texts of different lengths is improved, ensuring that the retrieval accuracy is not affected by field length fluctuations.

[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment 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 this 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 software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0088] Example 2

[0089] In the present embodiment, a kind of information retrieval device is also provided, and is used to realize the above-mentioned embodiment and preferred implementation mode, and the description that has been carried out is not repeated. As used below, the term "module" can realize the combination of software and / or hardware of predetermined function. Although the device described in the following embodiment is preferably realized by software, the realization of hardware, or the combination of software and hardware is also possible and conceived.

[0090] Figure 6 is a structural block diagram of an information retrieval device according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:

[0091] A first acquisition module 61 is used to acquire a user search term and acquire a search field in a structured data table, wherein the structured data table includes multiple entity data, each entity data includes text content corresponding to several search fields;

[0092] An extraction module 62, configured to extract a plurality of text elements in the user search term using the search field;

[0093] A first conversion module 63, configured to perform vector conversion on the plurality of text elements respectively to obtain a first single field vector corresponding to each search field;

[0094] A first concatenation module 64, configured to concatenate the first single-field vectors to obtain a first combined vector;

[0095] The matching module 65 is used to search the structured data table for target entity data that matches the first combination vector, and output the target entity data as a search result of the user search term.

[0096] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0097] Example 3

[0098] An embodiment of the present application further provides a computer storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0099] Optionally, in this embodiment, the computer storage medium may be configured to store a computer program for performing the following steps:

[0100] S1, obtaining a user search term and a search field in a structured data table, wherein the structured data table includes multiple entity data, each entity data includes text content corresponding to several search fields;

[0101] S2, extracting a plurality of text elements in the user search term using the search field;

[0102] S3, performing vector conversion on the multiple text elements respectively to obtain a first single field vector corresponding to each search field;

[0103] S4, concatenating the first single field vectors to obtain a first combined vector;

[0104] S5, searching the structured data table for target entity data matching the first combination vector, and outputting the target entity data as a search result of the user search term.

[0105] Optionally, in this embodiment, the above-mentioned computer storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0106] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0107] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0108] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0109] S1, obtaining a user search term and a search field in a structured data table, wherein the structured data table includes multiple entity data, each entity data includes text content corresponding to several search fields;

[0110] S2, extracting a plurality of text elements in the user search term using the search field;

[0111] S3, performing vector conversion on the multiple text elements respectively to obtain a first single field vector corresponding to each search field;

[0112] S4, concatenating the first single field vectors to obtain a first combined vector;

[0113] S5, searching the structured data table for target entity data matching the first combination vector, and outputting the target entity data as a search result of the user search term.

[0114] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0115] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0116] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

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

[0118] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

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

[0121] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An information retrieval method, It is characterized in that The method comprises: Obtaining a user search term and obtaining a search field in a structured data table, wherein the structured data table includes a plurality of entity data, each entity data including text content corresponding to a plurality of search fields; extracting a plurality of text elements in the user search term using the search field; Performing vector conversion on the multiple text elements respectively to obtain a first single-field vector corresponding to each search field; Concatenate the first single field vectors to obtain a first combined vector; The structured data table is searched for target entity data matching the first combination vector, and the target entity data is output as a search result of the user search term.

2. The method according to claim 1, It is characterized in that Performing vector conversion on the multiple text elements respectively to obtain a first single field vector corresponding to each search field includes: For each search field in the structured data table, determining whether the text element is extracted; If at least one text element is extracted from the first search field, performing vector conversion on the at least one text element to obtain a first single field vector of the first search field; If no text element is extracted from the second search field, a zero vector is used as the first single field vector of the second search field.

3. The method according to claim 1, It is characterized in that The first single field vectors are concatenated to obtain a first combined vector including: Normalizing each of the first single field vectors to obtain a first intermediate vector; Obtaining a concatenation order of multiple search fields in the structured data table; The first intermediate vectors are concatenated in the concatenation order to obtain a first combined vector.

4. The method according to claim 1, It is characterized in that The first single field vectors are concatenated to obtain a first combined vector including: Obtaining target weights corresponding to each of the first single-field vectors; Multiply each of the first single field vectors by the corresponding target weight to obtain a second intermediate vector; The second intermediate vectors are concatenated to obtain a first combined vector.

5. The method according to claim 4, It is characterized in that Obtaining the target weight corresponding to each of the first single-field vectors includes: Obtaining initial weights corresponding to the first single field vectors, wherein the sum of the initial weights is 1; If there are zero vectors and non-zero vectors in the first single-field vector, discarding the initial weight corresponding to the zero vector; The initial weights of the non-zero vectors are readjusted to obtain target weights of the non-zero vectors, wherein the sum of the target weights is 1.

6. The method according to claim 1, It is characterized in that Querying the target entity data matching the first combination vector in the structured data table includes: Reading a second combination vector, wherein the second combination vector is a combination vector corresponding to each entity data in the structured data table; Calculating the similarity between the first combined vector and the second combined vector; The entity data corresponding to the second combination vectors with the highest similarity are used as the target entity data matching the first combination vector.

7. The method according to claim 6, It is characterized in that Before reading the second combined vector, the method further includes: For each piece of entity data in the structured data table, obtaining text content in the entity data corresponding to the search field; Perform vector conversion on the text content corresponding to each search field separately to obtain a second single-field vector; The second single-field vectors are concatenated to obtain a second combined vector corresponding to the entity data.

8. An information retrieval device, It is characterized in that include: A first acquisition module is used to acquire a user search term and acquire a search field in a structured data table, wherein the structured data table includes a plurality of entity data, each entity data including text content corresponding to a plurality of search fields; An extraction module, used to extract multiple text elements in the user search term using the search field; A first conversion module, used to perform vector conversion on the multiple text elements respectively to obtain a first single field vector corresponding to each search field; A first concatenation module, configured to concatenate the first single-field vectors to obtain a first combined vector; A matching module is used to search the structured data table for target entity data that matches the first combination vector, and output the target entity data as a search result of the user search term.

9. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: Memory, used to store computer programs; A processor, configured to execute the information retrieval method according to any one of claims 1 to 7 by running a program stored in a memory.

10. A computer storage medium, It is characterized in that The computer storage medium includes a stored program, wherein the program executes the information retrieval method according to any one of claims 1 to 7 when executed.

Citation Information

Cited By

  • Data confusion relation evaluation method and device, equipment and storage medium

    CN120723746A