Information retrieval method and apparatus

By constructing a graph to achieve information retrieval, and using the nodes and edges in the graph to represent the relationships between entity words, the shortcomings of traditional information retrieval systems in complex and multi-entity queries are solved, providing more accurate and efficient information retrieval results.

CN119848201BActive Publication Date: 2026-03-10ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Traditional information retrieval systems are significantly inadequate for complex and multi-entity related queries, and cannot provide accurate and context-relevant information retrieval results.

Method used

Information retrieval is achieved by constructing a graph, using nodes to represent entity words and edges to represent relationships. By combining named entity recognition and relevance calculation, the relevance between candidate documents and query text is determined, providing accurate information retrieval results.

Benefits of technology

It improves the accuracy and relevance of information retrieval, enhances the efficiency of information retrieval, and ensures that the retrieval results meet actual needs and are reliable and consistent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848201B_ABST
    Figure CN119848201B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present application provide an information retrieval method and device, the method comprising: obtaining a query text for triggering information retrieval, and performing named entity recognition on the query text to identify an entity word from the query text as a retrieval entity word; calculating, based on a graph, a correlation degree of each candidate entity word relative to the retrieval entity word, wherein each node in the graph represents a candidate entity word, and nodes connected by an edge in the graph represent candidate entity words having a correlation relationship; determining a preset number of candidate entity words having the highest correlation degree relative to the retrieval entity word as correlation entity words, and calculating a correlation degree of each candidate document relative to the query text according to the correlation degree of the correlation entity words relative to the retrieval entity word; determining a preset number of candidate documents having the highest correlation degree relative to the query text as correlation documents, and determining the correlation documents as information retrieval results corresponding to the query text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this application relate to the field of artificial intelligence technology, and in particular to an information retrieval method and apparatus. Background Technology

[0002] Information retrieval (IR) focuses on finding information relevant to a user's query from a large collection of documents or datasets. Traditional information retrieval systems mainly rely on keyword matching and text similarity-based algorithms to provide information retrieval results. However, this approach shows significant limitations in many areas, such as complex and multi-entity related queries (e.g., queries involving multiple entities). Summary of the Invention

[0003] One or more embodiments of this application provide the following technical solutions:

[0004] This application provides an information retrieval method, the method comprising:

[0005] Obtain the query text used to trigger information retrieval, and perform named entity recognition on the query text to identify entity words from the query text, and determine the entity words identified from the query text as retrieval entity words;

[0006] Based on the graph, the relevance of each candidate entity word to the searched entity word is calculated; wherein, each node in the graph represents each candidate entity word, and the candidate entity words represented by the nodes connected by each edge in the graph have a relationship.

[0007] A preset number of candidate entity words with the highest relevance to the search entity words are identified as related entity words, and the relevance of each candidate document to the query text is calculated based on the relevance of the related entity words to the search entity words.

[0008] A preset number of candidate documents with the highest relevance to the query text are identified as related documents, and the related documents are identified as the information retrieval results corresponding to the query text.

[0009] This application also provides an information retrieval device, the device comprising:

[0010] The word acquisition module acquires the query text used to trigger information retrieval, performs named entity recognition on the query text to identify entity words from the query text, and determines the entity words identified from the query text as retrieval entity words;

[0011] The word relevance calculation module, based on a graph, calculates the relevance of each candidate entity word to the retrieved entity word; wherein, each node in the graph represents each candidate entity word, and the candidate entity words represented by the nodes connected by each edge in the graph have a relevance relationship;

[0012] The document relevance calculation module identifies a preset number of candidate entity words with the highest relevance to the search entity words as related entity words, and calculates the relevance of each candidate document to the query text based on the relevance of the related entity words to the search entity words.

[0013] The associated document determination module identifies a preset number of candidate documents with the highest relevance to the query text as associated documents, and determines the associated documents as information retrieval results corresponding to the query text.

[0014] This application also provides an electronic device, including:

[0015] processor;

[0016] Memory used to store processor-executable instructions;

[0017] The processor executes the executable instructions to implement the steps of the method as described in any of the preceding descriptions.

[0018] This application also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method as described in any of the preceding claims.

[0019] In the above technical solution, a graph for information retrieval can be pre-constructed. Each node in the graph represents a candidate entity word, and each edge indicates that the candidate entity words represented by the connected nodes have a correlation relationship. Subsequently, when the query text used to trigger information retrieval is obtained, named entity recognition can first be performed on the query text to identify the retrieval entity words. Then, based on the constructed graph, the correlation degree of each candidate entity word with respect to the retrieval entity word can be calculated. Next, the candidate entity words with the highest correlation degree with the retrieval entity word can be identified as associated entity words. Based on the correlation degree of the associated entity words with respect to the retrieval entity word, the correlation degree of each candidate document with respect to the query text can be calculated. Finally, the candidate documents with the highest correlation degree with the query text can be identified as associated documents, and the associated documents are identified as the information retrieval results corresponding to the query text.

[0020] The above method, which incorporates graphs for information retrieval, leverages graphs to capture entity words and their relationships within searchable documents. This ensures more accurate and targeted results when retrieving documents based on entity words in the query text, compared to the original query. Furthermore, pre-constructing graphs allows for direct use during subsequent information retrieval, thereby improving the efficiency of graph-based information retrieval. Attached Figure Description

[0021] The accompanying drawings used in the description of the exemplary embodiments will now be explained, wherein:

[0022] Figure 1 This is a schematic diagram of a system illustrated in an exemplary embodiment of this application.

[0023] Figure 2 This is a schematic diagram illustrating an information retrieval process according to an exemplary embodiment of this application.

[0024] Figure 3 This is a flowchart illustrating a graph construction method in an exemplary embodiment of this application.

[0025] Figure 4A This is a schematic diagram illustrating an exemplary embodiment of this application.

[0026] Figure 4B This is a schematic diagram illustrating another figure as shown in an exemplary embodiment of this application.

[0027] Figure 4C This is a schematic diagram illustrating another figure as shown in an exemplary embodiment of this application.

[0028] Figure 5 This is a flowchart illustrating an information retrieval method according to an exemplary embodiment of this application.

[0029] Figure 6 This is a schematic diagram of the structure of a device shown in an exemplary embodiment of this application.

[0030] Figure 7 This is a block diagram illustrating an information retrieval device according to an exemplary embodiment of this application. Detailed Implementation

