Document retrieval method and device, electronic equipment and readable storage medium

Through document summary, semantic similarity filtering and content graph comparison, the problems of low efficiency and poor accuracy of existing documents are solved, and an efficient and automated document retrieval process is realized.

CN119311864APending Publication Date: 2025-01-14GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411301681.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Existing document retrieval methods are inefficient and have poor accuracy, making it difficult to effectively match related documents.

Method used

By obtaining document summary, calculating semantic similarity, filtering documents, extracting content features and association relationships to generate a map, comparing the graph similarity to determine document relevance, thereby realizing document retrieval.

Benefits of technology

It improves the accuracy and efficiency of document retrieval, reduces users' needs for document content analysis, and automates the processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311864A_ABST
    Figure CN119311864A_ABST
Patent Text Reader

Abstract

The invention discloses a document retrieval method and device, electronic equipment and a readable storage medium, and belongs to the technical field of retrieval. The document retrieval method comprises the steps that a first abstract of a first document is obtained; screening a third document from the plurality of second documents according to the semantic similarity between the first abstract and second abstracts respectively corresponding to the plurality of second documents; extracting content features of the first document and an association relationship between the content features, and generating a first map corresponding to the first document based on the content features and the association relationship; determining document relevancy between the first document and the third document according to second maps respectively corresponding to the first map and the third document; wherein the document relevancy is used for determining related documents of the first document from the third document. The corresponding atlas can be generated according to the document content, document retrieval is performed through atlas comparison, and the document atlas can accurately reflect the content structure of the document, so that the document retrieval accuracy and efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of retrieval technology, and specifically relates to a document retrieval method, device, electronic device and readable storage medium. Background Art

[0002] Many users and many fields have the need to retrieve relevant documents. For example, legal workers need to search for similar cases, technical personnel need to search for academic papers, and before applying for a patent, they need to search for patent cases that are similar to the technical solutions to be applied for, etc.

[0003] In related technologies, a document database is usually established. Users analyze and summarize the documents to be retrieved, write search keywords, and search the document database using the search keywords. The document database matches documents with the same keywords in the document database based on the search keywords, and feeds back the matched documents to the user.

[0004] However, the above method of retrieving related or similar documents has the problems of low efficiency and poor accuracy. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a document retrieval method, device, electronic device and readable storage medium, which can solve the problems of low efficiency and poor accuracy in the method of retrieving relevant documents in the related art.

[0006] In a first aspect, an embodiment of the present application provides a document retrieval method, the method comprising:

[0007] Get a first summary of a first document;

[0008] selecting a third document from the plurality of second documents according to semantic similarities between the first abstract and second abstracts respectively corresponding to the plurality of second documents;

[0009] Extracting content features of the first document and associations between the content features, and generating a first graph corresponding to the first document based on the content features and the associations;

[0010] The document relevance between the first document and the third document is determined according to the second graphs corresponding to the first graph and the third document respectively; wherein the document relevance is used to determine related documents of the first document from the third document.

[0011] Optionally, obtaining a first summary of the first document includes:

[0012] extracting a first segment from the first document according to a first segment extraction rule corresponding to the document type of the first document;

[0013] The first segment and the first prompt word are input into a large language model to obtain the first summary output by the large language model.

[0014] Optionally, selecting a third document from the plurality of second documents according to semantic similarities between the first abstract and second abstracts corresponding to the plurality of second documents respectively includes:

[0015] Determining a semantic similarity between the first abstract and the second abstract according to a first term frequency inverse document frequency corresponding to the first abstract and a second term frequency inverse document frequency corresponding to the second abstract;

[0016] Filtering intermediate documents from the second document based on the semantic similarity;

[0017] Inputting the first summary, the third summary corresponding to the intermediate document, and the second prompt word into a large language model to obtain content similarity between the first document and the intermediate document output by the large language model;

[0018] The third document is selected from the intermediate documents based on the content similarity.

[0019] Optionally, extracting the content features of the first document and the association relationship between the content features includes:

[0020] extracting a second segment from the first document according to a second segment extraction rule corresponding to the document type of the first document;

[0021] The second segment and the third prompt word are input into a large language model to obtain the content features output by the large language model and the association relationship between the content features.

[0022] Optionally, the first graph includes a first content structure graph and a first content logic graph, the second graph includes a second content structure graph and a second content logic graph, and determining the document relevance between the first document and the third document according to the second graphs respectively corresponding to the first graph and the third document includes:

[0023] Determine the similarity of the first graph based on the first content structure graph and the second content structure graph;

[0024] Determine the second graph similarity based on the first content logic graph and the second content logic graph;

[0025] The document relevance is determined according to the first graph similarity and the second graph similarity.

[0026] Optionally, determining the document relevance according to the first graph similarity and the second graph similarity includes:

[0027] Determining a first weight corresponding to the first graph similarity according to a difference between the first graph similarity and a first threshold;

[0028] Determining a second weight corresponding to the second graph similarity according to a difference between the second graph similarity and a second threshold;

[0029] Based on the first weight and the second weight, a weighted average is performed on the first graph similarity and the second graph similarity to obtain the document relevance.

[0030] Optionally, the method further comprises:

[0031] When a first difference between the maximum document relevance corresponding to the third document and the document relevance corresponding to the associated document selected by the user from the third document is not equal to 0, the first threshold and the second threshold are updated so that a second difference between the maximum document relevance corresponding to the third document recalculated based on the updated first threshold and the updated second threshold and the recalculated document relevance corresponding to the associated document is less than the first difference.

[0032] Optionally, the content features include document structure features and document content features, and generating a first graph corresponding to the first document based on the content features and the association relationship includes:

[0033] Based on the association relationship between the document structure feature and the document content feature, generating the first content structure graph;

[0034] Based on the association relationship between the document content features, the first content logic graph is generated.

[0035] Optionally, before obtaining the first summary of the first document, the method further includes:

[0036] Acquire target type keywords matching a preset type keyword set from the original document;

[0037] Determining the document type of the original document based on the target type keyword;

[0038] extracting a third segment from the original document based on a third segment extraction rule corresponding to the document type of the original document;

[0039] The third segment is filled into a document standardization template corresponding to the document type to obtain the first document.

[0040] In a second aspect, an embodiment of the present application provides a document retrieval device, the device comprising:

[0041] A summary module, used for obtaining a first summary of a first document;

[0042] A document screening module, configured to screen a third document from the plurality of second documents according to semantic similarities between the first summary and second summaries respectively corresponding to the plurality of second documents;

[0043] A graph module, configured to extract content features of the first document and associations between the content features, and generate a first graph corresponding to the first document based on the content features and the associations;

