Intelligent question and answer method for digital archive data

By building a knowledge vector library of digital archives and using deep hash networks and large language models to generate answers, the limitations of traditional archive intelligent question-and-answer system are solved, efficient and secure archive database retrieval and answers are achieved, and the intelligence level of archive resource services is improved.

CN120448513AInactive Publication Date: 2025-08-08BEIJING INST OF COMP TECH & APPL
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510964310.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-08-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional archive intelligent question-and-answer system has limitations in knowledge base construction and manual intervention, resulting in inefficient archive consultation services, especially when facing highly professional problems, they cannot effectively respond to user needs.

Method used

Build a knowledge vector library of digital archives, convert knowledge vectors into hash vectors through deep hash networks, and use large language models to generate answers, combining user permission control to achieve secure access, and improve retrieval speed and accuracy.

Benefits of technology

It realizes efficient and full retrieval and structured answers of archive databases, ensures the traceability and security of answers, and improves the intelligence level of archive resource services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448513A_ABST
    Figure CN120448513A_ABST
Patent Text Reader

Abstract

The invention relates to an intelligent question answering method for digital archive data, and belongs to the field of artificial intelligence. In order to solve the limitation problem of a traditional archive intelligent question-answering system in knowledge base construction and manual intervention, a knowledge vector library of digital archives is constructed, then semantic similar and semantic dissimilar text knowledge vector pairs are constructed, the knowledge vector pairs are input into a deep Hash network, and the knowledge vector pairs are input into the deep Hash network. The deep Hash network learns a coding mode in a supervised form, meanwhile, semantic similarity information of a text is reserved, and after the deep Hash network is obtained through training, knowledge vectors in a knowledge vector library are converted into Hash vectors through the deep Hash network; a large language model is used for converting a question proposed by a user into a question vector, a result text block is obtained according to Hash vector matching, and finally a final answer is generated in the large language model through a cue word template. According to the method, the answer retrieval speed is effectively improved, and the intelligent ability of archive resource service is remarkably enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence, and in particular relates to an intelligent question-answering method for digital archive data. Background Art

[0002] With the rapid development of digital technology, the sources and volume of archival data have exploded. This diversity and massive volume have led to difficulties in effectively utilizing archival data. Faced with this surge of archival information, users often spend a significant amount of time reviewing and integrating the data, extracting the required knowledge from the complex information. This process is both time-consuming and labor-intensive.

[0003] When faced with massive amounts of archival information, users need to upgrade not only their data storage capabilities but, more importantly, their ability to quickly retrieve, integrate, and extract knowledge. Driven by this demand and driven by the surge in artificial intelligence technology, intelligent question-and-answer systems have emerged. These systems, relying on natural language processing technology, accurately capture user intent and provide precise and concise responses to user needs. Based on semantic understanding, intelligent question-and-answer systems deeply explore and fully utilize the potential value of archival resources. Through a natural and fluid dialogue mode, users experience the convenience and accuracy of archival resource query and retrieval, efficiently resolving user questions regarding daily services, historical archives, and other areas. This innovative approach marks a new transformation for archives in providing high-quality consulting services to users in the context of informatization, and opens a new chapter in the intelligentization of archival resource services.

[0004] Current archival intelligent question-and-answer systems primarily rely on knowledge bases for intelligent responses. Their construction process involves first building an archival knowledge base using technologies like knowledge graphs and association analysis, and then providing question-and-answer services based on this knowledge base. However, this model has significant limitations. First, knowledge base construction is time-consuming and resource-intensive. Furthermore, the constant updating of archival data makes it extremely difficult to construct a comprehensive and rich archival question-and-answer knowledge base. Second, while some provincial archival information websites have deployed intelligent question-and-answer robots, their functionality is limited to answering questions with pre-set keywords. For questions not tagged with keywords, the robots can only provide offline solutions such as "Sorry, please contact a librarian" or "For further assistance, please call xxx." This is particularly true for highly specialized questions, where archival staff may be unable to provide direct answers and may even require coordination across multiple departments to compile responses. This results in inefficient responses to user needs, both in terms of time and space, and impacts the efficiency of archival consultation services. In addition, the processing of archival data must strictly comply with the principles of data integrity, security, authenticity, and availability. Therefore, when designing an archival intelligent question-answering system, the traceability of answers must be considered to ensure the availability, integrity, and authenticity of archival data. Different access rights must be assigned according to user roles, and the security of archival data access must be ensured through identity authentication mechanisms. Summary of the Invention