[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this application. Rather, they are merely examples consistent with some aspects of one or more embodiments of this application.

[0032] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this application in other embodiments. In some other embodiments, the methods may include more or fewer steps than those described in this application. Furthermore, a single step described in this application may be broken down into multiple steps in other embodiments; and multiple steps described in this application may be combined into a single step in other embodiments.

[0033] With the development of the Internet and the explosive growth of data, the demand for information retrieval is increasing, and the application of information retrieval is becoming more and more widespread.

[0034] For example, users can proactively initiate real-time information retrieval to obtain the information they need at any given time.

[0035] For example, an intelligent dialogue system can use the RAG (Retrieve and Generate) approach, combining information retrieval and model generation to provide services to users.

[0036] Intelligent dialogue systems provide services to users by simulating human communication. Specifically, an intelligent dialogue system is an interactive system developed using artificial intelligence technology. It aims to understand and answer questions posed by users in natural language and generate concise and clear answers. Intelligent dialogue systems are typically based on large language models, which understand and answer the user's questions and generate corresponding responses.

[0037] Large language models are deep learning models trained on large amounts of text data. They can be used to generate natural language text or understand the meaning of natural language text. Large language models can handle a variety of natural language tasks, such as text classification, named entity recognition (NER), question answering, and dialogue, and are an important pathway to artificial intelligence.

[0038] In the field of natural language processing, large-scale text datasets are often referred to as corpora. Corpora can contain various types of text data, such as literary works, academic papers, legal documents, news reports, everyday conversations, emails, and online forum posts. By learning from the text data in corpora, large language models can acquire and understand the rules and patterns of natural language, thereby achieving effective processing and generation of human language.

[0039] Large language models typically employ the Transformer architecture; that is, large language models are usually deep learning models based on the Transformer architecture. Deep learning models based on the Transformer architecture are a class of neural network models that utilize the Transformer architecture, and these models perform exceptionally well in fields such as natural language processing.

[0040] The Transformer is a neural network model used for sequence-to-sequence modeling. It does not rely on recursive structures, enabling parallel training and inference, thus accelerating model processing. Deep learning models based on the Transformer architecture typically use multi-layered Transformer encoders to extract features from the input sequence and a Transformer decoder to transform the extracted features into an output sequence. These models also often employ self-attention mechanisms to capture long-range dependencies in the input sequence, and residual connections and normalization methods to accelerate training and improve model performance.

[0041] Pre-trained models are large language models pre-trained on massive amounts of unlabeled text data. Pre-trained models are general-purpose models, not designed or optimized for specific tasks. To adapt pre-trained models to specific application scenarios and task requirements, fine-tuning is needed to improve the model's performance on specific tasks. The final large language model deployed is usually a model that has undergone further fine-tuning based on the pre-trained model, using supervised learning on labeled text data. Pre-training and fine-tuning are complementary processes; pre-training enables the model to possess broad language understanding capabilities, while fine-tuning makes the model more specialized and accurate for specific tasks.

[0042] In other words, the training process of a large language model can be divided into two stages: pre-training and fine-tuning. In the pre-training stage, unsupervised learning (e.g., self-supervised learning) can be used to pre-train on large-scale, unlabeled text datasets (e.g., online encyclopedias, online articles, books, etc.). Specifically, it can predict missing parts or the next word based on context, learn semantic, syntactic, and other statistical rules and language structures, and minimize the prediction loss through backpropagation and optimization algorithms (e.g., gradient descent), iteratively updating the model parameters and gradually improving the model's ability to understand language. During the fine-tuning phase, a suitable supervised learning task (e.g., text classification, named entity recognition, question answering systems, dialogue systems, etc.) can be selected based on the specific application scenario and task requirements. A task-specific text dataset is prepared, allowing the pre-trained model to serve as the starting point for fine-tuning. Supervised learning is then employed on this task-specific text dataset, where the task can be executed. Backpropagation and optimization algorithms (e.g., gradient descent) are used to minimize the loss used to measure the model's performance on the specific task, iteratively updating the model parameters to gradually improve its performance. In practical applications, fine-tuning can flexibly choose supervised, unsupervised, or semi-supervised learning methods based on the specific application scenario and the type of available data.

[0043] It should be noted that the pre-trained large language model is usually referred to as the base model of the large language model, while the fine-tuned large language model is referred to as the service model of the large language model. The language understanding ability learned by the large language model in the pre-training and fine-tuning stages enables it to perform logical inference, knowledge reasoning, or problem-solving by understanding, analyzing, and synthesizing textual information when faced with complex problems or tasks. This ability is usually referred to as the reasoning ability of the large language model.

[0044] Large language models typically perform specific tasks under the guidance of prompt text. Prompt text is an initial text or text fragment provided to the large language model to elicit a corresponding output. Through prompt text, the expected task can be explicitly told to the large language model, such as answering a question, simulating a dialogue, writing an article, or translating text. Simultaneously, prompt text can provide the large language model with necessary background information and context, enabling it to understand the logic, style, theme, or stance that should be followed when generating content. Furthermore, prompt text can also stimulate the large language model to demonstrate its inherent knowledge or specific language abilities, such as explaining complex concepts, citing rules, or mimicking the writing style of a particular author.

[0045] Intelligent dialogue systems primarily rely on the knowledge acquired by their large language models during training from static corpora. Due to the limitations of this knowledge, the system may encounter the illusion problem when answering complex or specific questions. The illusion problem refers to the situation where the content generated by the large language model appears very reasonable and coherent, sometimes even mimicking human emotions and thought processes, creating the illusion of "understanding" the input content, when in reality this content is inaccurate or misleading. In other words, this reliance on static corpora limits the adaptability and response accuracy of intelligent dialogue systems.

[0046] To improve the adaptability and response accuracy of intelligent dialogue systems, the Retrieval-Augmented Generation (RAG) approach can be adopted, combining information retrieval and model generation. This allows the intelligent dialogue system to answer user questions without solely relying on the knowledge gained by the large language model during training from static corpora. Instead, it can first perform information retrieval based on the question within a large document set, then understand and answer the question using the retrieved relevant documents, and generate the corresponding response. In other words, the document set can be combined with the large language model, retrieving relevant information from the document set in real time during model generation to assist the model in making more accurate and comprehensive answers or decisions. Because the model generation process considers the retrieved information and the context of the question, it ensures that the generated content is not only consistent with actual needs but also accurate, reliable, coherent, and natural.

[0047] For information retrieval, traditional information retrieval systems mainly rely on keyword matching and text similarity-based algorithms to provide information retrieval results. However, this approach has significant shortcomings in many aspects, such as complex and multi-entity related queries.

[0048] To handle complex queries and queries involving multiple entities in the information retrieval process, graphs can be used to implement information retrieval.

[0049] Graphs are data stored and managed using a graphical structure. In a graph, nodes, edges, and properties are used to store data. This storage method is well-suited for representing complex relationships between entities. In a graph, nodes represent entities such as people, places, and events, and each node can have multiple properties to describe specific information about the entity. Edges represent relationships between nodes, such as "knows," "belongs to," and "located in." Edges can also contain properties to describe the characteristics of the relationship, such as the strength of the relationship and when it was established. Attributes are data fields attached to nodes or edges to store specific information, such as a person's name, age, or the start date of the relationship.

[0050] Combining graphs with information retrieval allows us to capture entities and the relationships between them. For complex queries or queries involving multiple entities and their interactions, graphs can provide more accurate and context-sensitive information retrieval results.

[0051] This application provides one or more embodiments of a technical solution for information retrieval. In this solution, a graph for information retrieval can be pre-constructed, where each node represents a candidate entity word, and each edge indicates that the candidate entity words represented by the connected nodes have a correlation relationship. Subsequently, when a query text for triggering information retrieval is obtained, named entity recognition can first be performed on the query text to identify the retrieval entity words. Then, based on the constructed graph, the correlation degree of each candidate entity word relative to the retrieval entity word can be calculated. Next, the candidate entity words with the highest correlation degree relative to the retrieval entity word can be determined as associated entity words. Based on the correlation degree of the associated entity words relative to the retrieval entity word, the correlation degree of each candidate document relative to the query text can be calculated. Finally, the candidate documents with the highest correlation degree relative to the query text can be determined as associated documents, and the associated documents are determined as the information retrieval results corresponding to the query text.

[0052] The above method, which incorporates graphs for information retrieval, leverages graphs to capture entity words and their relationships within searchable documents. This ensures more accurate and targeted results when retrieving documents based on entity words in the query text, compared to the original query. Furthermore, pre-constructing graphs allows for direct use during subsequent information retrieval, thereby improving the efficiency of graph-based information retrieval.

[0053] Please refer to Figure 1 , Figure 1 This is a schematic diagram of a system illustrated in an exemplary embodiment of this application.

[0054] like Figure 1 As shown, the system may include a server and at least one client that accesses the server via any type of wired or wireless network.

[0055] The aforementioned server can correspond to a server containing a single physical host, or a server cluster consisting of multiple independent physical hosts; alternatively, it can correspond to a virtual server, cloud server, etc., hosted by a host cluster.

[0056] The aforementioned client can correspond to terminal devices such as smartphones, tablets, laptops, desktop computers, PCs (Personal Computers), PDAs (Personal Digital Assistants), wearable devices (e.g., smart glasses, smartwatches), smart in-vehicle devices, or game consoles.

[0057] like Figure 1 The system shown can be an information retrieval system. Users can use the information retrieval services provided by the information retrieval system through the aforementioned client; the aforementioned client and the aforementioned server can realize user-oriented information retrieval services through data interaction with each other.

[0058] For example, a client can display a specific user interface, allowing the user to perform actions such as entering query text (called a Query) and selecting the scope of information retrieval (such as a collection of documents in a specific field) to initiate a query to the information retrieval system and use the information retrieval services provided by the system. The client can send the user-input query text to the server, which then performs an information retrieval based on the query text within its document collection, obtaining the corresponding retrieval results (such as retrieved documents). These results are then output to the user, returning them to the client, which displays them to the user through the user interface, thus providing a user-facing information retrieval service.

[0059] Specifically, the aforementioned server can be equipped with an information retrieval component, which performs the information retrieval operation based on the query text within a document collection hosted on the server. Furthermore, the server can also host a graph corresponding to the document collection, allowing the information retrieval component to use the graph for information retrieval.

[0060] Continue to refer to Figure 1 ,like Figure 1 The system shown can also be an intelligent dialogue system capable of providing information retrieval services. Users can use the intelligent dialogue services provided by this system through the aforementioned client; the client and server can achieve user-oriented intelligent dialogue services through data interaction.

[0061] For example, the client can display a user interface, allowing the user to ask questions to the intelligent dialogue system by inputting query text (or a query or question) and uploading documents to aid the query. The client can then send the user's query text to the server, which will infer the answer text and generate a corresponding response text (or answer). This response text is then returned to the client, which displays the answer text to the user through the user interface, thus providing a user-facing intelligent dialogue service.

[0062] Specifically, the aforementioned server can be equipped with a large language model, and the aforementioned intelligent dialogue system can be based on this large language model, which can understand and answer the query text input by the user and generate the answer text corresponding to the query text.

[0063] At this point, the aforementioned large language model can refer to its service model. In practical applications, the constructed large language model can be pre-trained on a large-scale, unlabeled text dataset using unsupervised learning to obtain its base model. Furthermore, the dialogue task can be used as a supervised learning task for fine-tuning, and a dialogue task-specific text dataset can be prepared. Thus, the base model of the large language model can be used as the starting point for fine-tuning, and supervised learning can be used to fine-tune it on the dialogue task-specific text dataset to obtain the service model of the large language model.

[0064] To improve the adaptability and response accuracy of the aforementioned intelligent dialogue system, the server can also be equipped with a document collection and an information retrieval component. During the reasoning process of the service model of the large language model, the information retrieval component performs information retrieval based on the query text within the document collection. The retrieved relevant documents then assist the service model in generating the answer text corresponding to the user's input query text. Furthermore, the server can also be equipped with a graph corresponding to the document collection, allowing the information retrieval component to use this graph for information retrieval.

[0065] In practical applications, the aforementioned server can also be equipped with other functional components or subsystems, such as a prompt generation component. These components or subsystems can work in conjunction with the large language model on the server to generate answer text corresponding to the user's input query text.

[0066] Please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating an information retrieval process according to an exemplary embodiment of this application.

[0067] like Figure 2 As shown, in the above information retrieval process, to improve the efficiency of information retrieval combined with graphs, a graph that facilitates information retrieval can be pre-constructed, allowing direct use of the constructed graph during subsequent information retrieval processes. In this graph, each node represents a candidate entity word, and the nodes connected by edges represent candidate entity words with related relationships. It should be noted that graph construction can be done offline, while information retrieval using the constructed graph is done online.

[0068] When constructing the graph, firstly, candidate documents can be obtained, and named entity recognition can be performed on each candidate document to identify entity words. Then, based on the entity words identified from these candidate documents, subject-verb-object triples can be extracted from each candidate document, and the entity words in each subject-verb-object triple are identified as entity words with a relationship. Next, the entity words identified from these candidate documents and the entity words in these subject-verb-object triples can be identified as candidate entity words. Furthermore, the similarity between each target candidate entity word and other candidate entity words can be calculated, and the candidate entity words with the highest similarity are identified as candidate entity words with a relationship to the target candidate entity word. Finally, a graph can be constructed based on these candidate entity words and their relationships.

[0069] In addition, specific information can be statistically analyzed for the candidate documents. For example, the frequency of each candidate entity word in each candidate document can be counted, and the correspondence between the candidate entity word, the candidate document, and the frequency of the candidate entity word in the candidate document can be stored.

[0070] When using the constructed graph for information retrieval, firstly, the query text used to trigger the retrieval can be obtained, and named entity recognition can be performed on the query text to identify entity words. These identified entity words are then designated as retrieval entity words. Furthermore, the similarity between the identified entity words and each candidate entity word can be calculated, and the candidate entity words with the highest similarity are also designated as retrieval entity words. Next, based on the constructed graph, the relevance of each candidate entity word to each retrieval entity word can be calculated, and the candidate entity words with the highest relevance are designated as associated entity words. Then, based on the relevance of each associated entity word to each retrieval entity word, the relevance of each candidate document to the query text can be calculated. Finally, the candidate documents with the highest relevance to the query text are designated as associated documents, and these associated documents are identified as the information retrieval results corresponding to the query text.

[0071] The information retrieval method provided in this application will be described in detail below from the two aspects of graph construction and use.

[0072] I. Graph Construction

[0073] First, it's important to clarify that in the constructed graph, a node can represent an entity word (or candidate entity word), where an entity word refers to a word used to represent a concrete or abstract entity. An edge connects two nodes, indicating a relationship between the candidate entity words represented by the two connected nodes. For example, suppose an edge in the graph connects node A and node B, where node A represents candidate entity word A and node B represents candidate entity word B; then this edge indicates a relationship between candidate entity words A and B.

[0074] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a graph construction method in an exemplary embodiment of this application.

[0075] like Figure 3 As shown, the graph construction method described above may include the following steps:

[0076] Step 302: Obtain candidate documents and perform named entity recognition on the candidate documents to identify entity words from the candidate documents.

[0077] In this embodiment, one or more documents (referred to as candidate documents) can be obtained for constructing the graph. It should be noted that after constructing the graph based on these candidate documents, the graph should be used within these candidate documents for subsequent information retrieval; otherwise, inconsistencies in document information may occur, leading to retrieval failure. For example, assuming these candidate documents originate from a corpus, after constructing the graph based on these candidate documents, if information retrieval is to be performed using the graph, the corpus needs to be set as the retrieval scope, i.e., the information retrieval should be performed within the candidate documents contained in that corpus.

[0078] Having obtained the aforementioned candidate documents, named entity recognition can be performed on each candidate document to identify named entities from each candidate document. Since named entities themselves belong to entity words, the named entities identified through named entity recognition can be directly determined as entity words.

[0079] In some embodiments, a large language model can be used to perform named entity recognition on the candidate documents. Specifically, each candidate document can be input into the large language model, which then performs named entity recognition on each candidate document.

[0080] At this point, the aforementioned large language model can refer to its service model. In practical applications, the constructed large language model can be pre-trained on a large-scale, unlabeled text dataset using unsupervised learning to obtain its base model. Furthermore, the named entity recognition task can be used as a supervised learning task for fine-tuning training, and a text dataset specific to the named entity recognition task can be prepared. Thus, the base model of the large language model can be used as the starting point for fine-tuning, and supervised learning can be employed to fine-tune the training on the named entity recognition task-specific text dataset to obtain the service model of the large language model.

[0081] Step 304: Based on the entity words identified from the candidate documents, extract subject-verb-object triples from the candidate documents, and determine the entity words in the subject-verb-object triples as entity words with related relationships.

[0082] In this embodiment, if the entity words are identified from the candidate documents, subject-verb-object triples can be further extracted from each candidate document based on these entity words.

[0083] The subject-predicate-object triple is a commonly used concept in natural language processing, information extraction, and knowledge graphs, used to represent the basic semantic structure of a sentence. A typical subject-predicate-object triple consists of three parts: the subject (S), the predicate (P), and the object (O). The subject is the entity that performs the action or is described; the predicate represents the action or state of the subject, usually composed of a verb; and the object is the entity that receives the action.

[0084] In a subject-verb-object triple, the subject and object are both entities, while the verb can usually be considered as the relationship between these two entities. Therefore, after extracting the subject-verb-object triples from the candidate documents mentioned above, the entity words (usually the subject and object) in each subject-verb-object triple can be identified as entity words with a relational relationship.

[0085] Taking the sentence "Xiaoming ate an apple" as an example, in the subject-verb-object triple extracted from this sentence, the subject is "Xiaoming," the verb is "ate," and the object is "apple." In this case, "Xiaoming" and "apple" can be identified as two entity words, and these two entity words can be identified as having a relational relationship.

[0086] In practical applications, OpenIE (Open Information Extraction) technology can be used to extract subject-verb-object triples from the aforementioned candidate documents. OpenIE is an information extraction technology that aims to automatically extract factual statements from unannotated text and represent them as structured triples (usually subject-verb-object).

[0087] In some embodiments, a large language model can be used to extract subject-verb-object triples from each candidate document based on entity words identified from the candidate documents. Specifically, the entity words identified from these candidate documents and each candidate document can be input into the large language model, which then extracts subject-verb-object triples from each candidate document based on the entity words identified from these candidate documents.

[0088] At this point, the aforementioned large language model can refer to its service model. In practical applications, the constructed large language model can be pre-trained on a large-scale, unlabeled text dataset using unsupervised learning to obtain its base model. Furthermore, the triple extraction task can be used as a supervised learning task for fine-tuning training, and a text dataset specific to the triple extraction task can be prepared. Thus, the base model of the large language model can be used as the starting point for fine-tuning, and supervised learning can be employed to fine-tune the training on the text dataset specific to the triple extraction task to obtain the service model of the large language model.

[0089] It should be noted that extracting subject-verb-object triples from these candidate documents, based on the entity words identified, ensures the most comprehensive information extraction and minimizes omissions. This is because these entity words are essentially named entities with specific meanings. Named entities are often the most important information carriers in a sentence, quickly locating the core content and accurately identifying the subject and object. The relationships between named entities are also usually the most crucial part of the sentence. Constructing subject-verb-object triples based on named entities makes information extraction more focused and targeted, avoiding inaccurate extraction due to ambiguity or misinterpretation, and better capturing the relationships between entities, ensuring the completeness of information extraction. Furthermore, for sentences containing multiple clauses or complex structures, directly extracting subject-verb-object triples is difficult, but named entities provide a reliable starting point to help parse complex sentence structures, thereby achieving a more comprehensive understanding of the sentence's meaning and correctly extracting information.

[0090] In some embodiments, to improve the processing efficiency and accuracy of the aforementioned candidate documents, the original candidate documents can be cleaned first, and then the cleaned candidate documents can be processed by named entity recognition, subject-verb-object triple extraction, etc. Specifically, the cleaning operation may include deduplication, long text segmentation, and removal of irrelevant words.

[0091] Step 306: The entity words identified from the candidate documents and the entity words in the subject-verb-object triples are determined as candidate entity words, and a graph is constructed based on the candidate entity words and their relationships.

[0092] In this embodiment, the entity words identified from the candidate documents and the entity words in the subject-verb-object triples extracted from these candidate documents can be determined as candidate entity words. Furthermore, based on the entity words with related relationships, it can be further determined whether these candidate entity words have any related relationships with each other. Thus, a graph can be constructed based on these candidate entity words and their related relationships. Specifically, a node in the graph can represent a candidate entity word, and an edge in the graph can indicate that the candidate entity words represented by the two nodes connected by this edge have a related relationship.

[0093] It should be noted that the entity words identified from the candidate documents may overlap with the entity words in the subject-verb-object triples extracted from these candidate documents. Therefore, when identifying these entity words as candidate entity words, deduplication can be performed to ensure that the identified candidate entity words are distinct from each other, and that each candidate entity word is unique.

[0094] For example, assuming that the entity words identified from the candidate documents include entity word A and entity word B, and the entity words in the subject-verb-object triples extracted from these candidate documents include entity word A, entity word B, and entity word C, then entity word A, entity word B, and entity word C can be identified as candidate entity word A, candidate entity word B, and candidate entity word C, respectively. Further assuming that entity word A and entity word B belong to the same subject-verb-object triple, and entity word A and entity word C belong to the same subject-verb-object triple, that is, entity word A and entity word B are related entities, and entity word A and entity word C are related entities, then it can be determined that candidate entity word A and candidate entity word B are related, and candidate entity word A and candidate entity word C are related. In this case, the constructed graph can be as follows: Figure 4A As shown, nodes A, B, and C represent candidate entity words A, B, and C, respectively. Nodes A and B are connected by an edge, and nodes A and C are also connected by an edge.

[0095] In some embodiments, to construct a richer graph and make the relationships between different entity words clearer, other entity words similar to each named entity can be found, and a graph can be constructed based on these similar entity words. Specifically, the aforementioned candidate entity words can be used as target candidate entity words, the similarity between the target candidate entity words and each other candidate entity word can be calculated, and the candidate entity words with the highest similarity (i.e., Top K) can be identified as candidate entity words that are associated with the target candidate entity words.

[0096] In some embodiments, word embedding techniques can be used to calculate the similarity between different entity words. Specifically, when calculating the similarity between the target candidate entity word (let's say candidate entity word A) and any other candidate entity word (let's say candidate entity word B), embedding processing can be performed on candidate entity word A and candidate entity word B respectively to obtain embedding vectors corresponding to candidate entity word A and candidate entity word B respectively. Thus, the similarity between the embedding vector corresponding to candidate entity word A and the embedding vector corresponding to candidate entity word B can be calculated as the similarity between candidate entity word A and candidate entity word B.

[0097] In practical applications, the K-nearest neighbor algorithm can be used to conveniently determine the Top K candidate entity words with the highest similarity to the target candidate entity words.

[0098] Continue as Figure 4A Taking the example shown, suppose the two candidate entity words with the highest similarity to candidate entity word A are candidate entity word D and candidate entity word E, where the similarity between candidate entity word A and candidate entity word D is 90%, and the similarity between candidate entity word A and candidate entity word E is 88%. Then it can be determined that candidate entity word A and candidate entity word D are related, and candidate entity word A and candidate entity word E are also related. In this case, the constructed graph can be as follows: Figure 4B As shown, nodes A, B, C, D, and E represent candidate entity words A, B, C, D, and E, respectively. Nodes A and B are connected by an edge, nodes A and C are connected by an edge, nodes A and D are connected by an edge, and nodes A and E are also connected by an edge.

[0099] In some embodiments, to make the relationships between different entity words clearer and more explicit, corresponding weights can be assigned to each edge in the constructed graph. In this graph, if nodes representing candidate entity words that belong to the same subject-verb-object triplet are called first-type nodes, and nodes representing candidate entity words that are similar are called second-type nodes, then the weight of the edge connecting the first-type nodes can be a preset value, and the weight of the edge connecting the second-type nodes can be the similarity between the candidate entity words represented by the second-type nodes.

[0100] Continue as Figure 4A and Figure 4BTaking the example shown, since candidate entity A and candidate entity B belong to the same subject-verb-object triple, and candidate entity A and candidate entity C belong to the same subject-verb-object triple, the weight of the edge connecting node A and node B can be set to 1, and the weight of the edge connecting node A and node C can also be set to 1. Since the similarity between candidate entity A and candidate entity D is 90%, and the similarity between candidate entity A and candidate entity E is 88%, the weight of the edge connecting node A and node D can be set to 0.9, and the weight of the edge connecting node A and node E can be set to 0.88. In this case, the constructed graph can be as follows: Figure 4C As shown.

[0101] It should be noted that the edges in the above graph are usually undirected. However, in some special cases, in order to better represent the relationships between candidate entity words, the edges in the graph can also be directed, and this application does not impose any restrictions on this.

[0102] Furthermore, the construction logic of the above graph can be flexibly adjusted according to actual needs. For example, based on actual needs, a group of candidate entity words that are more critical in the application scenario can be selected, and the in-degree (i.e., the number of edges connecting the node) of the node representing the candidate entity word in the constructed graph can be adjusted by adjusting the number of other candidate entity words similar to the selected candidate entity word.

[0103] In some embodiments, to further improve the efficiency of information retrieval, specific information can be statistically analyzed for the candidate documents. For example, the frequency of each candidate entity word in each candidate document can be counted, and the correspondence between the candidate entity word (specifically, its unique identifier), the candidate document (specifically, its unique identifier), and the frequency of the candidate entity word in that candidate document can be stored, as shown in Table 1 below:

[0104] Table 1

[0105] Candidate entity words Candidate documents Number of occurrences Candidate entity word A Candidate document 1 18 Candidate entity word B Candidate document 1 26 Candidate entity word A Candidate document 2 12 …… …… ……

[0106] II. Use of Diagrams

[0107] Please refer to Figure 5 , Figure 5 This is a flowchart illustrating an information retrieval method according to an exemplary embodiment of this application.

[0108] like Figure 5 As shown, the above information retrieval method may include the following steps:

[0109] Step 502: Obtain the query text used to trigger information retrieval, and perform named entity recognition on the query text to identify entity words from the query text, and determine the entity words identified from the query text as retrieval entity words.

[0110] In this embodiment, a query text used to trigger information retrieval can be obtained. Once the query text is obtained, named entity recognition can be performed on it to identify entity words. It should be noted that the entity words identified from the query text can be used as retrieval entity words for subsequent information retrieval.

[0111] In some embodiments, a large language model can be used to perform named entity recognition on the query text. Specifically, the query text can be input into the large language model, which will then perform named entity recognition on the query text.

[0112] At this point, the aforementioned large language model can refer to the service model of that large language model. It should be noted that, in order to ensure the consistency of the identified named entities and facilitate information retrieval, this large language model and the large language model used for named entity recognition of the aforementioned candidate documents can be the same large language model.

[0113] In some embodiments, while the named entities identified from the query text may reflect the main intent of the query, they may not be sufficient to fully cover the deeper meaning of the query. Therefore, to expand the semantic scope of the query and improve the accuracy of information retrieval, other entity words similar to each named entity can be found and identified as retrieval entity words as well. Specifically, for an entity word identified from the query text, the similarity between this entity word and each candidate entity word can be used, and the candidate entity words with the highest similarity (i.e., Top K) can also be identified as retrieval entity words.

[0114] In some embodiments, when calculating the similarity between any entity word (let's say entity word A) and any candidate entity word (let's say candidate entity word B) identified from the query text, entity word A and candidate entity word B can be embedded separately to obtain embedding vectors corresponding to entity word A and candidate entity word B, respectively. Thus, the similarity between the embedding vector corresponding to entity word A and the embedding vector corresponding to candidate entity word B can be calculated as the similarity between entity word A and candidate entity word B.

[0115] In practical applications, the K-nearest neighbor algorithm can be used to conveniently determine the Top K candidate entity words with the highest similarity to each entity word identified from the above query text.

[0116] Step 504: Based on the graph, calculate the relevance of each candidate entity word to the retrieved entity word.

[0117] In this embodiment, since the constructed graph nodes can reflect the association relationships of different candidate entity words, the above-mentioned search entity words can be found in the graph first, and then the association degree of each candidate entity word with each search entity word can be calculated.

[0118] In some embodiments, a random walk algorithm can be used. In the graph, the node representing each of these search entity terms is taken as the starting node, and a probability metric is calculated for walking from the starting node to other nodes. Based on this probability metric, the relevance of the candidate entity terms represented by the other nodes to each search entity term is determined. Specifically, for a search entity term, a random walk algorithm can be used. In the graph, the node representing this search entity term is taken as the starting node, and a probability metric is calculated for walking from this starting node to other nodes. Based on this probability metric, the relevance of the candidate entity terms represented by the other nodes to this search entity term is determined.

[0119] Random walks are probabilistic algorithms widely used in graph theory, statistical physics, computer science, and many other fields. They describe a process of moving across a graph or other structure, where each move is randomly chosen. Depending on the application, random walks can be used to explore graphs, simulate physical processes, analyze network characteristics, and more.

[0120] In a random walk algorithm, given a graph, starting from a given node, neighboring nodes are randomly selected as the next destination according to certain rules (usually a uniform or weighted probability distribution). Specifically, for each node in an undirected graph, if it is connected by N edges with no weight, the probability of moving from this node to any of its neighbors is 1 / N. For each node in a directed graph, if it has M outgoing edges with no weight, the probability of moving from this node to any of its neighbors is 1 / M. If the edges in the graph have weights, the transition probabilities can be adjusted according to the edge weights; for example, normalized weights can be used as the transition probabilities.

[0121] The stopping condition for a random walk algorithm can be set to stop after a fixed number of steps, or it can be set to stop after the walk has visited all possible nodes, or other specific conditions can be used to determine when to stop.

[0122] The random walk algorithm can be used to obtain the probability distribution of each node in the graph in a steady state, which represents the probability of starting from the starting node and staying at each node.

[0123] In practical applications, the above-mentioned random walk algorithm can specifically be the PageRank algorithm or the PersonalizedPageRank algorithm.

[0124] Step 506: Determine the preset number of candidate entity words with the highest relevance to the search entity words as related entity words, and calculate the relevance of each candidate document to the query text based on the relevance of the related entity words to the search entity words.

[0125] In this embodiment, the candidate entity words with the highest relevance to the aforementioned search entity words (i.e., TopK) can be determined as related entity words. Specifically, for a search entity word, the Top K candidate entity words with the highest relevance to this search entity word can be determined as related entity words of this search entity word.

[0126] Once the related entity words for each search entity word are determined, the relevance of each candidate document to the query text can be calculated based on the relevance of each related entity word to each search entity word. For example, the sum of the relevances of the related entity words appearing in each candidate document to each search entity word can be used as the relevance of that candidate document to the query text.

[0127] In some embodiments, for each candidate document, not only does the relevance of the associated entity words in the candidate document to the search entity words affect the relevance of the candidate document to the query text, but the frequency of occurrence of the associated entity words in the candidate document also affects the relevance of the candidate document to the query text. Therefore, the relevance of the candidate document to the query text can be calculated based on the relevance of each associated entity word to each search entity word and the frequency of occurrence of each associated entity word in the candidate document.

[0128] In some embodiments, each candidate document can be sequentially identified as the target document. First, the relevance of each associated entity word to the aforementioned search entity word is calculated, and the product of this relevance and the frequency of occurrence of the associated entity word in the target candidate document is used as the relevance of the associated entity word to the query text. Subsequently, the sum of the relevances of each associated entity word to the query text can be calculated as the relevance of the target document to the query text.

[0129] For example, suppose we have candidate document 1, search entity term A, search entity term B, candidate entity term C, and candidate entity term D, where the relevance of candidate entity term C to search entity term A is 0.9, the relevance of candidate entity term C to search entity term B is 0.88, candidate entity term C appears 15 times in candidate document 1, the relevance of candidate entity term D to search entity term A is 0.95, the relevance of candidate entity term D to search entity term B is 0.55, and candidate entity term D appears 10 times in candidate document 1, then we can have the following formula:

[0130] The relevance of candidate entity C to the query text is (0.9+0.88) / 2*15=13.35 (where (0.9+0.88) / 2 is the average relevance of candidate entity C to all retrieved entity words);

[0131] The relevance of candidate entity term D to the query text is (0.95+0.55) / 2*10=7.5 (where (0.95+0.55) / 2 is the average relevance of candidate entity term D to all retrieved entity terms);

[0132] The relevance of candidate document 1 to the query text is 13.35 + 7.5 = 20.85.

[0133] Step 508: Determine the preset number of candidate documents with the highest relevance to the query text as related documents, and determine the related documents as the information retrieval results corresponding to the query text.

[0134] In this embodiment, after calculating the relevance of each candidate document to the query text, a preset number (i.e., Top K) of candidate documents with the highest relevance to the query text can be identified as related documents. These related documents can then be determined as the information retrieval results corresponding to the query text. Specifically, these candidate documents can be sorted in descending order of relevance to the query text, and the top K candidate documents are identified as related documents based on the sorting results.

[0135] Alternatively, the sorting results can be directly used as the information retrieval results corresponding to the query text. This application does not impose any special restrictions on this.

[0136] As mentioned earlier, intelligent dialogue systems can employ a RAG (Rapid Argumentation and Query) approach, combining information retrieval and model generation to provide services to users. In this case, the query text and the information retrieval results can be input into a large language model (MLM). The MLM then uses this information to reason and generate the corresponding answer text. For example, based on the query text and the information retrieval results, a prompt text can be constructed to stimulate the MLM to use the context of the information retrieval results and the query text to perform a dialogue task. This prompt text can then be input into the MLM, which, guided by the prompt text, can then reason based on the query text and the information retrieval results to generate the corresponding answer text.

[0137] At this point, the aforementioned large language model can refer to the service model of the large language model, which is obtained by fine-tuning based on the dialogue task.

[0138] It should be noted that the large language model used to perform the dialogue task can be the same large language model as the large language model used for named entity recognition and the large language model used for subject-verb-object triple extraction, or they can be different large language models. This application does not impose any special restrictions on this.

[0139] In the above technical solution, a graph for information retrieval can be pre-constructed. Each node in the graph represents a candidate entity word, and each edge indicates that the candidate entity words represented by the connected nodes have a correlation relationship. Subsequently, when the query text used to trigger information retrieval is obtained, named entity recognition can first be performed on the query text to identify the retrieval entity words. Then, based on the constructed graph, the correlation degree of each candidate entity word with respect to the retrieval entity word can be calculated. Next, the candidate entity words with the highest correlation degree with the retrieval entity word can be identified as associated entity words. Based on the correlation degree of the associated entity words with respect to the retrieval entity word, the correlation degree of each candidate document with respect to the query text can be calculated. Finally, the candidate documents with the highest correlation degree with the query text can be identified as associated documents, and the associated documents are identified as the information retrieval results corresponding to the query text.

[0140] The above method, which incorporates graphs for information retrieval, leverages graphs to capture entity words and their relationships within searchable documents. This ensures more accurate and targeted results when retrieving documents based on entity words in the query text, compared to the original query. Furthermore, pre-constructing graphs allows for direct use during subsequent information retrieval, thereby improving the efficiency of graph-based information retrieval.

[0141] Corresponding to the embodiments of the methods described above, this application also provides embodiments of the apparatus.

[0142] Please refer to Figure 6 , Figure 6 This is a schematic diagram illustrating the structure of a device according to an exemplary embodiment of this application. At the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, memory 608, and non-volatile memory 610, and may also include other necessary hardware. One or more embodiments of this application can be implemented in software, for example, the processor 602 reads the corresponding computer program from the non-volatile memory 610 into memory 608 and then runs it. Of course, besides software implementation, one or more embodiments of this application do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution entity of the following processing flow is not limited to individual logic modules, but can also be hardware or logic devices.

[0143] Please refer to Figure 7 , Figure 7 This is a block diagram illustrating an information retrieval device according to an exemplary embodiment of this application.

[0144] The above-mentioned information retrieval device can be applied to Figure 6 The apparatus shown is used to implement the technical solution of this application. The apparatus includes:

[0145] The word acquisition module 702 acquires the query text used to trigger information retrieval, performs named entity recognition on the query text to identify entity words from the query text, and determines the entity words identified from the query text as retrieval entity words;

[0146] The word association calculation module 704, based on a graph, calculates the association degree of each candidate entity word with the retrieved entity word; wherein, each node in the graph represents each candidate entity word, and the candidate entity words represented by the nodes connected by each edge in the graph have an association relationship;

[0147] The document relevance calculation module 706 determines a preset number of candidate entity words with the highest relevance to the search entity words as related entity words, and calculates the relevance of each candidate document to the query text based on the relevance of the related entity words to the search entity words.

[0148] The associated document determination module 708 determines a preset number of candidate documents with the highest relevance to the query text as associated documents, and determines the associated documents as information retrieval results corresponding to the query text.

[0149] In some embodiments, the apparatus further includes:

[0150] The model generation module inputs the query text and the information retrieval results into the large language model, which then performs reasoning based on the query text and the information retrieval results to generate the answer text corresponding to the query text.

[0151] In some embodiments, the apparatus further includes a graph construction module for:

[0152] The candidate documents are obtained, and named entity recognition is performed on the candidate documents to identify entity words from the candidate documents;

[0153] Based on the entity words identified from the candidate documents, subject-verb-object triples are extracted from the candidate documents, and the entity words in the subject-verb-object triples are identified as entity words with related relationships.

[0154] The entity words identified from the candidate documents and the entity words in the subject-verb-object triples are determined as candidate entity words, and the graph is constructed based on the candidate entity words and their relationships.

[0155] In some embodiments, the graph building module is further configured to:

[0156] Calculate the similarity between each target candidate entity word and each other candidate entity word, and determine the candidate entity words with the highest similarity to a predetermined number of other candidate entity words as candidate entity words that are related to the target candidate entity word.

[0157] In some embodiments, each edge in the graph is assigned a corresponding weight; wherein, the weight of the edge connecting the first type of node is a preset value, and the weight of the edge connecting the second type of node is the similarity of the candidate entity words represented by the second type of node; the candidate entity words represented by the first type of node are candidate entity words belonging to the same subject-verb-object triplet; and the candidate entity words represented by the second type of node are similar candidate entity words.

[0158] In some embodiments, the named entity recognition for the candidate documents includes:

[0159] The candidate documents are input into a large language model, which then performs named entity recognition on the candidate documents.

[0160] The named entity recognition for the query text includes:

[0161] The query text is input into the large language model, which then performs named entity recognition on the query text.

[0162] In some embodiments, the step of extracting subject-verb-object triples from the candidate documents based on entity words identified from the candidate documents includes:

[0163] The entity words identified from the candidate documents and the candidate documents are input into a large language model, and the large language model extracts subject-verb-object triples from the candidate documents based on the entity words identified from the candidate documents.

[0164] In some embodiments, the graph building module is further configured to:

[0165] Count the number of times each candidate entity word appears in each candidate document, and store the correspondence between the candidate entity word, the candidate document, and the number of times the candidate entity word appears in the candidate document.

[0166] In some embodiments, the word acquisition module is further configured to:

[0167] Calculate the similarity between the entity words identified from the query text and each candidate entity word, and determine the candidate entity words with the highest similarity as the search entity words.

[0168] In some embodiments, calculating the similarity between different entity words includes:

[0169] Each entity word is embedded to obtain an embedding vector corresponding to each entity word;

[0170] Calculate the similarity between the embedding vectors corresponding to different entity words, and use this as the similarity between the different entity words.

[0171] In some embodiments, calculating the relevance of each candidate entity word to the retrieved entity word based on the graph includes:

[0172] Based on the random walk algorithm, in the graph, the node representing the search entity word is taken as the starting node, the probability measure of walking from the starting node to other nodes is calculated, and the relevance of the candidate entity words represented by other nodes to the search entity word is determined according to the probability measure.

[0173] In some embodiments, calculating the relevance of each candidate document to the query text based on the relevance of the associated entity term to the search entity term includes:

[0174] The relevance of each candidate document to the query text is calculated based on the relevance of the associated entity words to the search entity words and the number of times the associated entity words appear in each candidate document.

[0175] In some embodiments, calculating the relevance of each candidate document to the query text based on the relevance of the associated entity term to the search entity term and the number of times the associated entity term appears in each candidate document includes:

[0176] Each candidate document is sequentially identified as the target document, and the relevance of each associated entity word to the search entity word is calculated. The product of the relevance of each associated entity word to the number of times it appears in the target candidate document is used as the relevance of the associated word to the query text.

[0177] The sum of the relevance of each related entity word to the query text is calculated as the relevance of the target document to the query text.

[0178] For the device embodiments, they basically correspond to the method embodiments; therefore, relevant details can be found in the descriptions of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the technical solution of this application according to actual needs.

[0179] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.

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

[0181] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

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

[0183] It should be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0184] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of this application. In some cases, the actions or steps described in this application may be performed in a different order than those shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.