[0044] A document relevance module is used to determine the document relevance between the first document and the third document based on the second graph corresponding to the first graph and the third document respectively; wherein the document relevance is used to determine the related documents of the first document from the third document.

[0045] Optionally, the summary module includes:

[0046] A first segment submodule, configured to extract a first segment from the first document according to a first segment extraction rule corresponding to the document type of the first document;

[0047] The first summary determination submodule is used to input the first segment and the first prompt word into a large language model to obtain the first summary output by the large language model.

[0048] Optionally, the document screening module includes:

[0049] a semantic similarity submodule, configured to determine the semantic similarity between the first abstract and the second abstract according to a first term frequency inverse document frequency corresponding to the first abstract and a second term frequency inverse document frequency corresponding to the second abstract;

[0050] An intermediate document submodule, used for selecting intermediate documents from the second document based on the semantic similarity;

[0051] a content similarity submodule, configured to input the first summary, the third summary corresponding to the intermediate document, and the second prompt word into a large language model, and obtain content similarity between the first document and the intermediate document output by the large language model;

[0052] The third document screening submodule is used to screen the third document from the intermediate documents based on the content similarity.

[0053] Optionally, the atlas module includes:

[0054] A second segment submodule, configured to extract a second segment from the first document according to a second segment extraction rule corresponding to the document type of the first document;

[0055] The association submodule is used to input the second segment and the third prompt word into the large language model to obtain the content features output by the large language model and the association relationship between the content features.

[0056] Optionally, the first graph includes a first content structure graph and a first content logic graph, the second graph includes a second content structure graph and a second content logic graph, and the document relevance module includes:

[0057] A first graph similarity submodule, configured to determine a first graph similarity based on the first content structure graph and the second content structure graph;

[0058] A second graph similarity submodule, configured to determine a second graph similarity based on the first content logic graph and the second content logic graph;

[0059] The document relevance determination submodule is used to determine the document relevance according to the first graph similarity and the second graph similarity.

[0060] Optionally, the document relevance determination submodule includes:

[0061] A first weighting unit, configured to determine a first weight corresponding to the first graph similarity according to a difference between the first graph similarity and a first threshold;

[0062] A second weighting unit, configured to determine a second weight corresponding to the second graph similarity according to a difference between the second graph similarity and a second threshold;

[0063] A document relevance weighting unit is used to perform a weighted average of the first graph similarity and the second graph similarity based on the first weight and the second weight to obtain the document relevance.

[0064] Optionally, the device further comprises:

[0065] A threshold updating module is used to update the first threshold and the second threshold when the first difference between the maximum document relevance corresponding to the third document and the document relevance corresponding to the associated document selected by the user from the third document is not equal to 0, so that the second difference between the maximum document relevance corresponding to the third document recalculated based on the updated first threshold and the updated second threshold and the recalculated document relevance corresponding to the associated document is smaller than the first difference.

[0066] Optionally, the content features include document structure features and document content features, and the graph module includes:

[0067] A first content structure graph submodule, configured to generate the first content structure graph based on the association relationship between the document structure feature and the document content feature;

[0068] The first content logic graph submodule is used to generate the first content logic graph based on the association relationship between the document content features.

[0069] Optionally, the device further comprises:

[0070] A type keyword module is used to obtain target type keywords that match a preset type keyword set from an original document;

[0071] A document type module, used to determine the document type of the original document based on the target type keyword;

[0072] A third segment module, configured to extract a third segment from the original document based on a third segment extraction rule corresponding to the document type of the original document;

[0073] The first document module is used to fill the third segment into the document standardization template corresponding to the document type to obtain the first document.

[0074] In a third aspect, an embodiment of the present application provides an electronic device, comprising the document retrieval device as described above, for implementing the document retrieval method as described in the first aspect.

[0075] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the document retrieval method of the first aspect as described above is implemented.

[0076] In an embodiment of the present application, a document retrieval method is provided, including: obtaining a first summary of a first document; screening a third document from a plurality of second documents according to the semantic similarity between the first summary and the second summary corresponding to a plurality of second documents; extracting the content features of the first document and the association relationship between the content features, and generating a first graph corresponding to the first document based on the content features and the association relationship; determining the document relevance between the first document and the third document according to the second graph corresponding to the first graph and the third document; wherein the document relevance is used to determine the related documents of the first document from the third document. A corresponding graph can be generated according to the content of the document, and document retrieval can be performed by graph comparison. Since the graph of the document can accurately reflect the content structure of the document, it helps to improve the accuracy of document retrieval, and the whole process can be automated without the need for the user to analyze the document content, which helps to improve the efficiency of document retrieval. In addition, preliminary screening can be performed through document summaries with less content, reducing the number of documents that need to be matched with graphs, which helps to further improve the efficiency of document retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 It is a flowchart of the steps of a document retrieval method provided in an embodiment of the present application;

[0078] Figure 2 is a flowchart of another document retrieval method provided by an embodiment of the present application;

[0079] Figure 3 is a schematic diagram of a first content structure map provided in an embodiment of the present application;

[0080] Figure 4 It is a schematic diagram of a first content logic map provided in an embodiment of the present application;

[0081] Figure 5 is a flow chart for determining document relevance provided by an embodiment of the present application;

[0082] Figure 6 It is a logic block diagram of a document retrieval device provided in an embodiment of the present application;

[0083] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0084] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0085] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0086] The document retrieval method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0087] Reference Figure 1 , Figure 1 A flowchart of a document retrieval method provided by an embodiment of the present application is shown. Figure 1 As shown, the specific steps include:

[0088] Step 101: Obtain a first summary of a first document.

[0089] In the embodiment of the present application, the first document may be a text document of any type and any field. For example, the first document may include but is not limited to a technical document, a patent document, a technical briefing document, a legal document, a research document, etc., which is not specifically limited in the embodiment of the present application. In order to retrieve a document with a high relevance to the actual content of the first document from the document database, a first summary of the first document may be obtained.

[0090] In one embodiment, the first summary may be the summary content of the first document, which may be obtained by identifying the content of the first document. For example, a summary matching keyword may be pre-set, the content of the first document may be matched by the summary matching keyword, and the summary paragraph may be determined and extracted from the first document to obtain the first summary of the first document.

[0091] In another embodiment, the first summary may also be a document summary generated based on the content of the first document. The first document may be input into a large language model, and the large language model may summarize the content of the first document to generate a first summary of the first document. Exemplarily, the large language model may be trained through a prompt word engineering so that it can summarize and analyze the input document content and output a summary corresponding to the document; the first document and the summary prompt words used to instruct the large language model to output the document summary may also be input into the large language model together, so that the large language model can summarize and analyze the first document based on the summary prompt words and output the first summary of the first document. Among them, the large language model (LLM) is an artificial intelligence model based on deep learning, which is specifically used to process and generate natural language. The large language model may include but is not limited to a language model based on the Transformer architecture, a GPT series model, a BERT series model, and the like. It should be noted that the above-mentioned large language model may be a general model, such as a GPT series model, or a model obtained by secondary training based on a general model, or a model specially trained for the document retrieval task of the present application, and the embodiments of the present application are not specifically limited.