[0005] (1) Technical issues to be resolved

[0006] The technical problem to be solved by the present invention is how to provide an intelligent question-answering method for digital archival data to solve the limitations of traditional archival intelligent question-answering systems in knowledge base construction and manual intervention.

[0007] (2) Technical solution

[0008] In order to solve the above technical problems, the present invention proposes an intelligent question-answering method for digital archive data, which includes the following steps:

[0009] S1. Divide digital archive documents into fixed-length text blocks and use a large model to convert each text block into a corresponding knowledge vector representation, thereby building a knowledge vector library for digital archives.

[0010] S2. Randomly select some knowledge vectors to form a sub-library, pair the data in the knowledge vector sub-library, and construct semantically similar and semantically dissimilar text knowledge vector pairs;

[0011] S3. Input the knowledge vector pairs into the deep hash network. The deep hash network learns the encoding method in a supervised manner while retaining the semantic similarity information of the text. After the deep hash network is trained, all knowledge vectors in the knowledge vector library are converted into hash vectors through the deep hash network to form a hash knowledge library.

[0012] S4. Use a large language model to convert the user's question into a question vector. Based on a deep hash network, convert the question vector into a question hash vector. Calculate the similarity between the question hash vector and the hash vectors in the hash knowledge base and sort them to obtain the top k hash vector sets and their indexes in the hash knowledge base. Then, obtain the corresponding knowledge vector set in the knowledge vector library through the index. Then, filter the text corresponding to the knowledge vector in the knowledge vector set and match it with the user's permissions to obtain a knowledge vector set that matches the user's permissions. Further calculate the semantic similarity between the question vector and the knowledge vectors in the knowledge vector set that match the permissions, and re-sort them according to the semantic similarity to obtain the result text block.

[0013] S5. During the answer generation process, the result text block is added to the prompt word template together with the question, and input into the pre-trained large language model to generate the final answer.

[0014] (3) Beneficial effects

[0015] The present invention proposes an intelligent question-and-answer method for digital archival data. Compared with the existing technology, the technical solution proposed in the present invention adopts the method of establishing a vector knowledge base to realize the full retrieval of the archival database, avoiding the tedious and resource-intensive process of establishing a knowledge base in advance through means such as knowledge extraction. At the same time, the deep hashing method is used for retrieval, which effectively improves the retrieval speed. In addition, with the help of large model technology, inductive conclusions are summarized and the source of supporting documents is provided, allowing users to quickly and accurately obtain the required archival knowledge. At the same time, this method takes into account the security access control of archival data. It uses RAG technology combined with the original archival system role permissions to limit the scope of the vector knowledge base that a certain role can access, thereby realizing an archival intelligent question-and-answer system based on role permission access control. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a diagram of the deep hashing network structure during the processing of the present invention;

[0017] Figure 2 The figure is a flow chart of the processing method of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings and examples.

[0019] This invention aims to develop an intelligent question-answering method for digital archival data. Through a user-role-based secure access control mechanism, it enables efficient retrieval and structured response feedback across the entire archival database, while ensuring the traceability of the basis for the responses. This method effectively addresses the limitations of traditional archival intelligent question-answering systems in terms of knowledge base construction and manual intervention, enhancing the intelligence of archival resource services.

[0020] The present invention provides an intelligent question-answering method for digital archive data, comprising the following steps:

[0021] S1. Divide digital archive documents into fixed-length text blocks and use a large model to convert each text block into a corresponding knowledge vector representation, thereby building a knowledge vector library for digital archives.

[0022] S2. Randomly select some knowledge vectors to form a sub-library, pair the data in the knowledge vector sub-library, and construct semantically similar and semantically dissimilar text knowledge vector pairs;