[0185] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. The term “and / or” refers to and includes any or all possible combinations of one or more associated listed items.

[0186] The terms "an embodiment," "some embodiments," "example," "specific example," or "one implementation," as used in one or more embodiments of this application, refer to specific features or characteristics described in connection with that embodiment, which are included in at least one embodiment of this application. Illustrative descriptions of these terms do not necessarily refer to the same embodiment. Furthermore, the described specific features or characteristics may be combined in a suitable manner in one or more embodiments of this application. In addition, different embodiments and specific features or characteristics from different embodiments may be combined without contradiction.

[0187] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of one or more embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0188] The above description is merely a preferred embodiment of one or more embodiments of this application and is not intended to limit the scope of one or more embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this application should be included within the protection scope of one or more embodiments of this application.

[0189] 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 entry points are provided for users to choose to authorize or refuse.

Claims

1. An information retrieval method, comprising: obtaining query text for triggering information retrieval, and performing named entity recognition on the query text to identify entity words from the query text, and determining the entity words identified from the query text as retrieval entity words; calculating, based on a graph, degrees of association of each candidate entity word with respect to the retrieval entity words, wherein the graph is constructed based on candidate entity words determined from candidate documents and association relationships therebetween, each node in the graph represents a candidate entity word, and each edge in the graph represents an association relationship between candidate entity words; determining a preset number of candidate entity words with the highest degrees of association with respect to the retrieval entity words as associated entity words, and calculating degrees of association of each candidate document with respect to the query text according to degrees of association of the associated entity words with respect to the retrieval entity words; determining a preset number of candidate documents with the highest degrees of association with respect to the query text as associated documents, and determining the associated documents as information retrieval results corresponding to the query text.