[0092] The first summary may be generated or extracted from the first document when the first document is retrieved, or the first document may be generated or extracted in advance and stored. When the first document needs to be retrieved, the first summary of the first document is directly read, thereby improving retrieval efficiency.

[0093] Step 102: Filter a third document from the plurality of second documents according to semantic similarities between the first abstract and second abstracts corresponding to the plurality of second documents.

[0094] In the embodiment of the present application, the plurality of second documents represent a document set to be queried, that is, related documents of the first document are retrieved from the document set. The second summary of the second document can be obtained in the same manner as the first document, thereby ensuring that the first summary and the second summary have high comparability and improving the accuracy of document retrieval.

[0095] The second summary of the second document can be pre-generated and stored in the database. When searching, the second summary of each second document can be directly obtained from the database to improve the search efficiency. It should be noted that the content of the second document in the database may be updated. After the second document is updated, its second summary can also be updated to ensure that the second summary matches the corresponding second document.

[0096] The first summary can be matched with the second summary corresponding to the second document to determine the semantic similarity between the two, thereby obtaining the semantic similarity corresponding to the first summary and each second summary. Specifically, the semantic similarity between the first summary and the second summary can be calculated using a traditional semantic similarity calculation model, which can include but is not limited to term frequency-inverse document frequency (TF-IDF), BM25, simhash, etc.; the semantic similarity between the first summary and the second summary can also be determined using a neural network-based semantic similarity model, which can include but is not limited to DSSM, CNN-DSSM, LSTM-DSSM, etc., which is not specifically limited in the embodiments of the present application.

[0097] In an embodiment of the present application, the second document corresponding to the second abstract whose semantic similarity is greater than or equal to the preset similarity can be determined as the third document; or the second documents corresponding to a preset number of second abstracts with the highest semantic similarities can be determined as the third document.

[0098] Step 103: extract content features of the first document and correlations between the content features, and generate a first graph corresponding to the first document based on the content features and the correlations.

[0099] In the embodiment of the present application, the content features of the first document and the association between the content features can be extracted, wherein the content features can include but are not limited to keyword features, theme features, hypernyms, etc. For example, keyword features can include nouns and their word frequencies, characters and their word frequencies, technical terms and their word frequencies, etc.; theme features can include document themes, chapter themes, paragraph themes, etc.; hypernyms can include hypernyms of nouns in the document, parent addresses of geographical locations, etc., which are not specifically limited in the embodiment of the present application.

[0100] The association relationship between content features may include but is not limited to dependency relationship, semantic relationship, hierarchical relationship, temporal relationship, etc. For example, dependency relationship can indicate the grammatical or logical dependence between content features; semantic relationship can indicate the connection between content features in meaning, which may include synonymy, antonymy, and hyponymy; hierarchical relationship can indicate the organization of content features from more abstract to more specific, for example, if the document mentions "animal A belongs to a certain family", then the content features "animal A" and "a certain family" have a hierarchical relationship; temporal relationship can indicate the arrangement of content features in chronological order or the temporal relationship between events, which can be reflected in the order of occurrence of actions and the order of appearance of nouns, for example, if the document mentions "raw material A can be mixed with raw material B to obtain raw material C, and raw material C can be purified to obtain raw material D", then the content features "mixing" and "purification" have a temporal relationship.

[0101] In the embodiment of the present application, the content features of the first document can be used as nodes, and the connection relationship between the above content features can be used as edges to generate a first graph corresponding to the first document. It should be noted that there can be multiple associations between two content features, or there may not be any association between the two content features, so that there can be multiple edges between the same two nodes in the first graph, or there may not be any directly connected edges between the two nodes.

[0102] Specifically, the content features of the first document can be extracted by training a feature extraction model, the feature extraction model can receive the first document as input and output the content features of the first document, and the association relationship between the content features can be generated by training an association relationship model, the association relationship model can receive the content features and the first document as input, and output the association relationship between the content features in the first document. In addition, the first document and content feature prompt word information can be directly provided to the large language model, so that the large language model analyzes the first document and outputs the content features of the first document and the association relationship between the content features. For example, a content feature prompt word information can be "please analyze the document content, extract the key noun features and verb features therein, and provide the association relationship between these noun features and verb features."

[0103] Step 104, determining the document relevance between the first document and the third document based on the second graphs corresponding to the first graph and the third document respectively; wherein the document relevance is used to determine related documents of the first document from the third document.

[0104] In the embodiment of the present application, the second graph corresponding to each third document can be obtained, and the second graph can be generated in the same way as the first graph, so as to ensure that the first graph and the second graph have high comparability. In addition, the second graph can be generated after the first graph is generated, or it can be generated in advance and stored in the database before the first graph is generated. When the first document and the third document need to be matched, the second graph corresponding to the third document can be directly obtained, thereby improving the document retrieval efficiency.

[0105] The first graph and the second graph may be compared to obtain the graph similarity between the first graph and the second graph, and the document relevance between the first document and the third document may be determined based on the graph similarity.

[0106] In the embodiment of the present application, graph similarity can be determined based on but not limited to at least one of structural similarity, content similarity, path similarity, and embedding similarity. Among them, structural similarity can be determined based on at least one of Graph Edit Distance (GED), Maximum Common Subgraph (MCS), and Subgraph Isomorphism; content similarity can be determined based on at least one of node similarity and relationship similarity; path similarity can be determined by calculating the shortest path length between similar nodes in two graphs. If the path lengths between the two are similar, it means that the two graphs may have a similar relationship in structure; embedding similarity can be determined by mapping the entities and relationships in the graph to the vector space and comparing the distance between the corresponding vectors of the two graphs.

[0107] In addition, the graph similarity can also be determined by a method based on a neural network model. For example, the graph features of the first graph and the second graph can be extracted by using graph neural networks (GNNs) or graph autoencoders (GAE), and the graph similarity of the first graph and the second graph can be obtained by comparing the graph features. The technician can also use other methods to determine the similarity of the spectra, which is not specifically limited in the embodiments of the present application.

[0108] In the embodiment of the present application, the graph similarity between the first graph and the second graph can be directly used as the document relevance between the first document corresponding to the first graph and the third document corresponding to the second graph.