[0023] S3. Input the knowledge vector pairs into the deep hash network. The deep hash network learns the encoding method in a supervised manner while retaining the semantic similarity information of the text. After the deep hash network is trained, all knowledge vectors in the knowledge vector library are converted into hash vectors through the deep hash network to form a hash knowledge library.

[0024] S4. Use a large language model to convert the questions raised by the user into question vectors, convert the question vectors into question hash vectors based on a deep hash network, calculate the similarity between the question hash vectors and the hash vectors in the hash knowledge base and sort them, obtain the top k hash vector sets and their indexes in the hash knowledge base, and obtain the corresponding knowledge vector set in the knowledge vector library through the index; then match and filter the text corresponding to the knowledge vectors in the knowledge vector set with the user permissions to obtain a knowledge vector set that matches the user permissions; further calculate the semantic similarity between the question vector and the knowledge vectors in the knowledge vector set that match the permissions, and reorder them according to the semantic similarity to obtain the result text block.

[0025] S5. During the answer generation process, the result text block is added to the prompt word template together with the question, and input into the pre-trained large language model to generate the final answer.

[0026] Example 1:

[0027] 1. Archive text segmentation and knowledge vector construction

[0028] make for A digital archive document is divided into blocks using TextSplitter, and the text information in the document is divided into text blocks with a length of 1000 tokens (characters). The text blocks obtained after the document is divided into blocks are represented as ,in i =[1,2,3,…, N ] Indicates the serial number of the archive document. j =[1,2,3,…, m i ] Indicates the text block number obtained after the current archive document is divided. Then, each text block is converted into a knowledge vector representation using the locally deployed Chinese QWEN language model. For each text block , and its corresponding knowledge vector is expressed as . Represents the QWEN large language model, from which the knowledge vector library of digital archives is constructed, as shown in formula (1):

[0029] (1)

[0030] The solution algorithm is:

[0031] S11. Use TextSplitter to split digital archive document collections Perform block division, the specific steps are shown in S111-S114:

[0032] S111, Order , ;

[0033] S112, TextSplitter for documents Divide into blocks A text block { };

[0034] S113, Order { }, about to { }Add to middle;

[0035] S114, if ,but , jump to S112; otherwise jump to S12;

[0036] S12, convert each text block into a knowledge vector representation, the specific steps are shown in S121-S126; let ;

[0037] S121, Order ;

[0038] S122, Order ;

[0039] S123, Order ;

[0040] S124, Order , about to Add to In the meantime, save Index and , where information represents the index of the archive text, Represents the index of the text block;

[0041] S125, if ,but , jump to S123; otherwise jump to S126;

[0042] S126, if ,but , jump to S122; otherwise end and return to the knowledge vector library .

[0043] 2. Construction of semantically similar and semantically dissimilar knowledge vector pairs

[0044] Unlike the traditional RAG technology, which uses a relatively small amount of vertical domain knowledge data, the digital archive data documents targeted by this invention are numerous (millions of levels) and have a large amount of data (TB level), so there are high requirements for retrieval speed. Deep hashing technology is introduced here to convert the knowledge vector extracted by the large model into a hash code through a deep hash network, thereby improving the retrieval speed. Hash coding is a binary encoding method, that is, the value in the hash vector is or Therefore, it is necessary to pair the data in the acquired knowledge vector library and construct semantically similar and semantically dissimilar text knowledge vector pairs, so that the deep hash network can learn the encoding method in a supervised form while retaining the semantic similarity information of the text.

[0045] The present invention will first start from the knowledge vector library Randomly select The knowledge vectors constitute the sub-library , and calculate The semantic similarity between all knowledge vectors in is used to construct a similarity matrix. For all the knowledge vectors in , a semantically similar knowledge vector pair and a semantically dissimilar knowledge vector pair are constructed for each knowledge vector, and the corresponding label data set is constructed.

[0046] The calculation method is:

[0047] S21. Computational Knowledge Vector Library The semantic similarity between all knowledge vectors in the constructs a similarity matrix , the specific steps are shown in S211-S215;

[0048] S211, Order , for The number of knowledge vectors in , is a matrix of all 0s;

[0049] S212, Order ;