2. The method of claim 1, further comprising: inputting the query text and the information retrieval results into a large language model, and inferring, by the large language model, based on the query text and the information retrieval results to generate answer text corresponding to the query text.

3. The method of claim 1, further comprising: obtaining the candidate documents, and performing named entity recognition on the candidate documents to identify entity words from the candidate documents; extracting subject-predicate-object triples from the candidate documents based on the entity words identified from the candidate documents, and determining entity words in the subject-predicate-object triples as entity words having association relationships therebetween; determining the entity words identified from the candidate documents and the entity words in the subject-predicate-object triples as candidate entity words, and constructing the graph according to the candidate entity words and association relationships therebetween.

4. The method of claim 3, further comprising: calculating similarities of each target candidate entity word with respect to other candidate entity words, and determining a preset number of candidate entity words with the highest similarities as candidate entity words having association relationships with the target candidate entity words.

5. The method of claim 4, each edge in the graph is provided with a corresponding weight; wherein, a weight of an edge connecting a first type of node is a preset value, and a weight of an edge connecting a second type of node is a similarity of a candidate entity word represented by the second type of node; the candidate entity word represented by the first type of node is a candidate entity word belonging to a same subject-predicate-object triple; the candidate entity word represented by the second type of node is a similar candidate entity word.

6. The method of claim 3, wherein the performing named entity recognition on the candidate documents comprises: inputting the candidate documents into a large language model, and performing named entity recognition on the candidate documents by the large language model; the performing named entity recognition on the query text comprises: inputting the query text into the large language model, and performing named entity recognition on the query text by the large language model.