[0109] In summary, a document retrieval method provided by an embodiment of the present application includes: obtaining a first summary of a first document; screening a third document from multiple second documents according to the semantic similarity between the first summary and the second summary corresponding to multiple second documents; extracting the content features of the first document and the correlation between the content features, and generating a first graph corresponding to the first document based on the content features and the correlation; determining the document relevance between the first document and the third document according to the second graph corresponding to the first graph and the third document; wherein the document relevance is used to determine the related documents of the first document from the third document. A corresponding graph can be generated according to the content of the document, and document retrieval can be performed through graph comparison. Since the graph of the document can accurately reflect the content structure of the document, it helps to improve the accuracy of document retrieval, and the whole process can be automated without the need for the user to analyze the document content, which helps to improve the efficiency of document retrieval. In addition, preliminary screening can be performed through document summaries with less content, reducing the number of documents that need to be matched with graphs, which helps to further improve the efficiency of document retrieval.

[0110] like Figure 2 As shown, Figure 2 A flowchart of another document retrieval method provided in an embodiment of the present application, the method may include:

[0111] Step 201: Obtain a first summary of a first document.

[0112] This step can refer to step 101 and will not be described in detail in this embodiment of the present application.

[0113] Optionally, step 201 may include:

[0114] Sub-step 2011: extracting a first segment from the first document according to a first segment extraction rule corresponding to the document type of the first document.

[0115] In the embodiment of the present application, since the document content may be large, extracting the document summary through full-text analysis may bring a high computational burden. In order to improve the efficiency of generating document summaries and improve the retrieval efficiency, specific fragments in the document may be analyzed to extract the document summary. In addition, since the first document may be of different types, each type of document has different document structures and content characteristics, different first fragment extraction rules may be set for different document types to extract the first fragment from the first document, thereby improving the accuracy of fragment extraction.

[0116] The first fragment extraction rule may include but is not limited to at least one or a combination of multiple of the extraction position rule, the extraction length rule, the extraction content rule, etc. For example, for academic document types, the fragment extraction rule may be: the last natural paragraph of all main text sections; for briefing document types, the fragment extraction rule may be: all contents in the chapters with titles similar to "technical solution" in the article. Technicians can set different fragment extraction rules according to the characteristics of different document types to extract the first fragment that can represent the main theme of the document from the first document, and this application does not make specific limitations on this.

[0117] Sub-step 2012: input the first segment and the first prompt word into a large language model to obtain the first summary output by the large language model.

[0118] In an embodiment of the present application, the first segment and the first prompt word may be input into the large language model to obtain a first summary output by the large language model. The first prompt word may be used to enable the large language model to summarize the first segment and generate a summary. For example, a possible first prompt word may be "interpret the above content and generate a corresponding summary, with the word count controlled within 200 words and the language as concise as possible".

[0119] In addition, different first prompt words can be set for different document types to make the generated first summary more accurate. For example, for patent-type document types, the first prompt word can be set to "Interpret the following patent content and generate a corresponding patent summary. The word count should be controlled within 200 words and the language should be as concise as possible"; for legal-type document types, the first prompt word can be set to "Interpret the following legal document content and generate a content summary describing the main process of the case. The language should be concise and the logic should be accurate". Technicians can set different first prompt words according to the characteristics of different document types, and this application does not make specific limitations on this.

[0120] By extracting a first segment from the first document according to a first segment extraction rule corresponding to the document type of the first document, and inputting the first segment and the first prompt word into a large language model, the first summary output by the large language model is obtained. This can reduce the amount of text required to generate the first summary, reduce the computing resources required to generate the first summary, and help improve document retrieval efficiency.

[0121] Optionally, before step 201, the following steps A1 to A4 may also be included:

[0122] Step A1: Acquire target type keywords that match a preset type keyword set from an original document.

[0123] In an embodiment of the present application, the first document may be obtained after consistency processing of the original document to be retrieved, and the second document may be obtained after consistency processing of the original document stored in the database, thereby ensuring a high degree of comparability between the first document and the second document, and helping to improve the stability of the retrieval process and the retrieval accuracy.

[0124] Specifically, target type keywords that match the preset type keyword set can be obtained from the original document. The preset type keyword set is used to determine the document type of the original document. For example, the preset type keyword set may include "invention patent", "briefing", "case summary", "academic report", etc., which is not specifically limited in the embodiments of the present application.

[0125] Step A2: determining the document type of the original document based on the target type keyword.

[0126] In the embodiment of the present application, the document type of the original document can be determined based on the target type keyword. Specifically, each type keyword can correspond to a document type, and the document type of the original document can be determined based on the document type corresponding to the target type keyword.

[0127] In addition, since there can be multiple target type keywords, a corresponding keyword weight can also be set for each type keyword, and the keyword weights corresponding to the target type keywords corresponding to the same document type can be accumulated to obtain the confidence score corresponding to the document type, and the document type with the highest confidence score is determined as the document type of the original document. Among them, the keyword weight can be preset according to the degree to which the keyword can reflect that the document is of the corresponding document type, and the embodiment of the present application does not specifically limit it.

[0128] Exemplarily, if five target type keywords 1 to 5 that match a preset type keyword set are obtained from the original document a, where target type keyword 1, target type keyword 2, and target type keyword 5 are document type b, and target type keyword 3 and target type keyword 4 are document type c, where the keyword weights corresponding to target type keywords 1 to 5 are 2, 3, 1, 2, and 4, respectively, then the confidence score corresponding to document type b can be 2+3+4=7, and the confidence score corresponding to document type c can be 1+2=3. Since the confidence score corresponding to document type b is the highest, it can be determined that the document type corresponding to the original document a is document type b.

[0129] Step A3: extracting a third segment from the original document based on a third segment extraction rule corresponding to the document type of the original document.

[0130] In the embodiment of the present application, a corresponding third segment extraction rule can be set for each document type, and the third segment is extracted from the document according to the third segment extraction rule. The third segment extraction rule may include but is not limited to a chapter title extraction rule, a chapter content extraction rule, etc., which is not specifically limited in the embodiment of the present application.

[0131] It should be noted that the third segment extraction rule may include multiple segment extraction sub-rules, the third segment may include multiple sub-segments, and each segment extraction sub-rule may extract a corresponding sub-segment. For example, one segment extraction sub-rule may be a general title extraction sub-rule for extracting the general title of the document content, and one segment extraction sub-rule may be a secondary title extraction sub-rule for extracting the secondary title in the document content.

[0132] Step A4: Fill the third segment into the document standardization template corresponding to the document type to obtain the first document.