[0050] S213, Order ,in is the similarity matrix The position index of for The i2th knowledge vector in ;

[0051] S214, if ,but , jump to S213; otherwise jump to S215;

[0052] S215, if ,but , jump to S212; otherwise, end and jump to S22;

[0053] S22, traversal All knowledge vectors in the , construct a semantically similar knowledge vector pair for each knowledge vector , and a semantically dissimilar knowledge vector pair , and build the corresponding label data set and , the specific steps are shown in S221-S227;

[0054] S221, Order , , , ;

[0055] S222, Order ;

[0056] S223, yes Sort and get the maximum value index ;

[0057] S224, will Add to In Add to middle;

[0058] S225, yes Sort and get the minimum index ;

[0059] S226, will Add to In Add to middle;

[0060] S227, if ,but , jump to S223; otherwise end and return , , , .

[0061] 3. Train the deep hash network and generate the hash vector library

[0062] For a set of semantically similar text knowledge vector pairs and the set of semantically dissimilar text knowledge vector pairs , and their label information are and .in, are the first knowledge vector and the second knowledge vector of the first semantically similar text knowledge vector pair, are the first knowledge vector and the second knowledge vector of the first semantically dissimilar text knowledge vector pair.

[0063] Taking the knowledge vector as input, it is converted into a binary coded hash vector through the deep hash network. The deep hash network is as follows Figure 1 As shown, it includes: a feedforward network and a hash layer. After the text block is converted into a knowledge vector by the large language model, it passes through a feedforward network and a hash layer to obtain a hash vector. The feedforward network is composed of a stack of 5 layers of fully connected networks, receiving a collection of or collection The knowledge vector pairs in the network are expanded to higher dimensions to enhance the model's expressive power, and then the dimensionality is reduced to output to obtain the intermediate vector representation of the original input. The hash layer maps the intermediate vector representation output by the fully connected network by setting a threshold, and maps the value of each bit in the intermediate vector to or , thereby converting the intermediate vector into a hash vector. Finally, the similarity is obtained by calculating the Hamming distance of the hash vector pair, and the loss function is defined as the cross entropy loss of the similarity result and the corresponding label information. The model parameters are optimized through the back propagation algorithm.

[0064] The calculation method is:

[0065] S31, set Representing a collection and collection For all pairs of knowledge vectors in Representing a collection The labels of the knowledge vector pairs in , Representing a collection The number of knowledge vector pairs in , let , ;

[0066] S32, order ;

[0067] S33, Order , ,in and Set Middle For the first and second knowledge vectors of a knowledge vector pair, is the first layer fully connected network parameter;

[0068] S34, Order , , is the second layer fully connected network parameter;

[0069] S35, Order , , is the third layer fully connected network parameter;

[0070] S36, Order , , is the fourth layer fully connected network parameter;

[0071] S37, Order , , is the fifth layer fully connected network parameter;

[0072] S38, Order , is the intermediate vector representation length, is the intermediate vector representation length, , hash encoding is performed on the intermediate vector representation, and the specific steps are shown in S381-S383;

[0073] S381, if ,make , otherwise let ;in, for of Bit, for The mean of all bits of ;

[0074] S382, if ,make , otherwise let ;

[0075] S383, if ,but , jump to S381; otherwise end, jump to S39;

[0076] S39, calculation and Hamming distance and its similarities ;

[0077] S310, calculate cross entropy loss and back propagate updated parameters;

[0078] S311, if ,but , jump to S33; otherwise if ,but , jump to S32; otherwise end and get the deep hash network , jump to S312;

[0079] S312. Calculate the knowledge vector library The hash vectors of all knowledge vectors in the hash knowledge base are obtained , the specific steps are shown in S3121-S3125;

[0080] S3121, Order , ;

[0081] S3122, Order ;

[0082] S3123, Order and add it to In the meantime, save Index and , where information represents the index of the archive text, Represents the index of the text block; although the deep hash network of S311 It is obtained through training of knowledge vector pairs, but the input knowledge vector can also be processed to obtain the hash vector;

[0083] S3124, if ,but , jump to S3123; otherwise jump to S3125.