7. The method of claim 3, wherein the extracting subject-predicate-object triples from the candidate document based on the entity words identified from the candidate document comprises: inputting the entity words identified from the candidate document and the candidate document into a large language model, and extracting subject-predicate-object triples from the candidate document based on the entity words identified from the candidate document by the large language model.

8. The method of claim 3, further comprising: counting the number of times each candidate entity word appears in each candidate document, and storing a correspondence between a candidate entity word, a candidate document, and the number of times the candidate entity word appears in the candidate document.

9. The method of claim 4, further comprising: calculating the similarity between the entity word identified from the query text and each candidate entity word, and determining a preset number of candidate entity words with the highest similarity as the retrieval entity words.

10. The method of claim 9, wherein the calculating the similarity between different entity words comprises: embedding each entity word to obtain an embedding vector corresponding to each entity word; calculating the similarity between the embedding vectors corresponding to different entity words as the similarity between different entity words.

11. The method of claim 1, wherein the calculating the relevance of each candidate entity word relative to the retrieval entity word based on the graph comprises: based on a random walk algorithm, in the graph, taking a node representing the retrieval entity word as a starting node, calculating a likelihood measure of walking from the starting node to other nodes, and determining the relevance of candidate entity words represented by other nodes relative to the retrieval entity word according to the likelihood measure.