[0133] In an embodiment of the present application, each document type may also be preset with a corresponding document standardization template, and the rules in the third fragment extraction rule may correspond to the position to be filled in the document standardization template, so that the third fragment extracted based on the third fragment extraction rule also corresponds to the position to be filled in the document standardization template, and the third fragment can be filled into the corresponding position to be filled to obtain the first document.

[0134] By obtaining target type keywords that match a preset type keyword set from the original document; determining the document type of the original document based on the target type keywords; extracting the third fragment from the original document based on the third fragment extraction rule corresponding to the document type of the original document; and filling the third fragment into a document standardization template corresponding to the document type to obtain the first document, it helps to improve the stability and accuracy of the retrieval process.

[0135] Step 202: Determine the semantic similarity between the first abstract and the second abstract according to a first term frequency inverse document frequency corresponding to the first abstract and a second term frequency inverse document frequency corresponding to the second abstract.

[0136] In an embodiment of the present application, a large language model may be used to determine the semantic similarity between the first abstract and the second abstract. In addition, in order to improve retrieval efficiency, the semantic similarity between the abstracts may be obtained by obtaining the word frequency inverse document frequency of the abstracts for comparison.

[0137] Specifically, the first keyword of the first abstract can be first extracted, and the term frequency (TF) and inverse document frequency (IDF) of each first keyword in the abstract can be calculated. Then, based on the term frequency and inverse document frequency of all first keywords, the first term frequency inverse document frequency of the first abstract can be calculated. The second term frequency inverse document frequency of the second abstract can also be calculated in the above manner, which will not be described in detail in the embodiments of the present application. The second term frequency inverse document frequency of the second abstract can be calculated in advance or in real time when the retrieval occurs, which is not specifically limited in the embodiments of the present application.

[0138] The first term frequency inverse document frequency and the second term frequency inverse document frequency are obtained, and the semantic similarity between the corresponding first abstract and the second abstract can be determined through the cosine distance between the first term frequency inverse document frequency and the second term frequency inverse document frequency.

[0139] Step 203: Filter intermediate documents from the second documents based on the semantic similarity.

[0140] After obtaining the semantic similarity between the second document and each third document, a first preset number of second documents with the largest semantic similarity can be determined as intermediate documents, or second documents with a semantic similarity greater than or equal to a first similarity threshold can be determined as intermediate documents, which is not specifically limited in the embodiments of the present application.

[0141] Step 204: input the first summary, the third summary corresponding to the intermediate document, and the second prompt word into a large language model to obtain the content similarity between the first document and the intermediate document output by the large language model.

[0142] In an embodiment of the present application, the first summary, the third summary corresponding to the intermediate document, and the second prompt word can be input into the large language model, so that the large language model compares the actual content of the first summary and the third summary, and outputs the content similarity between the two. For example, a possible second prompt word can be "Please compare the actual content of these two summaries and give the content similarity, requiring the similarity value to be between 0 and 1", and the technician can also set other prompt word content, which is not specifically limited in the embodiment of the present application.

[0143] Step 205: Filter the third document from the intermediate documents based on the content similarity.

[0144] After obtaining the content similarity between the first document and the intermediate document, a second preset number of intermediate documents with the greatest content similarity can be determined as the third document, or the intermediate document with a semantic similarity greater than or equal to a second similarity threshold can be determined as the third document, which is not specifically limited in the embodiments of the present application.

[0145] In an embodiment of the present application, the semantic similarity between the first abstract and the second abstract can be determined based on the first term frequency inverse document frequency corresponding to the first abstract and the second term frequency inverse document frequency corresponding to the second abstract; the intermediate document is screened from the second document based on the semantic similarity; the first abstract, the third abstract corresponding to the intermediate document and the second prompt word are input into the large language model to obtain the content similarity between the first document and the intermediate document output by the large language model; the third document is screened from the intermediate document based on the content similarity. Since the content similarity determined by the large language model has high accuracy but a large amount of calculation, the second document is preliminarily screened by the term frequency inverse document frequency with a low amount of calculation to obtain intermediate documents less than the second document, and then the third document with a high similarity to the first abstract is accurately screened from the intermediate document by the large language model, which helps to improve the retrieval efficiency while ensuring the retrieval accuracy.

[0146] Step 206: extract a second segment from the first document according to a second segment extraction rule corresponding to the document type of the first document.

[0147] In the embodiments of the present application, since the amount of document content may be large, extracting content features through full-text analysis may bring a high computational burden. In order to improve the efficiency of generating content features and improve retrieval efficiency, specific fragments in the document can be extracted and analyzed to obtain content features. In addition, since the first document can be of different types, and each type of document has different document structures and content characteristics, different second fragment extraction rules can be set for different document types to extract the second fragment from the first document, thereby improving the accuracy of fragment extraction. It should be noted that the second fragment extraction rule corresponding to a certain document type may be the same as or different from the first fragment extraction rule corresponding to the document type. For example, for patent documents, the first fragment extraction rule may be "extract all the content in the invention content section of the text", and the second fragment extraction rule may be "extract all the content in the embodiment section".

[0148] Step 207: input the second segment and the third prompt word into a large language model to obtain the content features output by the large language model and the correlation between the content features.

[0149] In an embodiment of the present application, a third prompt word for controlling the output of content features and their associations by the large language model can be preset. Thus, the second segment and the third prompt word can be input into the large language model to obtain the content features output by the large language model and the associations between the content features, wherein the content features include document structure features and document content features. Exemplarily, for patent-type documents, a possible third prompt word may be "interpret the following patent content, extract core knowledge points and technical points as document content features, extract document chapter titles and fixed structures as document structure features, and the associations between various content features".

[0150] The above-mentioned document structure features may include but are not limited to chapter titles in the document, fixed structure content of the document type corresponding to the document, etc. The above-mentioned document content features may include technical points, core knowledge points, key nouns, key verbs, etc., and the embodiments of this application do not make specific limitations.

[0151] Step 208: Generate the first content structure graph based on the association relationship between the document structure feature and the document content feature.

[0152] In an embodiment of the present application, a first content structure map can be generated based on the association relationship between the document structure features and the document content features. The first content structure map can be considered as a mind map or knowledge framework map of the first document; wherein the association relationship between the document structure features and the document content features can only include the association relationship between the document structure features, the association relationship between the document content features, and the association relationship between the document content features. Figure 3 , Figure 3 A schematic diagram of a first content structure map provided by an embodiment of the present application is shown. For the first document of the invention patent document, the following can be generated: Figure 3 The first content structure diagram shown. It should be noted that, Figure 3 This is only an exemplary description. The graph structure generated in actual applications may be more complex, and the degree of complexity depends on the actual content of the first document.

[0153] Step 209: Generate the first content logic graph based on the association relationship between the document content features.