[0084] S3125, if ,but , jump to S3122; otherwise end and return to the hash knowledge base and Deep Hashing Network .

[0085] 4. Similarity retrieval and re-ranking based on access control

[0086] Based on the deep hash coding of knowledge vectors, the QWEN large language model is used to vectorize the questions raised by users. And further convert it into a hash vector that retains semantic information based on the deep hash network , traverse the hash knowledge base All hash vectors in the , and calculate the hash similarity between the knowledge vector and the question vector based on the Hamming distance between the hash vectors, and then sort them according to the similarity to get the top ranking A collection of hash vectors , and get its index information at the same time , and indexed in the knowledge vector library Retrieve the corresponding knowledge vector set . For the set The knowledge vectors in the corresponding text are matched and filtered with the user permissions to obtain the set . Further, the vector representation of the question raised by the user and The knowledge vectors in the dataset are calculated similarly and re-ranked according to semantic similarity to ensure the relevance and correctness of the answers.

[0087] The calculation method is:

[0088] S41. Using the QWEN large language model Calculate user questions Vector representation of , and using deep hashing networks get Hash vector of ,make Representing hash knowledge base The number of hash vectors in , and calculate and The similarity of the hash vector in , and the similarity vector , the specific steps are shown in S411-S416:

[0089] S411, Order , ;

[0090] S412, Order ;

[0091] S413, calculation and Hamming distance and its similarities ;

[0092] S414, Order ;

[0093] S415, if ,but , jump to S413; otherwise jump to S416;

[0094] S416, if ,but , jump to S412; otherwise jump to S42;

[0095] S42, yes Sort from large to small and get the top ranking A collection of hash vectors , get its index information , and indexed in the knowledge vector library Retrieve the corresponding knowledge vector set , the specific steps are shown in S421-S425:

[0096] S421, yes Sort from largest to smallest ;

[0097] S422, get the top ranking A collection of hash vectors ;

[0098] S423, get the top ranking A collection of hash vectors Corresponding Middle Index ;

[0099] S424, from the knowledge vector library Retrieve the corresponding knowledge vector set ;

[0100] S425, return and , jump to S43;

[0101] S43, pair set The knowledge vectors in the corresponding text are matched and filtered with the user permissions to obtain the set ;

[0102] S44, pair set The knowledge vector in the vector representation of the question raised by the user Calculate similarity and re-rank. The specific steps are shown in S441-S443:

[0103] S441, Order , , for The number of knowledge vectors in ;

[0104] S442, Order ,in is the similarity vector The position index of

[0105] S443, if ,but , jump to S442; otherwise jump to S45;

[0106] S45, yes Sort by order from largest to smallest , corresponding index , and the original text chunks { }, and return .

[0107] 5. Answer generation based on prompt word template

[0108] During the answer generation process, the authority matching items are reordered and added to the prompt word template together with the question, and then input into the pre-trained QWEN large language model to generate the final answer. This ensures that the answer is derived based on contextual semantic information and can provide source explanations based on the answer index. The answer generation process is as follows: Figure 2 As shown. To further clarify user permissions and guide the standardized expression of large models, based on the RAG technology optimization model, a set of prompt word templates was designed by sorting out common question and answer pairs in digital archive Q&A. The prompt word templates include design principles such as clear role positioning, clear and concise task instructions, limited reference knowledge scope and permissions, and clear handling methods for out-of-scope issues. After repeated testing and comparison, the prompt word template used in this article is: "You are a senior archive expert, familiar with all the document contents in the archive, and have extensive experience in archive utilization. Users will ask you some questions about archive utilization processes or archive documents. Please answer them in concise and professional sentences based on the known information and user permissions, and provide the known information sources referenced in the process of generating the answer. If you cannot find the answer from the known information, please say "I cannot answer this question based on the known information" and do not fabricate answers. Question: {user input}; known information: {raw text blocks retrieved from the knowledge base}".