12. The method of claim 1, wherein the calculating the relevance of each candidate document relative to the query text according to the relevance of the associated entity words relative to the retrieval entity word comprises: calculating the relevance of each candidate document relative to the query text according to the relevance of the associated entity words relative to the retrieval entity word and the number of times the associated entity words appear in each candidate document.

13. The method of claim 12, wherein the calculating the relevance of each candidate document relative to the query text according to the relevance of the associated entity words relative to the retrieval entity word and the number of times the associated entity words appear in each candidate document comprises: in turn determining each candidate document as a target document, and calculating the product of the relevance of each associated entity word relative to the retrieval entity word and the number of times the associated entity word appears in the target document as the relevance of the associated entity word relative to the query text; calculating the sum of the relevance of each associated entity word relative to the query text as the relevance of the target document relative to the query text.

14. An information retrieval device, the device comprising: a word obtaining module, which obtains query text for triggering information retrieval, and performs named entity recognition on the query text to identify entity words from the query text, and determines the entity words identified from the query text as retrieval entity words; a word correlation degree calculation module, which calculates correlation degrees of each candidate entity word relative to the retrieval entity words based on a graph, wherein the graph is a graph constructed based on candidate entity words determined from candidate documents and their correlation relationships, each node in the graph represents each candidate entity word, and each edge in the graph represents that there is a correlation relationship between candidate entity words; a document correlation degree calculation module, which determines a preset number of candidate entity words with the highest correlation degrees relative to the retrieval entity words as correlation entity words, and calculates correlation degrees of each candidate document relative to the query text according to the correlation degrees of the correlation entity words relative to the retrieval entity words; a correlation document determination module, which determines a preset number of candidate documents with the highest correlation degrees relative to the query text as correlation documents, and determines the correlation documents as information retrieval results corresponding to the query text.

15. An electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method of any one of claims 1 to 13 by running the executable instructions.

16. A computer-readable storage medium having stored thereon computer instructions, which, when executed by a processor, implement the method of any one of claims 1 to 13.

Citation Information

Patent Citations

  • Material retrieval method and device, electronic equipment and storage medium

    CN110750627A

  • Information retrieval method, question and answer processing method and information retrieval device and system

    CN116186220A