[0154] In the embodiment of the present application, a first content logic map can be generated according to the association relationship between the document content features, and the first content logic map can clearly describe the logical structure of the technical solution in the first document, or the narrative logic in the first document. Figure 4 , Figure 4 A schematic diagram of a first content logic map provided by an embodiment of the present application is shown. For the first document of the invention patent document, the following can be generated: Figure 4The first content logic diagram shown, wherein the arrows can represent the logical dependency relationship of various technical features. It should be noted that Figure 4 This is only an exemplary description. The graph structure generated in actual applications may be more complex, and the degree of complexity depends on the actual content of the first document.

[0155] It should be noted that the above-mentioned first content structure map and first content logic map can also be directly output by a multimodal large language model. The multimodal large language model can receive text content and graphic content, and output the text content and graphic content required by the user according to the prompt words.

[0156] Step 210: Determine the first graph similarity based on the first content structure graph and the second content structure graph.

[0157] In the embodiment of the present application, the first graph may include the first content structure graph and the first content logic graph, and correspondingly, the second graph may include the second content structure graph and the second content logic graph. The second content structure graph and the second content logic graph may be obtained by pre-processing or real-time processing the third document in the same manner as the above-mentioned generation of the first content structure graph and the first content logic graph, and the embodiment of the present application will not be repeated.

[0158] In the embodiment of the present application, the method of determining the graph similarity in the above step 104 can be used to compare the first content structure graph with the second content structure graph to obtain the first graph similarity, which will not be described in detail in the embodiment of the present application.

[0159] Step 211: Determine the second graph similarity based on the first content logic graph and the second content logic graph.

[0160] In the embodiment of the present application, the method of determining the graph similarity in the above step 104 can be used to compare the first content logic graph with the second content logic graph to obtain the second graph similarity, which will not be described in detail in the embodiment of the present application.

[0161] Step 212: Determine the document relevance based on the first graph similarity and the second graph similarity.

[0162] In the embodiment of the present application, the first graph similarity and the second graph similarity can be averaged to obtain the document relevance, or the first graph similarity and the second graph similarity can be weighted averaged to obtain the document relevance. The weight values ​​corresponding to the first graph similarity and the second graph similarity can be flexibly set by technicians according to actual needs, and the embodiment of the present application does not specifically limit this.

[0163] In addition, other graphs can be generated for the first document and the third document, other graph similarities can be generated based on the other graphs, and the document relevance can be determined based on the first graph similarity, the second graph similarity and the other graph similarities, thereby further improving the accuracy of the document relevance. The above-mentioned other graphs may include but are not limited to noun relationship graphs, verb time sequence graphs, knowledge structure directories, etc., and the embodiments of the present application do not make specific limitations.

[0164] In an embodiment of the present application, the first graph similarity can be determined based on the first content structure graph and the second content structure graph; the second graph similarity can be determined based on the first content logic graph and the second content logic graph; the document relevance can be determined based on the first graph similarity and the second graph similarity. The document structure is described by graphs generated by multiple different methods, and the document relevance is calculated by the similarity between multiple graphs, which helps to improve the accuracy of the document relevance.

[0165] It should be noted that graph similarity can also be a graph relevance score, document relevance can also be a document relevance score, and the document relevance score can be obtained based on the accumulation of various graph relevance scores.

[0166] Optionally, step 212 may include:

[0167] Sub-step 2121: determining a first weight corresponding to the first graph similarity according to a difference between the first graph similarity and a first threshold.

[0168] In the embodiment of the present application, the greater the difference between the first graph similarity and the first threshold (for example, 0.7) (first graph similarity - first threshold), the higher the first graph similarity and the higher its credibility, and vice versa. Therefore, the first weight corresponding to the first similarity can be determined according to the difference between the first graph similarity and the first threshold, so that the greater the difference between the first graph similarity and the first threshold, the greater the first weight corresponding to the first graph similarity, and vice versa, the smaller the first weight.

[0169] Exemplarily, the difference between the first graph similarity and the first threshold value may be added to the first threshold value to obtain the first weight, so as to ensure that the first weight is always greater than 0. The first weight may also be calculated in other ways, which are not specifically limited in the embodiments of the present application.

[0170] Sub-step 2122: determining a second weight corresponding to the second graph similarity according to a difference between the second graph similarity and a second threshold.

[0171] In the embodiment of the present application, the second weight corresponding to the second similarity can be determined according to the difference between the second graph similarity and the second threshold (for example, 0.8), so that the greater the difference between the second graph similarity and the second threshold, the greater the second weight corresponding to the second graph similarity, and vice versa. The first threshold and the second threshold can be equal or unequal.

[0172] Exemplarily, the difference between the second graph similarity and the second threshold value may be added to the second threshold value to obtain the second weight, so as to ensure that the second weight is always greater than 0. The second weight may also be calculated in other ways, which are not specifically limited in the embodiments of the present application.

[0173] Optionally, when a first difference between the maximum document relevance corresponding to the third document and the document relevance corresponding to an associated document selected by a user from the third document is not equal to 0, the first threshold and the second threshold are updated so that a second difference between the maximum document relevance corresponding to the third document recalculated based on the updated first threshold and the updated second threshold and the recalculated document relevance corresponding to the associated document is smaller than the first difference.

[0174] In the embodiment of the present application, the document relevance corresponding to all third documents can be directly fed back to the user, so that the user can use the document relevance as a reference to autonomously select related documents that match the first document and have a higher relevance from the third documents. The first threshold and the second threshold can be adjusted based on the related documents selected by the user, thereby further improving the accuracy of the output document relevance.

[0175] Specifically, the maximum document relevance can be found from the document relevances corresponding to all third documents, and the first difference between the document relevance of the associated document selected by the user and the maximum document relevance can be calculated. If the first difference is equal to 0, it means that the user has selected the third document with the greatest document relevance as the associated document, which means that the current setting method of the first threshold and the second threshold can be recognized by the user. If the first difference is not equal to 0, it means that the user has not selected the third document with the greatest document relevance as the associated document, which means that the current setting method of the first threshold and the second threshold cannot be recognized by the user. At this time, the first threshold and the second threshold can be optimized and updated so that the maximum document relevance corresponding to the third document recalculated by the updated first threshold and the second threshold is less than the first difference between the second difference between the document relevance corresponding to the recalculated associated document and the document relevance corresponding to the recalculated associated document. The document relevance corresponding to the recalculated associated document can also be called the maximum value among the document relevances corresponding to all third documents.

[0176] By optimizing and updating the first difference and the second difference in the above manner, the calculation accuracy of the document relevance can be continuously improved as the user uses the document, making it more in line with the user's habits and intentions of selecting related documents.