[0109] In order to fully limit the hallucinations of the big model, control the scope of access to archival data, and improve the question-answering accuracy of the system, the present invention mainly adopts two technologies: prompt word engineering and retrieval enhancement generation. The basic principles are: 1) Clarify the role positioning, positioning the model role as a "senior archival expert", helping the big model to better understand professional terms and context, and thus generate answers that are more in line with domain needs; 2) Emphasize accuracy, through the prompt word "Please answer with concise and professional sentences based on known information and user permissions", constrain the big model to only generate answers based on retrieved information that meets user permissions, prevent it from relying on potential errors or outdated information in pre-trained knowledge, and avoid the big model from accessing non-compliant information; 3) Clarify the constraints, through the prompt word "If the answer cannot be found from the known information", prevent the model from generating false or uncertain content, and improve the credibility of the system; 4) Provide accurate and reliable reference information, through the prompt word "Give the known information source referenced in the process of generating the answer", further ensure the accuracy and practicality of the answers generated by the big model.

[0110] Compared with existing technologies, the technical solution proposed in this invention uses a vector knowledge base to achieve full retrieval of the archival database, avoiding the tedious and resource-intensive process of establishing a knowledge base through knowledge extraction and other means in advance. It also uses deep hashing for retrieval, effectively improving retrieval speed. Furthermore, by leveraging large model technology to summarize and form inductive conclusions and provide supporting document sources, users can quickly and accurately obtain the required archival knowledge. Furthermore, this method considers secure access control of archival data, utilizing RAG technology combined with existing archival system role permissions to limit the scope of the vector knowledge base that a role can access, thereby realizing an archival intelligent question-and-answer system based on role-based access control.

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

Claims

1. An intelligent question-answering method for digital archive data, characterized in that: The method comprises the following steps: S1. Divide digital archive documents into fixed-length text blocks and use a large model to convert each text block into a corresponding knowledge vector representation, thereby building a knowledge vector library for digital archives. S2. Randomly select some knowledge vectors to form a sub-library, pair the data in the knowledge vector sub-library, and construct semantically similar and semantically dissimilar text knowledge vector pairs; S3. Input the knowledge vector pairs into the deep hash network. The deep hash network learns the encoding method in a supervised manner while retaining the semantic similarity information of the text. After the deep hash network is trained, all knowledge vectors in the knowledge vector library are converted into hash vectors through the deep hash network to form a hash knowledge library. S4. Use a large language model to convert the user's question into a question vector. Based on a deep hash network, convert the question vector into a question hash vector. Calculate the similarity between the question hash vector and the hash vectors in the hash knowledge base and sort them to obtain the top k hash vector sets and their indexes in the hash knowledge base. Then, obtain the corresponding knowledge vector set in the knowledge vector library through the index. Then, filter the text corresponding to the knowledge vector in the knowledge vector set and match it with the user's permissions to obtain a knowledge vector set that matches the user's permissions. Further calculate the semantic similarity between the question vector and the knowledge vectors in the knowledge vector set that match the permissions, and re-sort them according to the semantic similarity to obtain the result text block. S5. During the answer generation process, the result text block is added to the prompt word template together with the question, and input into the pre-trained large language model to generate the final answer.

2. The intelligent question-answering method for digital archive data according to claim 1, characterized in that: Said S1 specifically includes: for A digital archive document is divided into blocks using TextSplitter, and the text information in the document is divided into text blocks with a length of 1000 tokens. The text blocks obtained after the document is divided into blocks are represented as ,in Indicates the serial number of the archive document, Indicates the text block number obtained after the current archive document is divided; then the locally deployed Chinese QWEN large language model is used to convert each text block into a knowledge vector representation; for each text block , and its corresponding knowledge vector is expressed as ; Represents the QWEN large language model, from which the knowledge vector library of digital archives is constructed, as shown in formula (1): (1)。 3. The intelligent question-answering method for digital archive data according to claim 2, characterized in that: The S1 specifically includes the following steps: S11. Use TextSplitter to split digital archive document collections Perform block division, the specific steps are shown in S111-S114: S111, Order , ; S112, TextSplitter for documents Divide into blocks A text block { }; S113, Order { }, about to { }Add to middle; S114, if ,but , jump to S112; otherwise jump to S12; S12, convert each text block into a knowledge vector representation. The specific steps are shown in S121-S126: ; S121, Order ; S122, Order ; S123, Order ; S124, Order , about to Add to In the meantime, save Index and , where information represents the index of the archive text, Represents the index of the text block; S125, if ,but , jump to S123; otherwise jump to S126; S126, if ,but , jump to S122; otherwise end and return to the knowledge vector library .

