Information retrieval method, question answering processing method, information retrieval device, and system
Patent Information
- Application Number
- CN202310127720.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-01
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-02-01
AI Technical Summary
但传统搜索引擎的实现方案的准确性较差,用户难以从检索结果中找到自己需要的信息
[0045]1)本申请将文档库中的文档抽象为文档图,使用文档图中的节点层级关系来体现文档知识在文档中的结构关系,从而将文档结构信息引入信息检索过程,提高在文档数据中检索信息的准确性,用户能够在检索结果中快速找到自己需要的信息。
Smart Images

Figure CN116186220B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an information retrieval method, a question-answering processing method, an information retrieval device, and a system. Background Technology
[0002] Various enterprises, organizations, and individuals generate a large amount of unstructured document data in their production, work, and daily lives. Examples include official documents, product manuals, meeting minutes, and personal notes. This data contains a wealth of information. However, finding the information needed within these documents is extremely difficult. Currently, traditional search engines are generally used to retrieve information from unstructured document data.
[0003] Traditional search engines match user-input queries (search text) against unstructured document data, primarily based on the distance between the query and paragraphs or sentences within the document. However, the accuracy of traditional search engine implementations is poor, making it difficult for users to find the information they need from the search results. Summary of the Invention
[0004] In view of this, this application provides an information retrieval method, a question-and-answer processing method, an information retrieval device, and a system to improve the accuracy of information retrieval from document data and increase the efficiency of users obtaining the information they need.
[0005] This application provides the following solution:
[0006] Firstly, an information retrieval method is provided, the method comprising:
[0007] Retrieve the search text;
[0008] The search text is used to match the document graphs corresponding to each document in the document library to obtain M matching document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graph include at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer statement pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document.
[0009] The candidate results are sorted, and N candidate results are selected based on the sorting results to obtain the search results for the search text, where N is a positive integer and N is less than or equal to M.
[0010] According to one achievable method in the embodiments of this application, matching the searched text in the document graph corresponding to each document included in the document library includes:
[0011] The feature representation of the retrieved text and the feature representation of each document knowledge in the document graph are obtained using a retrieval model, wherein the feature representation of each document knowledge is obtained based on the features of the document knowledge and the hierarchical relationship features of the document knowledge in the document graph;
[0012] The similarity between the feature representation of the retrieved text and the feature representation of each document knowledge is determined, and M document knowledge whose corresponding similarity satisfies the preset first similarity requirement is identified.
[0013] According to one achievable method in the embodiments of this application, if the nodes in the document graph include multiple types of document knowledge, the feature representation of each type of document knowledge is further obtained based on the type of document knowledge.
[0014] According to one achievable method in an embodiment of this application, the retrieval model is pre-trained in the following manner:
[0015] Acquire first training data comprising multiple positive and negative sample pairs, each sample pair including retrieval text samples and document knowledge samples, wherein the document knowledge samples are derived from the document graph in the document library;
[0016] The retrieval model is trained using the first training data. The retrieval model is used to obtain the feature representations of the retrieved text samples and the feature representations of the document knowledge samples, and the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples is determined. The training objectives include maximizing the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples in positive sample pairs, and minimizing the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples in negative sample pairs.
[0017] According to one achievable method in the embodiments of this application, sorting the candidate results includes:
[0018] The retrieved text and each candidate result are concatenated separately. The ranking model is used to obtain the feature representation of each concatenated text sequence. The feature representation of each text sequence is used to predict the ranking score of the corresponding candidate result. The feature representation of the text sequence is obtained based on the features of the text sequence and the hierarchical relationship features of the candidate results contained in the text sequence in the document graph.
[0019] Based on the ranking scores, the ranking results of each candidate result are determined.
[0020] According to one feasible embodiment of this application, the ranking model is pre-trained in the following manner:
[0021] Acquire second training data including multiple positive and negative sample pairs, each sample pair including retrieval text samples and document knowledge samples, wherein the document knowledge samples are derived from the document graph in the document library;
[0022] The ranking model is trained using the second training data. The ranking model obtains the feature representation of the text sequence obtained by concatenating the retrieved text sample and the document knowledge sample in the sample pair. The feature representation is used to predict the ranking score of the corresponding document knowledge sample. The training objective includes maximizing the difference between the ranking score of the document knowledge sample in the positive sample pair corresponding to the same retrieved text sample and the ranking score of the document knowledge sample in the corresponding negative sample pair.
[0023] According to one achievable method in an embodiment of this application, the negative sample pair is constructed using at least one of the following methods:
[0024] Obtain the retrieval text sample and document knowledge sample from the positive sample pair, sample other document knowledge belonging to the same node as the document knowledge sample in the document graph, and form a negative sample pair from the retrieval text sample and the sampled document knowledge;
[0025] A negative sample pair is formed by combining the retrieved text sample from one positive sample pair with the document knowledge sample from another positive sample pair.
[0026] Obtain the retrieval text sample and document knowledge sample from the positive sample pair, randomly sample document knowledge different from the document knowledge sample in the document graph, and form a negative sample pair with the retrieval text sample and the randomly sampled document knowledge.
[0027] Obtain the retrieval text sample and document knowledge sample from the positive sample pair, determine the document knowledge that meets the preset second similarity requirement with the retrieval text sample from each document graph of the document library, select document knowledge that is different from the document knowledge sample in the positive sample pair from the determined document knowledge, and form a negative sample pair with the retrieval text sample and the selected document knowledge.
[0028] Secondly, a question-answering processing method is provided, applied to an intelligent question-answering system, the method comprising:
[0029] The search text is obtained by using the question input by the user into the intelligent question-answering system;
[0030] The search text is used to match the document graphs corresponding to each document in the document library to obtain M matching document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graph include at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer statement pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document.
[0031] The candidate results are sorted, and N candidate results are selected based on the sorting results to obtain the search results for the search text, where N is a positive integer and N is less than or equal to M;
[0032] The search results are used to generate an answer, which is then returned to the user.
[0033] Thirdly, an information retrieval device is provided, the device comprising:
[0034] The input acquisition unit is configured to acquire the search text;
[0035] The retrieval processing unit is configured to use the retrieval text to match the document graph corresponding to each document in the document library, and obtain M matched document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graph include at least one document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer statement pairs. The hierarchical relationship between the nodes reflects the structural relationship of the corresponding document knowledge in the document.
[0036] The sorting processing unit is configured to sort the candidate results, select N candidate results based on the sorting results to obtain the search results for the search text, where N is a preset positive integer and N is less than or equal to M.
[0037] Fourthly, an information retrieval system is provided, the system including user equipment and a server;
[0038] The user equipment is configured to send search text to the server and receive search results returned by the server;
[0039] The server is configured to match the searched text against the document graphs corresponding to each document in the document library, and obtain M matched document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graphs include at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document. The server sorts the candidate results and selects N candidate results based on the sorting results to obtain the search results for the searched text, where N is a preset positive integer and is less than or equal to M.
[0040] According to a fifth aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first and second aspects above.
[0041] According to a sixth aspect, an electronic device is provided, comprising:
[0042] One or more processors; and
[0043] A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any one of the first and second aspects above.
[0044] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0045] 1) This application abstracts the documents in the document library into a document graph, and uses the node hierarchy relationship in the document graph to represent the structural relationship of document knowledge in the document, thereby introducing document structure information into the information retrieval process, improving the accuracy of information retrieval in document data, and enabling users to quickly find the information they need in the search results.
[0046] 2) This application employs document knowledge at multiple granularities, such as text units, entity triples, and question-and-answer pairs, to enrich the knowledge types and help users match search results that meet their needs.
[0047] 3) In this application, when determining the feature representation of each document knowledge, it not only relies on the features of the document knowledge but also further combines the hierarchical relationship features of the node where the document knowledge is located, so as to more accurately obtain the features of the document knowledge in the document, and thus more accurately obtain candidate results, thereby improving the accuracy of the final retrieval results.
[0048] 4) In this application, when determining the feature representation of each document knowledge, it can be further obtained based on the type of document knowledge. That is, the type information of document knowledge is incorporated into the knowledge retrieval and knowledge retrieval learning process, thereby improving the accuracy of knowledge retrieval.
[0049] 5) Both the retrieval model and the ranking model in this application can be trained using contrastive learning. When constructing negative sample pairs, other document knowledge in the document graph that belongs to the same node as the document knowledge samples in the positive sample pairs, as well as the retrieval text samples in the positive sample pairs, are used to construct negative samples. On the one hand, this achieves automatic construction of negative sample pairs, and on the other hand, it uses the structural information of document knowledge in the document graph to improve the quality of negative samples, thereby improving the performance of the trained model.
[0050] Of course, any product implementing this application does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a system architecture diagram applicable to the embodiments of this application;
[0053] Figure 2 A flowchart of the information retrieval method provided in the embodiments of this application;
[0054] Figure 3 A schematic diagram of the information retrieval framework provided in the embodiments of this application;
[0055] Figure 4 A schematic diagram of a document provided for an embodiment of this application;
[0056] Figure 5 A schematic diagram illustrating the principle of the retrieval model provided in the embodiments of this application;
[0057] Figure 6 A schematic diagram illustrating the principle of the sorting model provided in the embodiments of this application;
[0058] Figure 7 A schematic block diagram of an information retrieval device provided in an embodiment of this application;
[0059] Figure 8 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0061] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0062] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0063] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0064] To facilitate understanding of this application, a brief description of the system architecture to which this application applies will be given first. Figure 1 An exemplary system architecture that can be applied to embodiments of this application is shown, such as Figure 1 As shown, the system architecture may include user equipment and information retrieval devices located on the server side.
[0065] Users can input a query (search text) through their user devices, which will then send the search text to the information retrieval device on the server.
[0066] User devices can include, but are not limited to, smart mobile terminals, smart home devices, wearable devices, and PCs (Personal Computers). Smart mobile devices can include mobile phones, tablets, laptops, PDAs (Personal Digital Assistants), and connected cars. Smart home devices can include smart TVs, smart refrigerators, and so on. Wearable devices can include smartwatches, smart glasses, virtual reality devices, augmented reality devices, and mixed reality devices (devices that support both virtual and augmented reality).
[0067] The information retrieval device can use the method provided in the embodiments of this application to perform retrieval processing on the search text in the document database and obtain retrieval results. The information retrieval device utilizes retrieval models, ranking models, etc., during the retrieval process.
[0068] Information retrieval devices can be configured as standalone servers, within server clusters, or on cloud servers. Cloud servers, also known as cloud computing servers or cloud hosts, are a host product within the cloud computing service system, designed to address the management difficulties and weak service scalability inherent in traditional physical hosts and Virtual Private Servers (VPs). In addition to... Figure 1 In addition to the architecture shown, the information retrieval device can also be installed on a computer terminal with strong computing power.
[0069] It should be understood that Figure 1 The number of user devices, information retrieval devices, retrieval models, ranking models, and document databases shown are merely illustrative. Depending on implementation needs, any number of user devices, information retrieval devices, retrieval models, ranking models, and document databases can be included.
[0070] Figure 2 This is a flowchart of an information retrieval method provided in an embodiment of this application. The method can be... Figure 1 The information retrieval device in the system architecture shown is executed. For example... Figure 2 As shown, the method may include the following steps:
[0071] Step 202: Obtain the search text.
[0072] Step 204: Use the search text to match the document graphs corresponding to each document in the document library, and obtain M matching document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graph include at least one document knowledge. The document knowledge includes text units in the document, entity triples extracted from the document, or question-and-answer statement pairs. The hierarchical relationship between each node reflects the structural relationship of the corresponding document knowledge in the document.
[0073] Step 206: Sort the candidate results, and select N candidate results based on the sorting results to obtain the search results for the search text. N is a preset positive integer, and N is less than or equal to M.
[0074] As can be seen from the above process, this application abstracts the documents in the document library into a document graph, and uses the node hierarchy relationship in the document graph to represent the structural relationship of document knowledge in the document, thereby introducing document structure information into the information retrieval process, improving the accuracy of information retrieval in document data, and enabling users to quickly find the information they need in the search results.
[0075] The following sections describe each step in the above process in detail. First, step 202, "obtaining the search text," will be described in detail with reference to an embodiment.
[0076] The source of the retrieved search text can vary depending on the application scenario. For example, users can enter text (characters, words, sentences, etc.) into a search engine using their devices. This text can be directly entered into the text box or obtained through voice recognition after voice input. In addition, users can also enter text or images in other applications that embed search functionality.
[0077] In a question-and-answer scenario, users can input questions into the intelligent question-and-answer system. Users can directly input the question text or input it via voice, and the system will then use speech recognition to retrieve the question text. In this scenario, the question text is used as the search text.
[0078] The user equipment sends the search text or voice information entered by the user to the information retrieval device on the server. The information retrieval device obtains the search text, or, using the voice recognition device on the server, obtains the search text after recognizing the voice information.
[0079] The following describes step 204, namely, "using the searched text to match the document graphs corresponding to each document in the document library, and obtaining the knowledge of the M matched documents as candidate results," in conjunction with an embodiment.
[0080] Traditional document databases contain documents in their raw, unstructured or semi-structured form. Therefore, traditional document retrieval methods do not consider document structure information. However, document structure information significantly enhances the semantic expression of textual units within a document. Incorporating document structure information into the retrieval process will improve the accuracy of document data retrieval.
[0081] Traditional information retrieval frameworks for document data mainly include: Figure 3 As shown, after obtaining the user's search text, the retrieval processing unit (Retriever) first retrieves candidate results from the unstructured documents. Then, the ranking processing unit (Ranker) sorts the candidate results, and further selects the search results from the candidate results using the ranking results. This application's embodiments largely follow this framework, but introduce structured document information into it. First, the documents in the document library are abstracted into a structured document graph (DocGraph), and improvements are made to the specific retrieval processing, retrieval model training, and ranking model training methods.
[0082] First, a document graph based on document structure is constructed from the documents in the document library using knowledge discovery techniques. The document graph differs from a document; it employs a node and edge architecture, with each node containing at least one type of document knowledge. Document knowledge can include at least one of the following: text units from the document, entity triples extracted from the document, and question-and-answer pairs. Text units can be paragraphs, sentences, phrases, etc. The hierarchical relationships between nodes in the document graph, expressed through edges, reflect the structural relationships of the corresponding document knowledge within the document.
[0083] For example, the structural relationships of a document include: document title, summary, first-level headings, second-level headings, paragraphs, etc. Figure 4 As shown, a document's title is "Coverage Provided by Our Company," which serves as the root node in the document diagram. First-level headings include "Insured Amount," "Insurance Period," and "Insurance Liability," and these first-level headings and summaries are the next-level nodes (i.e., the root node) in the document diagram. Each first-level heading contains corresponding paragraphs as next-level nodes. Assuming a second-level heading exists under "Insurance Liability," the next-level node for that heading is the second-level heading "Accidental Injury Medical Insurance," and the next-level nodes for that second-level heading are the paragraphs under that heading. In addition to paragraphs, nodes may also include entity triples and / or question-and-answer pairs extracted from those paragraphs.
[0084] Entity triples can include two entities and the relationship between them. Question-answer pairs can include a question and an answer. The extraction methods for entity triples and question-answer pairs are not limited in this embodiment; any feasible method can be used, such as a pre-trained entity extraction model, entity relation extraction model, or answer generation model, which will not be detailed here.
[0085] When matching the searched text against the document graphs of each document in the document library, a retrieval model can be used. The retrieval model can be a dense retrieval model, a sparse retrieval model, or a hybrid retrieval model that combines dense and sparse retrieval.
[0086] Taking dense retrieval as an example, the retrieval model can first be used to obtain the feature representation of the retrieval text and the feature representation of each document knowledge in the document graph. Then, the similarity between the feature representation of the retrieval text and the feature representation of each document knowledge is determined, and M document knowledge whose corresponding similarity meets a preset first similarity requirement is selected as candidate results, where M is a preset positive integer. For example, M document knowledge with a corresponding similarity greater than or equal to a preset similarity threshold can be selected as candidate results; another example is selecting the top M document knowledge with corresponding similarity as candidate results; and so on.
[0087] like Figure 5 As shown, the retrieval model can encode the retrieved text using a first encoding network to obtain a feature representation of the retrieved text. A second encoding network encodes document knowledge in the document graph, such as paragraphs or sentences, to obtain feature representations of the text units. Both the first and second encoding networks can be trained based on pre-trained language models. Pre-trained language models such as T5 (Transfer Text-to-Text Transformer), BERT (Bidirectional Encoder Representation from Transformers), XLNet (an autoregressive model that uses permutations of language models to achieve bidirectional contextual information), and GPT (Generative Pre-Training) are used as initial feature extraction models, and further training is performed on these models. The dense features extracted in this way are semantic-based feature representations.
[0088] It should be noted that the terms "first" and "second" used in this disclosure do not have any limitations on size, order, or number; they are merely used to distinguish between the two in name. For example, "first encoding network" and "second encoding network" are used to distinguish between two encoding networks in name, and "first training data" and "second training data" are used to distinguish between two types of training data in name.
[0089] Before encoding, the first and second encoding networks can first perform embedding processing on the input text. Examples include word-based embedding and position-based embedding. Word embedding involves encoding each token (element) into a word vector representation. Position embedding involves encoding the position of each token within the input text to obtain a positional representation. Each token can include characters, words, separators, start characters, etc.
[0090] In the second encoding network, when encoding document knowledge, the structural information of the document is incorporated into it. The feature representation of the document knowledge can be encoded based on the characteristics of the document knowledge itself and the hierarchical relationship characteristics of the nodes where the document knowledge is located.
[0091] One possible approach is to concatenate the document knowledge itself with the nodes from the preceding L levels, using this concatenated sequence as input to a second encoding network. The second encoding network then encodes the concatenated document sequence to obtain the feature representation of the document knowledge. Here, L can be a preset positive integer, such as 2. Figure 4 The feature representation of paragraph 2 can be obtained based on paragraph 2, its parent node "insurance amount", and its parent node "coverage provided by the company".
[0092] As another feasible approach, special embedding processing can be added to each token, such as document structure-based embedding. This involves encoding the structural information of the document knowledge within the document graph for each token in the document knowledge. For example, each node in the document graph is numbered, and this encoding reflects the node's hierarchical position in the document graph. When embedding document knowledge, each token of that document knowledge has a corresponding number, and this number is encoded as the document structure representation of each token of that document knowledge. Then, the second encoding network uses the embedding results of the document knowledge for further encoding to obtain the feature representation of the document knowledge.
[0093] As another possible approach, the second encoding network can employ graph neural networks such as RGCN (Relational Graph Convolutional Networks) and RGAT (Relational Graph Attention Networks) to encode the nodes in the document graph, obtaining feature representations for each node. This allows the acquisition of feature representations for the knowledge contained in each document.
[0094] The RGCN model takes node features and edge types as input. All node features are passed to the RGCN layer, where they are aggregated from the feature representations of neighboring nodes and transformed into node feature representations. The feature representations of neighboring nodes are weighted according to the edge type. Compared to the RGCN model, the RGAT model introduces an attention mechanism, incorporating the attention effect of neighboring nodes on the node features when calculating the node's feature representation.
[0095] Furthermore, since each node in the document graph in this embodiment can contain various types of document knowledge, document knowledge type information can be incorporated into the retrieval model to assist in knowledge retrieval. For example, document knowledge can be further embedded based on document knowledge type. Specifically, document knowledge type information can be added to each token in the document knowledge, such as assigning numbers to various document knowledge types. When embedding document knowledge, each token of the document knowledge has a document knowledge type number corresponding to that document knowledge, and this type number is encoded as the document knowledge type representation of each token of the document knowledge. Then, the second encoding network uses the embedding result of the document knowledge for further encoding to obtain the feature representation of the document knowledge.
[0096] The second encoding network can pre-encode the knowledge of each document to obtain the feature representation of each document knowledge, and store it so that the retrieval model can directly match the stored feature representation of each document knowledge during retrieval.
[0097] When the above retrieval model is trained in advance, it can first obtain the first training data, which includes multiple positive sample pairs and negative sample pairs. Each sample pair includes retrieval text samples and document knowledge samples, where the document knowledge samples come from the document graph in the document library.
[0098] Positive sample pairs can be constructed manually or obtained in other ways, such as obtaining the user's search text and the document knowledge clicked by the user from the search results from historical search logs as positive sample pairs.
[0099] Negative sample pairs can be constructed in any or any combination of the following methods, but not limited to:
[0100] The first method is to combine the retrieved text sample from one positive sample pair with the document knowledge sample from another positive sample pair to form a negative sample pair.
[0101] For example, if there are positive sample pairs: (q1,k1) and (q2,k2), then (q1,k2) and (q2,k1) can be used as negative samples.
[0102] The second method is to obtain the retrieval text sample and document knowledge sample from the positive sample pair, randomly sample document knowledge different from the document knowledge sample in the document graph, and form a negative sample pair with the retrieval text sample and the randomly sampled document knowledge.
[0103] For example, given a positive sample pair (q1, k1), a document knowledge k3 is randomly sampled from the document graph, and (q1, k3) is used as a negative sample pair.
[0104] The third method is to obtain the retrieval text sample and document knowledge sample from the positive sample pair, sample other document knowledge belonging to the same node as the document knowledge sample in the document graph, and form a negative sample pair with the retrieval text sample and the sampled document knowledge.
[0105] This approach differs from the second in that, to improve the retrieval accuracy of the retrieval model and make the retrieved text more discriminative, it samples other document knowledge belonging to the same node as the document knowledge samples in the document graph. This is because, for the retrieval model, distinguishing different document knowledge at the same node is more difficult than distinguishing other document knowledge. Therefore, the negative sample pairs constructed in this way can help the retrieval model better learn the feature differences between two document knowledge items at the same node based on a specific document structure.
[0106] For example, if there exists a positive sample pair (q1, k1), where k1 and k2 belong to two different document knowledge under the same node, (q1, k2) can be used as a negative sample pair.
[0107] The fourth method is to obtain the retrieval text sample and document knowledge sample from the positive sample pair, and use the BM25 algorithm to determine the document knowledge that meets the preset second similarity requirement with the retrieval text sample from each document graph of the document library. Then, select the document knowledge that is different from the document knowledge sample in the positive sample pair from the determined document knowledge, and form a negative sample pair with the retrieval text sample and the selected document knowledge.
[0108] For example, given a positive sample pair (q1, k1), the BM25 algorithm is used to determine document knowledge with a similarity greater than a preset similarity threshold to q1 from each document graph in the document database. From this determined document knowledge, a document knowledge that is not k1 is randomly selected, such as k2. This (q1, k2) is then used to construct a negative sample pair.
[0109] The above method can construct a large number of negative sample pairs, reducing the labor cost of manually constructing negative sample pairs.
[0110] Then, the retrieval model is trained using the first training data. A contrastive learning approach is employed in training the retrieval model. Specifically, the retrieval model is used to obtain feature representations of the retrieved text samples and document knowledge samples, determining the similarity between these two feature representations. The training objectives include maximizing the similarity between the feature representations of the retrieved text samples and document knowledge samples in positive sample pairs, and minimizing the similarity between these two feature representations in negative sample pairs.
[0111] In this embodiment, a loss function can be constructed based on the aforementioned training objective. In each iteration, the parameters of the retrieval model are updated using methods such as gradient descent, based on the value of the loss function, until a preset training termination condition is met. The training termination condition may include, for example, the value of the loss function being less than or equal to a preset loss function threshold, or the number of iterations reaching a preset threshold.
[0112] Besides dense retrieval, sparse retrieval methods can also be used. For example, methods based on TF (Term Frequency)-IDF (Inverse Document Frequency) and the BM25 algorithm (BM25 is a classic algorithm used in information indexing to calculate the similarity between a query and documents) can be used to calculate the similarity between the retrieved text and the knowledge in each document. Based on this similarity, M documents that meet a preset first similarity requirement are selected as candidate results. Since sparse retrieval methods based on TF-IDF, BM25, etc., are existing methods, they will not be detailed here.
[0113] When using a hybrid retrieval method that combines dense retrieval and coefficient retrieval, the similarity between the retrieved text and document knowledge can be determined by dense retrieval and by sparse retrieval. The two similarities are then integrated, for example by addition, weighted summation, or weighted averaging. Based on the integrated similarity, M document knowledge items that meet the first similarity requirement are selected as candidate results.
[0114] The aforementioned first similarity requirement can be, for example, ranking among the top M similarities, or having a similarity value greater than or equal to a preset similarity threshold.
[0115] The following describes in detail step 206, namely, "sorting the candidate results and selecting N candidate results based on the sorting results to obtain the search results for the search text," with reference to the embodiments.
[0116] When sorting the candidate results, i.e., the knowledge from the M documents, a sorting model can be used. For example... Figure 6 As shown, the search text and each candidate result can be concatenated separately. For example, the search text and the first candidate result can be concatenated. A feature extraction network is then used to extract features from the concatenated text sequence to obtain a feature representation of the text sequence. A prediction network then uses this feature representation to predict the ranking score of the corresponding candidate result.
[0117] The feature extraction network can also use pre-trained language models such as T5, BERT, XLNet, and GPT.
[0118] Before encoding, feature extraction networks can first perform embedding processing on the input text sequence. Examples include word-based embedding and position-based embedding. Word embedding involves encoding each token into a word vector representation. Position embedding involves encoding the position of each token within the input text sequence to obtain a positional representation.
[0119] One feasible approach is to obtain the feature representation of a text sequence based on the features of the text sequence and the hierarchical relationship features of the candidate results contained within the text sequence in the document graph. Specifically, special embedding processing can be added to each token in the text sequence, such as document structure-based embedding. This involves encoding the structural information of the document knowledge (i.e., candidate results) in the document graph into each token. For example, each node in the document graph is numbered, and this encoding reflects the node's hierarchical position in the document graph. When embedding the document sequence, each token of the document knowledge has a corresponding number, and this number is encoded as the document structure representation of each token of the document knowledge. Then, a second encoding network further encodes the text sequence using the embedding results to obtain the feature representation of the text sequence.
[0120] When the above ranking model is trained in advance, it can first obtain a second training data including multiple positive sample pairs and negative sample pairs. Each sample pair includes retrieval text samples and document knowledge samples, where the document knowledge samples come from the document graph in the document library.
[0121] Positive sample pairs can be constructed manually or obtained in other ways, such as obtaining the user's search text and the document knowledge clicked by the user from the search results from historical search logs as positive sample pairs.
[0122] The method for constructing negative sample pairs is similar to the method for constructing negative samples in the first training data described in the above embodiments, and will not be repeated here.
[0123] In this embodiment of the application, when training the ranking model using the second training data, a contrastive learning approach can also be adopted. The ranking model is used to obtain the feature representation of the text sequence obtained by concatenating the retrieved text sample and the document knowledge sample in the sample pair. This feature representation is then used to predict the ranking score of the corresponding document knowledge sample. The training objective includes maximizing the difference between the ranking scores of the document knowledge samples in the positive sample pair corresponding to the same retrieved text sample and the ranking scores of the document knowledge samples in the corresponding negative sample pair.
[0124] In this embodiment, a loss function can be constructed based on the aforementioned training objective. In each iteration, the parameters of the ranking model are updated using methods such as gradient descent, based on the value of the loss function, until a preset training termination condition is met. The training termination condition may include, for example, the value of the loss function being less than or equal to a preset loss function threshold, or the number of iterations reaching a preset threshold.
[0125] After obtaining the ranking score of each candidate result using the ranking model, the candidate results can be ranked according to the ranking score, and the top N candidate results can be selected as the retrieval results, where N is a preset positive integer and N is less than or equal to M.
[0126] As one possible approach, when returning the search results to the user, the N document knowledge items are also sorted according to their corresponding ranking scores.
[0127] The methods provided in this application embodiment can be applied to various application scenarios. Here, only two application scenarios are taken as examples:
[0128] Application Scenario 1:
[0129] With the continuous development and widespread use of internet technology and computer terminals, more and more users are communicating via online meetings. During these meetings, users typically input information via voice and documents, ultimately generating meeting minutes.
[0130] When a user wants to retrieve certain information from the meeting minutes, the user can search for information within the meeting minutes. For example, the user can enter a query in the search box provided by the online meeting client, and the client will send the query to the server.
[0131] The server-side can employ the method described in this embodiment to pre-construct a document graph from the originally unstructured documents in the meeting minutes. The documents in the meeting minutes can include recordings generated based on user speech recognition during the meeting, or documents uploaded or shared by users during the meeting. Each node in the constructed document graph includes at least one type of document knowledge, which can include at least one of sentences from the document, entity triples extracted from the document, and question-and-answer pairs. In other words, it includes pre-extracted structured information. Furthermore, the hierarchical relationships between nodes, expressed through edges, reflect the structural relationships of the corresponding document knowledge within the document.
[0132] The server-side uses a retrieval model to search the document graph corresponding to the meeting minutes, and selects the retrieved document knowledge as candidate results. Specifically, the retrieval model first obtains the feature representation of the retrieval text and the feature representation of each document knowledge in the document graph generated from the meeting minutes; then, it determines the similarity between the feature representation of the retrieval text and the feature representation of each document knowledge, and selects M document knowledge whose corresponding similarity meets a preset first similarity requirement as candidate results. For example, the top 10 document knowledge with the highest similarity are selected as candidate results.
[0133] Then, the ranking model is used to rank and score each candidate result, and the final search results are returned to the user based on the ranking scores. For example, the three candidate results with the highest ranking scores are selected as the search results.
[0134] As can be seen, through the method in this application embodiment, users do not need to search through meeting minutes containing a large amount of content to find the content they need. Instead, after entering a query, they can quickly, conveniently, and accurately obtain search results and find the content they need from the search results, which greatly improves efficiency.
[0135] Application Scenario 2:
[0136] More and more applications are now embedding intelligent question-and-answer systems, such as online customer service used by e-commerce platforms, and intelligent question-and-answer functions in smart speakers, and so on.
[0137] Users can input questions into the intelligent question-answering system. For example, the intelligent question-answering system provides users with a page or client, and users can input questions through input boxes or other components on the page or client, or input questions by voice.
[0138] Intelligent question-answering systems located on the server side (which could be a cloud server) use user-input questions to obtain search text. For example, questions entered by users through input boxes or other components can be used as search text. Another example is using speech recognition to obtain search text from questions entered by users via voice.
[0139] Intelligent question-answering systems can be targeted at specific fields, such as medicine, education, and insurance; or they can be general-purpose intelligent question-answering systems.
[0140] Taking a domain-specific intelligent question-answering system as an example, the system can employ the method described in this application to pre-construct a document graph from unstructured documents within that domain. Domain-specific documents can be obtained from a domain-specific resource library, such as literature, papers, and reports. Each node in the constructed document graph includes at least one type of document knowledge, which may include at least one of sentences from the document, entity triples extracted from the document, and question-answer pairs. In other words, it includes pre-extracted structured information. Furthermore, the hierarchical relationships between nodes, expressed through edges, reflect the structural relationships of the corresponding document knowledge within the document.
[0141] The intelligent question-answering system utilizes a retrieval model to search the document graph corresponding to a specific domain, and uses the retrieved document knowledge as candidate results. Specifically, it first uses the retrieval model to obtain the feature representation of the retrieval text and the feature representation of each document knowledge in the document graph generated by the document resources of the specific domain; then, it determines the similarity between the feature representation of the retrieval text and the feature representation of each document knowledge, and selects M document knowledge whose corresponding similarity meets a preset first similarity requirement as candidate results. For example, the document knowledge ranked in the top 10 in terms of similarity is selected as candidate results.
[0142] Then, the ranking model is used to rank and score each candidate result, and the final search result is returned to the user based on the ranking score. For example, the candidate result with the highest ranking score is selected as the search result.
[0143] The intelligent question-answering system then uses the search results to generate an answer and returns it to the user. This answer can be returned to the user in text format, or it can be synthesized from text and returned to the user via speech. When generating an answer using search results, the search results can be returned directly as the answer, or the answer can be generated by combining the search results with specific wording.
[0144] As can be seen, through the methods described in this application embodiment, users can quickly, conveniently, and accurately obtain the answers they want in the intelligent question-and-answer system, greatly improving efficiency and user experience.
[0145] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0146] According to another embodiment, an information retrieval device is provided. Figure 7 A schematic block diagram of an information retrieval device according to one embodiment is shown. Figure 7 As shown, the device 700 includes: an input acquisition unit 701, a retrieval processing unit 702, and a sorting processing unit 703, and may further include a first training unit 704 and a second training unit 705. The main functions of each component are as follows:
[0147] Input acquisition unit 701 is configured to acquire search text.
[0148] The retrieval processing unit 702 is configured to match the retrieval text in the document graph corresponding to each document included in the document library, and obtain M matched document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graph include at least one document knowledge, which includes at least one of the following: text units in the document, entity triples extracted from the document, and question-and-answer statement pairs. The hierarchical relationship between the nodes reflects the structural relationship of the corresponding document knowledge in the document.
[0149] The sorting processing unit 703 is configured to sort the candidate results and select N candidate results based on the sorting results to obtain the search results for the search text, where N is a preset positive integer and N is less than or equal to M.
[0150] As one possible implementation method, the retrieval processing unit 702 can be specifically configured to: obtain the feature representation of the retrieval text and the feature representation of each document knowledge in the document graph using the retrieval model, wherein the feature representation of each document knowledge is obtained based on the features of the document knowledge and the hierarchical relationship features of the document knowledge in the document graph; determine the similarity between the feature representation of the retrieval text and the feature representation of each document knowledge respectively, and determine M document knowledge whose corresponding similarity meets the preset first similarity requirement.
[0151] As one possible approach, if the nodes in the document graph include multiple types of document knowledge, the feature representations of each type of document knowledge can be further obtained based on the type of document knowledge.
[0152] As one possible implementation, the first training unit 704 is configured to pre-train the retrieval model in the following manner:
[0153] Acquire first training data including multiple positive and negative sample pairs. Each sample pair includes retrieval text samples and document knowledge samples. The document knowledge samples are derived from document graphs in the document library.
[0154] The retrieval model is trained using the first training data. The retrieval model is used to obtain the feature representations of the retrieved text samples and the feature representations of the document knowledge samples. The similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples is determined. The training objectives include maximizing the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples in positive sample pairs, and minimizing the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples in negative sample pairs.
[0155] As one possible implementation method, the sorting processing unit 703 can be specifically configured to: concatenate the retrieved text with each candidate result separately, obtain the feature representation of each concatenated text sequence using a sorting model, predict the sorting score of the corresponding candidate result using the feature representation of each text sequence, wherein the feature representation of the text sequence is obtained based on the features of the text sequence and the hierarchical relationship features of the candidate results contained in the text sequence in the document graph; and determine the sorting result of each candidate result based on the sorting score.
[0156] As one possible implementation, the second training unit 705 is configured to pre-train the ranking model in the following manner:
[0157] Acquire second training data including multiple positive and negative sample pairs. Each sample pair includes retrieval text samples and document knowledge samples. The document knowledge samples are derived from document graphs in the document library.
[0158] A ranking model is trained using the second training data. The ranking model is used to obtain the feature representation of the text sequence obtained by concatenating the retrieved text sample and the document knowledge sample in the sample pair. The feature representation is used to predict the ranking score of the corresponding document knowledge sample. The training objective is to maximize the difference between the ranking score of the document knowledge sample in the positive sample pair corresponding to the same retrieved text sample and the ranking score of the document knowledge sample in the negative sample pair.
[0159] As one possible approach, the first training unit 704 and the second training unit 705 described above can construct negative sample pairs using at least one of the following methods:
[0160] The first method is to obtain the retrieval text sample and document knowledge sample from the positive sample pair, sample other document knowledge belonging to the same node as the document knowledge sample in the document graph, and form a negative sample pair with the retrieval text sample and the sampled document knowledge.
[0161] The second approach is to combine the retrieved text sample from one positive sample pair with the document knowledge sample from another positive sample pair to form a negative sample pair.
[0162] The third method is to obtain the retrieval text sample and document knowledge sample from the positive sample pair, randomly sample document knowledge different from the document knowledge sample in the document graph, and form a negative sample pair with the retrieval text sample and the randomly sampled document knowledge.
[0163] The fourth method is to obtain the retrieval text sample and document knowledge sample from the positive sample pair, and use the BM25 algorithm to determine the document knowledge that meets the preset second similarity requirement with the retrieval text sample from each document graph of the document library. Then, select the document knowledge that is different from the document knowledge sample in the positive sample pair from the determined document knowledge, and form a negative sample pair with the retrieval text sample and the selected document knowledge.
[0164] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0165] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0166] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.
[0167] And an electronic device, comprising:
[0168] One or more processors; and
[0169] A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any of the foregoing method embodiments.
[0170] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.
[0171] in, Figure 8 An exemplary architecture of an electronic device is shown, which may include a processor 810, a video display adapter 811, a disk drive 812, an input / output interface 813, a network interface 814, and a memory 820. The processor 810, video display adapter 811, disk drive 812, input / output interface 813, network interface 814, and memory 820 can communicate with each other via a communication bus 830.
[0172] The processor 810 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs and implement the technical solution provided in this application.
[0173] The memory 820 can be implemented in the form of ROM (Read-Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 820 can store the operating system 821 for controlling the operation of the electronic device 800, and the basic input / output system (BIOS) 822 for controlling the low-level operations of the electronic device 800. Additionally, it can store a web browser 823, a data storage management system 824, and an information retrieval device 825, etc. The aforementioned information retrieval device 825 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when the technical solution provided in this application is implemented through software or firmware, the relevant program code is stored in the memory 820 and is called and executed by the processor 810.
[0174] The input / output interface 813 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0175] Network interface 814 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0176] Bus 830 includes a pathway for transmitting information between various components of the device, such as processor 810, video display adapter 811, disk drive 812, input / output interface 813, network interface 814, and memory 820.
[0177] It should be noted that although the above-described device only shows the processor 810, video display adapter 811, disk drive 812, input / output interface 813, network interface 814, memory 820, bus 830, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.
[0178] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer program product. This computer program product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0179] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An information retrieval method, characterized in that, The method includes: Retrieve the search text; The search text is matched against the document graphs corresponding to each document in the document library to obtain M matching document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graph include at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document. The root node of the document graph includes the document title, and the next-level node corresponding to the root node includes a first-level title and a summary. The candidate results are sorted, and N candidate results are selected based on the sorting results to obtain the retrieval results for the retrieval text. N is a positive integer and is less than or equal to M. The candidate results are determined based on the feature representations of each document knowledge in the document graph. The feature representations of each document knowledge are obtained by encoding the embedding results of each document knowledge. The embedding results are obtained by performing embedding processing based on document knowledge type on each document knowledge.
2. The method according to claim 1, characterized in that, Matching the searched text against the document graphs corresponding to each document in the document library includes: The feature representation of the retrieved text and the feature representation of each document knowledge in the document graph are obtained using a retrieval model, wherein the feature representation of each document knowledge is obtained based on the features of the document knowledge and the hierarchical relationship features of the document knowledge in the document graph; The similarity between the feature representation of the retrieved text and the feature representation of each document knowledge is determined, and M document knowledge whose corresponding similarity satisfies the preset first similarity requirement is identified.
3. The method according to claim 2, characterized in that, The retrieval model was pre-trained using the following method: Acquire first training data comprising multiple positive and negative sample pairs, each sample pair including retrieval text samples and document knowledge samples, wherein the document knowledge samples are derived from the document graph in the document library; The retrieval model is trained using the first training data. The retrieval model is used to obtain the feature representations of the retrieved text samples and the feature representations of the document knowledge samples, and the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples is determined. The training objectives include maximizing the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples in positive sample pairs, and minimizing the similarity between the feature representations of the retrieved text samples and the feature representations of the document knowledge samples in negative sample pairs.
4. The method according to claim 1, characterized in that, The sorting of the candidate results includes: The retrieved text and each candidate result are concatenated separately. The ranking model is used to obtain the feature representation of each concatenated text sequence. The feature representation of each text sequence is used to predict the ranking score of the corresponding candidate result. The feature representation of the text sequence is obtained based on the features of the text sequence and the hierarchical relationship features of the candidate results contained in the text sequence in the document graph. Based on the ranking scores, the ranking results of each candidate result are determined.
5. The method according to claim 4, characterized in that, The ranking model was pre-trained in the following manner: Acquire second training data including multiple positive and negative sample pairs, each sample pair including retrieval text samples and document knowledge samples, wherein the document knowledge samples are derived from the document graph in the document library; The ranking model is trained using the second training data. The ranking model obtains the feature representation of the text sequence obtained by concatenating the retrieved text sample and the document knowledge sample in the sample pair. The feature representation is used to predict the ranking score of the corresponding document knowledge sample. The training objective includes maximizing the difference between the ranking score of the document knowledge sample in the positive sample pair corresponding to the same retrieved text sample and the ranking score of the document knowledge sample in the corresponding negative sample pair.
6. The method according to claim 3 or 5, characterized in that, The negative sample pairs are constructed using at least one of the following methods: Obtain the retrieval text sample and document knowledge sample from the positive sample pair, sample other document knowledge belonging to the same node as the document knowledge sample in the document graph, and form a negative sample pair from the retrieval text sample and the sampled document knowledge; A negative sample pair is formed by combining the retrieved text sample from one positive sample pair with the document knowledge sample from another positive sample pair. Obtain the retrieval text sample and document knowledge sample from the positive sample pair, randomly sample document knowledge different from the document knowledge sample in the document graph, and form a negative sample pair with the retrieval text sample and the randomly sampled document knowledge. Obtain the retrieval text sample and document knowledge sample from the positive sample pair, determine the document knowledge that meets the preset second similarity requirement with the retrieval text sample from each document graph of the document library, select document knowledge that is different from the document knowledge sample in the positive sample pair from the determined document knowledge, and form a negative sample pair with the retrieval text sample and the selected document knowledge.
7. A question-and-answer processing method, applied to an intelligent question-and-answer system, characterized in that, The method includes: The search text is obtained by using the question input by the user into the intelligent question-answering system; The search text is matched against the document graphs corresponding to each document in the document library to obtain M matching document knowledge as candidate results, where M is a preset positive integer. Each node in the document graph includes at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document. The root node of the document graph includes the document title, and the next-level node corresponding to the root node includes a first-level title and a summary. The candidate results are determined based on the feature representations of each document knowledge in the document graph. The feature representations of each document knowledge are obtained by encoding the embedding results of each document knowledge. The embedding results are obtained by performing embedding processing based on document knowledge type on each document knowledge. The candidate results are sorted, and N candidate results are selected based on the sorting results to obtain the search results for the search text, where N is a positive integer and N is less than or equal to M; The search results are used to generate an answer, which is then returned to the user.
8. An information retrieval device, characterized in that, The device includes: The input acquisition unit is configured to acquire the search text; The retrieval processing unit is configured to match the retrieval text against the document graphs corresponding to each document in the document library, and obtain M matched document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graphs include at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document. The root node of the document graph includes the document title, and the next-level node corresponding to the root node includes a first-level title and a summary. The candidate results are determined based on the feature representations of each document knowledge in the document graph. The feature representations of each document knowledge are obtained by encoding the embedding results of each document knowledge. The embedding results are obtained by performing embedding processing based on document knowledge type on each document knowledge. The sorting processing unit is configured to sort the candidate results, select N candidate results based on the sorting results to obtain the search results for the search text, where N is a preset positive integer and N is less than or equal to M.
9. An information retrieval system, characterized in that, The system includes user equipment and a server; The user equipment is configured to send search text to the server and receive search results returned by the server; The server is configured to match the searched text against the document graphs corresponding to each document in the document library, and obtain M matched document knowledge as candidate results, where M is a preset positive integer. The nodes in the document graphs include at least one type of document knowledge, which includes text units in the document, entity triples extracted from the document, or question-and-answer pairs. The hierarchical relationship between nodes reflects the structural relationship of the corresponding document knowledge in the document. The candidate results are sorted, and N candidate results are selected based on the sorting result to obtain the search results for the searched text, where N is a preset positive integer and is less than or equal to M. The root node of the document graph includes the document title, and the next-level node corresponding to the root node includes a first-level title and a summary. The candidate results are determined based on the feature representations of each document knowledge in the document graph. The feature representations of each document knowledge are obtained by encoding the embedding results of each document knowledge, and the embedding results are obtained by performing embedding processing based on the document knowledge type.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7.
11. An electronic device, characterized in that, include: One or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Information retrieval method and device and knowledge graph construction method and device
CN114706962A
Man-machine conversation and pre-training language model training method and system and electronic equipment
CN115587175A
KR1017696100000B1