[0177] Sub-step 2123, based on the first weight and the second weight, perform weighted averaging on the first graph similarity and the second graph similarity to obtain the document relevance.

[0178] In an embodiment of the present application, a first weight corresponding to the first graph similarity can be determined based on a difference between the first graph similarity and a first threshold; a second weight corresponding to the second graph similarity can be determined based on a difference between the second graph similarity and a second threshold; and based on the first weight and the second weight, the first graph similarity and the second graph similarity are weighted averaged to obtain the document relevance, which can enable higher graph similarities to have higher weights in the calculation process, thereby helping to improve the accuracy of determining document relevance.

[0179] After obtaining the document relevance corresponding to each third document, the document relevance corresponding to all third documents can be directly fed back to the user, so that the user can use the document relevance as a reference to autonomously select related documents that match the first document and have a higher relevance from the third documents. The third documents whose document relevance is greater than or equal to the third similarity threshold can also be determined as related documents of the final search result; the third documents with the highest document relevance among a third preset number can also be determined as related documents and fed back to the user.

[0180] Reference Figure 5 , Figure 5 A flow chart of determining document relevance provided by an embodiment of the present application is shown. Figure 5 As shown, the first document can be preprocessed first, and the second document in the second document set can be preprocessed to obtain summary information and a document graph of the first document, and then summary screening can be performed. The third document can be screened through the summary information of the first document and the summary information of the second document, and then the document relevance can be determined based on the document graph of the third document and the document graph of the first document, and the relevant document set can be output based on the document relevance.

[0181] In summary, another document retrieval method provided by the embodiment of the present application includes: obtaining a first summary of a first document; screening a third document from multiple second documents according to the semantic similarity between the first summary and the second summary corresponding to multiple second documents; extracting the content features of the first document and the correlation between the content features, and generating a first graph corresponding to the first document based on the content features and the correlation; determining the document relevance between the first document and the third document according to the second graph corresponding to the first graph and the third document; wherein the document relevance is used to determine the related documents of the first document from the third document. A corresponding graph can be generated according to the content of the document, and document retrieval can be performed through graph comparison. Since the graph of the document can accurately reflect the content structure of the document, it helps to improve the accuracy of document retrieval, and the whole process can be automated without the need for the user to analyze the document content, which helps to improve the efficiency of document retrieval. In addition, preliminary screening can be performed through document summaries with less content, reducing the number of documents that need to be matched with graphs, which helps to further improve the efficiency of document retrieval.

[0182] like Figure 6 As shown, Figure 6 A logical block diagram of a document retrieval device provided in an embodiment of the present application, the document retrieval device 600 may include:

[0183] A summary module 601 is used to obtain a first summary of a first document;

[0184] A document screening module 602, configured to screen a third document from the plurality of second documents according to semantic similarities between the first summary and second summaries respectively corresponding to the plurality of second documents;

[0185] A graph module 603, configured to extract content features of the first document and correlations between the content features, and generate a first graph corresponding to the first document based on the content features and the correlations;

[0186] The document relevance module 604 is used to determine the document relevance between the first document and the third document based on the second graphs corresponding to the first graph and the third document respectively; wherein the document relevance is used to determine the related documents of the first document from the third document.

[0187] Optionally, the summary module includes:

[0188] A first segment submodule, configured to extract a first segment from the first document according to a first segment extraction rule corresponding to the document type of the first document;

[0189] The first summary determination submodule is used to input the first segment and the first prompt word into a large language model to obtain the first summary output by the large language model.

[0190] Optionally, the document screening module includes:

[0191] a semantic similarity submodule, configured to determine the semantic similarity between the first abstract and the second abstract according to a first term frequency inverse document frequency corresponding to the first abstract and a second term frequency inverse document frequency corresponding to the second abstract;

[0192] An intermediate document submodule, used for selecting intermediate documents from the second document based on the semantic similarity;

[0193] a content similarity submodule, configured to input the first summary, the third summary corresponding to the intermediate document, and the second prompt word into a large language model, and obtain content similarity between the first document and the intermediate document output by the large language model;

[0194] The third document screening submodule is used to screen the third document from the intermediate documents based on the content similarity.

[0195] Optionally, the atlas module includes:

[0196] A second segment submodule, configured to extract a second segment from the first document according to a second segment extraction rule corresponding to the document type of the first document;

[0197] The association submodule is used to input the second segment and the third prompt word into the large language model to obtain the content features output by the large language model and the association relationship between the content features.

[0198] Optionally, the first graph includes a first content structure graph and a first content logic graph, the second graph includes a second content structure graph and a second content logic graph, and the document relevance module includes:

[0199] A first graph similarity submodule, configured to determine a first graph similarity based on the first content structure graph and the second content structure graph;

[0200] A second graph similarity submodule, configured to determine a second graph similarity based on the first content logic graph and the second content logic graph;

[0201] The document relevance determination submodule is used to determine the document relevance according to the first graph similarity and the second graph similarity.

[0202] Optionally, the document relevance determination submodule includes:

[0203] A first weighting unit, configured to determine a first weight corresponding to the first graph similarity according to a difference between the first graph similarity and a first threshold;

[0204] A second weighting unit, configured to determine a second weight corresponding to the second graph similarity according to a difference between the second graph similarity and a second threshold;

[0205] A document relevance weighting unit is used to perform a weighted average of the first graph similarity and the second graph similarity based on the first weight and the second weight to obtain the document relevance.

[0206] Optionally, the device further comprises:

[0207] A threshold updating module is used to update the first threshold and the second threshold when the first difference between the maximum document relevance corresponding to the third document and the document relevance corresponding to the associated document selected by the user from the third document is not equal to 0, so that the second difference between the maximum document relevance corresponding to the third document recalculated based on the updated first threshold and the updated second threshold and the recalculated document relevance corresponding to the associated document is smaller than the first difference.

[0208] Optionally, the content features include document structure features and document content features, and the graph module includes:

[0209] A first content structure graph submodule, configured to generate the first content structure graph based on the association relationship between the document structure feature and the document content feature;

[0210] The first content logic graph submodule is used to generate the first content logic graph based on the association relationship between the document content features.

[0211] Optionally, the device further comprises:

[0212] A type keyword module is used to obtain target type keywords that match a preset type keyword set from an original document;

[0213] A document type module, used to determine the document type of the original document based on the target type keyword;

[0214] A third segment module, configured to extract a third segment from the original document based on a third segment extraction rule corresponding to the document type of the original document;

[0215] The first document module is used to fill the third segment into the document standardization template corresponding to the document type to obtain the first document.