4. The intelligent question-answering method for digital archive data according to claim 3, characterized in that: The S2 includes: first, from the knowledge vector library Randomly select The knowledge vectors constitute the sub-library , and calculate The semantic similarity between all knowledge vectors in the constructs a similarity matrix; on this basis, traverse For all the knowledge vectors in , a semantically similar knowledge vector pair and a semantically dissimilar knowledge vector pair are constructed for each knowledge vector, and the corresponding label data set is constructed.

5. The intelligent question-answering method for digital archive data according to claim 3, characterized in that: The S2 specifically includes the following steps: S21. Computational Knowledge Vector Library The semantic similarity between all knowledge vectors in the constructs a similarity matrix , the specific steps are shown in S211-S215: S211, Order , for The number of knowledge vectors in , is a matrix of all 0s; S212, Order ; S213, Order ,in is the similarity matrix The position index of for The i2th knowledge vector in ; S214, if ,but , jump to S213; otherwise jump to S215; S215, if ,but , jump to S212; otherwise, end and jump to S22; S22, traversal All knowledge vectors in the , construct a semantically similar knowledge vector pair for each knowledge vector , and a semantically dissimilar knowledge vector pair , and build the corresponding label data set and , the specific steps are shown in S221-S227: S221, Order , , , ; S222, Order ; S223, yes Sort and get the maximum value index ; S224, will Add to In Add to middle; S225, yes Sort and get the minimum index ; S226, will Add to In Add to middle; S227, if ,but , jump to S223; otherwise end and return , , , ; For a set of semantically similar text knowledge vector pairs and the set of semantically dissimilar text knowledge vector pairs , and their label information are and ;in, are the first knowledge vector and the second knowledge vector of the first semantically similar text knowledge vector pair, are the first knowledge vector and the second knowledge vector of the first semantically dissimilar text knowledge vector pair.

6. The intelligent question-answering method for digital archive data according to claim 5, characterized in that: In S3, the knowledge vector is used as input and converted into a binary coded hash vector through a deep hash network. The deep hash network includes: a feedforward network and a hash layer. After the text block is converted into a knowledge vector by the large language model, it passes through a feedforward network and a hash layer to obtain a hash vector; the feedforward network is composed of a stack of 5 fully connected networks, and receives the set or collection The knowledge vector pairs in the network are expanded to higher dimensions to enhance the expressive power of the model, and then the dimensionality is reduced to output to obtain the intermediate vector representation of the original input; the hash layer maps the intermediate vector representation output by the fully connected network by setting the threshold, and maps the value of each bit in the intermediate vector into or , thereby converting the intermediate vector into a hash vector; finally, the similarity is obtained by calculating the Hamming distance of the hash vector pair, and the loss function is defined as the cross entropy loss of the similarity result and the corresponding label information, and the model parameters are optimized through the back propagation algorithm.

7. The intelligent question-answering method for digital archive data according to claim 5, characterized in that: The S3 specifically includes: S31, set Representing a collection and collection For all pairs of knowledge vectors in Representing a collection The labels of the knowledge vector pairs in , Representing a collection The number of knowledge vector pairs in , let , ; S32, order ; S33, Order , ,in and Set Middle For the first and second knowledge vectors of a knowledge vector pair, is the first layer fully connected network parameter; S34, order , , is the second layer fully connected network parameter; S35, Order , , is the third layer fully connected network parameter; S36, Order , , is the fourth layer fully connected network parameter; S37, Order , , is the fifth layer fully connected network parameter; S38, Order , is the intermediate vector representation length, is the intermediate vector representation length, , hash encoding is performed on the intermediate vector representation. The specific steps are shown in S381-S383: S381, if ,make , otherwise let ;in, for of Bit, for The mean of all bits of ; S382, if ,make , otherwise let ; S383, if ,but , jump to S381; otherwise end, jump to S39; S39, calculation and Hamming distance and its similarities ; S310, calculate cross entropy loss and back propagate updated parameters; S311, if ,but , jump to S33; otherwise if ,but , jump to S32; otherwise end and get the deep hash network , jump to S312; S312. Calculate the knowledge vector library The hash vectors of all knowledge vectors in the hash knowledge base are obtained , the specific steps are shown in S3121-S3125: S3121, Order , ; S3122, Order ; S3123, Order and add it to In the meantime, save Index and , where information represents the index of the archive text, Represents the index of the text block; S3124, if ,but , jump to S3123; otherwise jump to S3125; S3125, if ,but , jump to S3122; otherwise end and return to the hash knowledge base and Deep Hashing Network .