[0216] In summary, a document retrieval device provided in an embodiment of the present application includes: a summary module for obtaining a first summary of a first document; a document screening module for screening a third document from the plurality of second documents according to the semantic similarity between the first summary and the second summaries corresponding to the plurality of second documents; a graph module for extracting the content features of the first document and the association relationship between the content features, and generating a first graph corresponding to the first document based on the content features and the association relationship; a document relevance module for determining the document relevance between the first document and the third document according to the second graphs corresponding to the first graph and the third document; wherein the document relevance is used to determine the related documents of the first document from the third document. A corresponding graph can be generated according to the content of the document, and document retrieval can be performed by graph comparison. Since the graph of the document can accurately reflect the content structure of the document, it is helpful to improve the accuracy of document retrieval, and the whole process can be performed automatically without the user having to analyze the document content, which is helpful to improve the efficiency of document retrieval. In addition, preliminary screening can be performed through document summaries with less content, reducing the number of documents that need to be matched with the graph, which is helpful to further improve the efficiency of document retrieval.

[0217] The document retrieval device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0218] The document retrieval device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, a Linux operating system, a Windows operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0219] The document retrieval device provided in the embodiment of the present application can achieve Figures 1 to 5 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0220] Alternatively, if Figure 7 As shown, an embodiment of the present application also provides an electronic device M00, including a processor M01 and a memory M02, wherein the memory M02 stores programs or instructions that can be run on the processor M01, and when the program or instructions are executed by the processor M01, the various steps of the above-mentioned document retrieval method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0221] In an embodiment of the present application, the memory M02 can be used to store software programs and various data. The memory M02 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory M02 may include a volatile memory or a non-volatile memory, or the memory x09 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory M02 in the embodiment of the present application includes but is not limited to these and any other suitable types of memories.

[0222] The processor M01 may include one or more processing units; optionally, the processor M01 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor M01.

[0223] An embodiment of the present application also provides an electronic device, including the document retrieval device and the refrigerant circulation device as described above, which are used to implement the various processes of the above-mentioned document retrieval method embodiment and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0224] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned document retrieval method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0225] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0226] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned document retrieval method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0227] It should be understood that the chip involved in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0228] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the document retrieval method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0229] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0230] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0231] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A document retrieval method, characterized in that: The method comprises: Get a first summary of a first document; selecting a third document from the plurality of second documents according to semantic similarities between the first abstract and second abstracts respectively corresponding to the plurality of second documents; Extracting content features of the first document and associations between the content features, and generating a first graph corresponding to the first document based on the content features and the associations; The document relevance between the first document and the third document is determined according to the second graphs corresponding to the first graph and the third document respectively; wherein the document relevance is used to determine related documents of the first document from the third document.

2. The method according to claim 1, characterized in that: The step of obtaining a first summary of the first document includes: extracting a first segment from the first document according to a first segment extraction rule corresponding to the document type of the first document; The first segment and the first prompt word are input into a large language model to obtain the first summary output by the large language model.

3. The method according to claim 1, characterized in that The step of selecting a third document from the plurality of second documents according to the semantic similarity between the first abstract and the second abstracts respectively corresponding to the plurality of second documents comprises: Determining a semantic similarity between the first abstract and the second abstract according to a first term frequency inverse document frequency corresponding to the first abstract and a second term frequency inverse document frequency corresponding to the second abstract; Filtering intermediate documents from the second document based on the semantic similarity; Inputting the first summary, the third summary corresponding to the intermediate document, and the second prompt word into a large language model to obtain content similarity between the first document and the intermediate document output by the large language model; The third document is selected from the intermediate documents based on the content similarity.

4. The method according to claim 1, characterized in that The extracting the content features of the first document and the association relationship between the content features includes: extracting a second segment from the first document according to a second segment extraction rule corresponding to the document type of the first document; The second segment and the third prompt word are input into a large language model to obtain the content features output by the large language model and the association relationship between the content features.

5. The method according to claim 1, characterized in that: The first graph includes a first content structure graph and a first content logic graph, the second graph includes a second content structure graph and a second content logic graph, and determining the document relevance between the first document and the third document according to the second graphs corresponding to the first graph and the third document respectively, includes: Determine the similarity of the first graph based on the first content structure graph and the second content structure graph; Determine the second graph similarity based on the first content logic graph and the second content logic graph; The document relevance is determined according to the first graph similarity and the second graph similarity.

6. The method according to claim 5, characterized in that The determining the document relevance according to the first graph similarity and the second graph similarity includes: Determining a first weight corresponding to the first graph similarity according to a difference between the first graph similarity and a first threshold; Determining a second weight corresponding to the second graph similarity according to a difference between the second graph similarity and a second threshold; Based on the first weight and the second weight, a weighted average is performed on the first graph similarity and the second graph similarity to obtain the document relevance.

7. The method according to claim 6, characterized in that The method further comprises: When a first difference between the maximum document relevance corresponding to the third document and the document relevance corresponding to the associated document selected by the user from the third document is not equal to 0, the first threshold and the second threshold are updated so that a second difference between the maximum document relevance corresponding to the third document recalculated based on the updated first threshold and the updated second threshold and the recalculated document relevance corresponding to the associated document is less than the first difference.

8. The method according to claim 5, characterized in that The content features include document structure features and document content features, and generating a first graph corresponding to the first document based on the content features and the association relationship includes: Based on the association relationship between the document structure feature and the document content feature, generating the first content structure graph; The first content logic graph is generated based on the association relationship between the document content features.

9. The method according to claim 1, characterized in that: Before obtaining the first summary of the first document, the method further includes: Acquire target type keywords matching a preset type keyword set from the original document; Determining the document type of the original document based on the target type keyword; extracting a third segment from the original document based on a third segment extraction rule corresponding to the document type of the original document; The third segment is filled into a document standardization template corresponding to the document type to obtain the first document.

10. A document retrieval device, characterized in that: The device comprises: A summary module, used for obtaining a first summary of a first document; A document screening module, configured to screen a third document from the plurality of second documents according to semantic similarities between the first summary and second summaries respectively corresponding to the plurality of second documents; A graph module, configured to extract content features of the first document and associations between the content features, and generate a first graph corresponding to the first document based on the content features and the associations; A document relevance module is used to determine the document relevance between the first document and the third document based on the second graph corresponding to the first graph and the third document respectively; wherein the document relevance is used to determine the related documents of the first document from the third document.

11. An electronic device, characterized in that: The document retrieval device comprises the document retrieval device as claimed in claim 10, which is used to implement the document retrieval method as claimed in any one of claims 1 to 9.

12. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the document retrieval method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Method and system for correcting answer content based on image recognition

    CN120599636A

  • Chip parameter retrieval method and device, electronic equipment and storage medium

    CN121434329A