8. The intelligent question-answering method for digital archive data according to claim 7, characterized in that: In S4, based on the deep hash coding of the knowledge vector, the QWEN large language model is used to vectorize the questions raised by the user. And further convert it into a hash vector that retains semantic information based on the deep hash network , traverse the hash knowledge base All hash vectors in the , and calculate the hash similarity between the knowledge vector and the question vector based on the Hamming distance between the hash vectors, and then sort them according to the similarity to get the top ranking A collection of hash vectors , and get its index information at the same time , and through the index in the knowledge vector library Retrieve the corresponding knowledge vector set ; for the set The knowledge vectors in the corresponding text are matched and filtered with the user permissions to obtain the set ; Further represent the vector of the question raised by the user and The knowledge vectors in the dataset are calculated similarly and re-ranked according to semantic similarity to ensure the relevance and correctness of the answers.

9. The intelligent question-answering method for digital archive data according to claim 7, wherein: The S4 specifically includes: S41. Using the QWEN large language model Calculate user questions Vector representation of , and using deep hashing networks get Hash vector of ,make Representing hash knowledge base The number of hash vectors in , and calculate and The similarity of the hash vector in , and the similarity vector , the specific steps are shown in S411-S416: S411, Order , ; S412, Order ; S413, calculation and Hamming distance and its similarities ; S414, Order ; S415, if ,but , jump to S413; otherwise jump to S416; S416, if ,but , jump to S412; otherwise jump to S42; S42, yes Sort from large to small and get the top ranking A collection of hash vectors , get its index information , and through the index in the knowledge vector library Retrieve the corresponding knowledge vector set , the specific steps are shown in S421-S425: S421, yes Sort from largest to smallest ; S422, get the top ranking A collection of hash vectors ; S423, get the top ranking A collection of hash vectors Corresponding Middle Index ; S424, from the knowledge vector library Retrieve the corresponding knowledge vector set ; S425, return and , jump to S43; S43, pair set The knowledge vectors in the corresponding text are matched and filtered with the user permissions to obtain the set ; S44, pair set The knowledge vector in the vector representation of the question raised by the user Calculate similarity and re-rank. The specific steps are shown in S441-S443: S441, Order , , for The number of knowledge vectors in ; S442, Order ,in is the similarity vector The position index of S443, if ,but , jump to S442; otherwise jump to S45; S45, yes Sort by order from largest to smallest , corresponding index , and the original text chunks { }, and return .

10. The intelligent question-answering method for digital archive data according to claim 9, characterized in that: The S5 includes: a prompt word template: "You are a senior archive expert, familiar with all the document contents in the archive, and have rich experience in archive utilization; the user will ask you some questions about the archive utilization process or archive documents. Please answer with concise and professional sentences based on the known information and user permissions, and provide the known information sources referenced in the process of generating the answer; if the answer cannot be found from the known information, please say "The question cannot be answered based on the known information" and you are not allowed to make up the answer; Question: {user input}; Known information: {original text blocks retrieved from the knowledge base}".

Citation Information

Patent Citations

  • Deep hash image retrieval method fusing semantic information and multi-level similarity

    CN109977250A

  • Cross-modal deep hash retrieval method based on self-supervision

    CN110309331A

  • Deep hash retrieval method and device and medium

    CN111522903A

  • Universal cross-modal retrieval model based on deep hash

    CN113076465A

  • Data integration method based on knowledge graph

    CN118333059A