Word document processing method and system based on DNA genetic model
The Word document processing method based on the DNA genetic model solves the problems of inflexible homogenization determination and recombination, and realizes efficient and intelligent document generation and quality assessment, thereby improving the efficiency and quality of document generation.
Patent Information
- Application Number
- CN202511021637.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing Word document processing technologies lack an effective homogenization judgment mechanism, making it difficult to identify documents with similar structures and content. The reorganization methods are not flexible enough, and there is a lack of a scientific evaluation system, resulting in low document generation efficiency and inconsistent quality.
Using a DNA genetic model-based approach, document homogenization is determined by pre-defined rules, and the documents are broken down into A-strands and B-strands for mutation processing. Document quality is then evaluated based on a fitness function, including document download volume and user ratings, and high-quality documents are selected for inclusion in the resource pool.
It has improved the efficiency and quality of document generation, enhanced the diversity and innovation of documents, and achieved continuous optimization and efficient utilization of document resources.
Smart Images

Figure CN120910003A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of document processing, in particular to a Word document processing method and system based on a DNA genetic model. BACKGROUND
[0002] As one of the most commonly used document formats, Word documents are widely used in academic, business and daily office fields. However, with the explosive growth of the number of documents, how to efficiently generate high-quality Word documents and how to innovatively reorganize based on existing document resources have become important research directions in the current document processing field.
[0003] Traditional document processing methods mainly rely on manual editing and simple template application, which is inefficient and difficult to meet the needs of large-scale document generation. In recent years, automatic document generation methods based on machine learning and natural language processing technology have developed to some extent, but these methods often lack deep understanding of document structure and content, and the quality of generated documents is uneven. Some researchers try to apply the genetic algorithm idea in biology to the field of document processing, hoping to simulate the biological evolution process to realize the automatic generation and optimization of documents.
[0004] The main problems existing in the current document processing technology include: first, there is a lack of effective document homogenization judgment mechanism, and the existing technology cannot accurately identify documents with similar structure and content, which may select inappropriate documents for genetic operation in the document reorganization process; second, the existing document reorganization method usually adopts simple content splicing or replacement, without considering the hierarchy and logic of document structure, especially the processing of key structural elements such as title blocks is not flexible enough; finally, there is a lack of a scientific evaluation system to measure the quality of generated documents, which cannot effectively filter out high-quality documents and add them to the resource pool, affecting the continuous optimization and iterative update of document resources. SUMMARY
[0005] The embodiments of the present application provide a Word document processing method and system based on a DNA genetic model, which can solve the problems in the prior art.
[0006] In a first aspect, the embodiments of the present application provide a Word document processing method based on a DNA genetic model, comprising:
[0007] Homogenization judgment is performed on two base Word documents based on a preset rule, the preset rule including calculating the ratio of the intersection and union of the feature sets of the two base Word documents, and determining that the two base Word documents are homogenized when the ratio is greater than a preset set threshold value;
[0008] According to the homogenized document, the two base Word documents are respectively disassembled into A chains and B chains, and the title blocks in the A chains and the B chains are subjected to mutation processing, the mutation processing including randomly adjusting the positions of the title blocks according to a preset mutation probability;
[0009] The A chain of the first base Word document is recombined with the B chain of the second base Word document to form a first sub-document, and the A chain of the second base Word document is recombined with the B chain of the first base Word document to form a second sub-document;
[0010] The first sub-document and the second sub-document are evaluated based on an adaptive function, and the adaptive function takes the document download volume and a recommendation index as evaluation parameters, the recommendation index being the arithmetic mean of the document scores of a user group;
[0011] The sub-document with an evaluation result of the adaptive function higher than a preset evaluation threshold is added to a base Word document resource pool for subsequent document genetic processing.
[0012] The two base Word documents are subjected to homogenization determination based on a preset rule, the preset rule including calculating the ratio of the intersection to the union of the feature sets of the two base Word documents, and determining that the two base Word documents are homogenized documents when the ratio is greater than a preset set threshold, including:
[0013] The feature sets of the first document and the second document are constructed, and the feature sets include hierarchical title structure feature vectors, word frequency statistics features, document theme semantic features, and text paragraph structure features of the first document and the second document;
[0014] The similarity of the feature sets of the first document and the second document is calculated based on a Jaccard coefficient, and the similarity is obtained by the ratio of the intersection cardinality to the union cardinality of the feature sets of the first document and the second document;
[0015] The similarity of each feature dimension of the first document and the second document is multiplied by the corresponding weight coefficient, and the sum of the products is divided by the sum of the weight coefficients to obtain a weighted similarity;
[0016] The weighted similarity is determined based on a preset determination threshold, and when the weighted similarity is greater than or equal to the preset determination threshold, the first document and the second document are determined to be homogenized documents.
[0017] According to the homogenized document, the two base Word documents are respectively disassembled into A chains and B chains, and the title blocks in the A chains and the B chains are subjected to mutation processing, the mutation processing including randomly adjusting the positions of the title blocks according to a preset mutation probability;
[0018] obtaining a title block sequence in a Word document, the title block sequence comprising a plurality of title blocks, each of the title blocks comprising a title and content corresponding to the title;
[0019] splitting the title block sequence into an A chain and a B chain according to an odd-even position relationship, the A chain comprising title blocks at odd positions in the title block sequence, and the B chain comprising title blocks at even positions in the title block sequence;
[0020] performing mutation processing on the title blocks in the A chain and the B chain based on a preset mutation probability, the mutation processing including position mutation and structure mutation, wherein the position mutation is achieved by performing position exchange on adjacent title blocks in the A chain or the B chain, and the structure mutation is achieved by adjusting a hierarchical relationship of the title blocks;
[0021] when a randomly generated mutation trigger value is less than the preset mutation probability, performing the mutation processing on the title blocks.
[0022] recombining the A chain of a first base Word document with the B chain of a second base Word document to form a first sub-document, and recombining the A chain of the second base Word document with the B chain of the first base Word document to form a second sub-document, comprising:
[0023] obtaining a first base document and a second base document, the first base document comprising a first A chain and a first B chain, and the second base document comprising a second A chain and a second B chain, wherein the first A chain and the first B chain comprise title blocks at odd positions and even positions in the first base document respectively, and the second A chain and the second B chain comprise title blocks at odd positions and even positions in the second base document respectively;
[0024] recombining and matching the first A chain of the first base document with the second B chain of the second base document to form a first sub-document, the first sub-document sequentially arranging the title blocks according to an order of the title blocks in the first A chain and an order of the title blocks in the second B chain;
[0025] recombining and matching the second A chain of the second base document with the first B chain of the first base document to form a second sub-document.
[0026] evaluating the first sub-document and the second sub-document based on an adaptive function, the adaptive function taking a document download amount and a recommendation index as evaluation parameters, the recommendation index being an arithmetic mean of scores of the document given by a user group, comprising:
[0027] The download amounts of the first sub-document and the second sub-document are normalized by dividing the download amounts of the first sub-document and the second sub-document by historical maximum download amounts respectively to obtain normalized download amounts;
[0028] A recommendation index of the first sub-document and the second sub-document is calculated by dividing the sum of user scores by the number of users participating in scoring;
[0029] The first sub-document and the second sub-document are evaluated based on an adaptive function, and the normalized download amount and the recommendation index are weighted according to the adaptive function, wherein the sum of the weight coefficients of the normalized download amount and the weight coefficients of the recommendation index is one;
[0030] An arithmetic mean of the first sub-document and the second sub-document is obtained according to the calculation result of the adaptive function.
[0031] The first sub-document and the second sub-document are evaluated based on an adaptive function, and the normalized download amount and the recommendation index are weighted according to the adaptive function, wherein the sum of the weight coefficients of the normalized download amount and the weight coefficients of the recommendation index is one;
[0032] The first sub-document and the second sub-document are evaluated based on an adaptive function, and the normalized download amount and the recommendation index are weighted according to the adaptive function, wherein the sum of the weight coefficients of the normalized download amount and the weight coefficients of the recommendation index is one;
[0033] The second aspect of the embodiment of the application provides a Word document processing system based on a DNA genetic model, comprising:
[0034] A first unit is configured to determine homogeneity of two base Word documents based on a preset rule, wherein the preset rule comprises calculating a ratio of an intersection and a union of a feature set of the two base Word documents, and determining the two base Word documents as homogenized documents when the ratio is greater than a preset set threshold value;
[0035] A second unit is configured to respectively split the two base Word documents into A chains and B chains according to the homogenized documents, and perform mutation processing on title blocks in the A chains and the B chains, wherein the mutation processing comprises randomly adjusting positions of the title blocks according to a preset mutation probability;
[0036] A third unit is configured to recombine an A chain of a first base Word document with a B chain of a second base Word document to form a first sub-document, and recombine an A chain of the second base Word document with a B chain of the first base Word document to form a second sub-document;
[0037] a fourth unit configured to evaluate the first sub-document and the second sub-document based on an adaptability function, wherein the adaptability function takes the number of document downloads and a recommendation index as evaluation parameters, and the recommendation index is an arithmetic mean of scores of the document given by a user group;
[0038] a fifth unit configured to add the sub-document whose evaluation result of the adaptability function is higher than a preset evaluation threshold to a base Word document resource pool for subsequent document genetic processing.
[0039] In a third aspect, the embodiment of the present application provides an electronic device, comprising:
[0040] a processor;
[0041] a memory configured to store processor-executable instructions;
[0042] The processor is configured to invoke the instructions stored in the memory to execute the method described above.
[0043] In a fourth aspect, the embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method described above.
[0044] The present application has the following beneficial effects:
[0045] The present application processes the Word document by introducing the DNA genetic model method, so that the document generation process is more intelligent and automated, and the efficiency and quality of document creation are effectively improved.
[0046] The present application adopts preset rules to determine homogeneity, and performs chain disassembly and variation recombination on the document, simulates the process of biological DNA replication and variation, so that the generated sub-document not only retains the core features of the original document, but also has new innovative points, and the diversity and innovation of the document are enhanced.
[0047] The present application introduces an adaptability function evaluation mechanism, takes user feedback data as an evaluation parameter, so that the high-quality documents screened can better meet the user demand, and continuously iterates and updates the base Word document resource pool, so that the quality of the document is continuously optimized and the resources are efficiently utilized. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 FIG. 1 is a flowchart of a Word document processing method based on a DNA genetic model according to an embodiment of the present application;
[0049] Figure 2 FIG. 4 is a software architecture diagram of a novel software security detection platform according to an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0051] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.
[0052] Figure 1 The flowchart of the Word document processing method based on the DNA genetic model of the embodiments of the present application is shown in FIG. 1, which includes the following steps. Figure 1 The method includes the following steps.
[0053] Homogenization determination is performed on the two base Word documents based on preset rules, the preset rules including calculating the ratio of the intersection and the union of the feature sets of the two base Word documents, and determining that the two base Word documents are homogenized documents when the ratio is greater than a preset set threshold value.
[0054] The two base Word documents are respectively disassembled into A chains and B chains according to the homogenized documents, and mutation processing is performed on the title blocks in the A chains and the B chains, the mutation processing including randomly adjusting the positions of the title blocks according to a preset mutation probability.
[0055] The A chain of the first base Word document is recombined with the B chain of the second base Word document to form a first sub-document, and the A chain of the second base Word document is recombined with the B chain of the first base Word document to form a second sub-document.
[0056] The first sub-document and the second sub-document are evaluated based on an adaptive function, and the download quantity and the recommendation index of the documents are taken as evaluation parameters based on the adaptive function, the recommendation index being the arithmetic mean of the scores of the documents given by a user group.
[0057] The sub-documents with evaluation results of the adaptive function higher than a preset evaluation threshold value are added to a base Word document resource pool for subsequent genetic processing of the documents.
[0058] In an optional embodiment, homogenization determination is performed on the two base Word documents based on preset rules, the preset rules including calculating the ratio of the intersection and the union of the feature sets of the two base Word documents, and determining that the two base Word documents are homogenized documents when the ratio is greater than a preset set threshold value, including the following steps.
[0059] constructing a feature set of the first document and the second document, the feature set comprising a hierarchical title structure feature vector, a word frequency statistics feature, a document topic semantic feature, and a text paragraph structure feature of the first document and the second document;
[0060] calculating a similarity of the feature set of the first document and the second document based on a Jaccard coefficient, the similarity being obtained by a ratio of an intersection cardinality to a union cardinality of the feature set of the first document and the second document;
[0061] multiplying the similarity of each feature dimension of the first document and the second document by a corresponding weight coefficient, and dividing a sum of the products by a sum of the weight coefficients to obtain a weighted similarity;
[0062] judging the weighted similarity based on a preset judgment threshold, and determining that the first document and the second document are homogenized documents when the weighted similarity is greater than or equal to the preset judgment threshold.
[0063] constructing a feature set of the first document and the second document to be compared. The feature set comprises four dimensions: a hierarchical title structure feature vector, a word frequency statistics feature, a document topic semantic feature, and a text paragraph structure feature.
[0064] For the hierarchical title structure feature vector, the system extracts all the titles and their hierarchical relationships in the document. For example, the first document contains a first-level title "Research Background", second-level titles "Domestic Research Status" and "Foreign Research Status", and third-level titles "Research Progress in the Past Five Years", etc. The second document contains a first-level title "Research Background and Significance", second-level titles "Domestic and Foreign Research Status" and "Theoretical Basis", etc. The system converts these titles and their hierarchical structures into feature vectors for subsequent comparison.
[0065] The word frequency statistics feature is obtained by calculating the high-frequency words in the document and their frequencies. The system first performs word segmentation on the document and counts the word frequency after filtering out stop words. For example, in the first document, "algorithm" appears 35 times, "model" appears 28 times, and "data" appears 42 times; in the second document, "algorithm" appears 32 times, "model" appears 30 times, and "method" appears 25 times. The system constructs a feature vector from this word frequency information.
[0066] Document topic semantic features are extracted by topic modeling. The system uses topic modeling to analyze document content, identify latent topics, and compute topic distributions. For example, the first document has a topic distribution of: technical research (0.35), data analysis (0.25), algorithm implementation (0.2), application scenarios (0.15), and future prospects (0.05); the second document has a topic distribution of: technical research (0.3), algorithm implementation (0.25), data analysis (0.2), system design (0.15), and application scenarios (0.1).
[0067] Text paragraph structure features are obtained by analyzing the number of paragraphs, average length, and connection between paragraphs in a document. For example, the first document contains 25 paragraphs, with an average of 150 characters per paragraph, and 15 transition words between paragraphs; the second document contains 22 paragraphs, with an average of 160 characters per paragraph, and 12 transition words between paragraphs.
[0068] After constructing the feature set, the system calculates the similarity of the feature sets of the two documents based on the Jaccard coefficient. The Jaccard coefficient measures similarity by calculating the ratio of the intersection cardinality to the union cardinality of two sets. Specifically, let the feature set of the first document be A and the feature set of the second document be B, then the similarity is calculated as the number of elements in the intersection A∩B divided by the number of elements in the union A∪B.
[0069] Taking the hierarchical title structure as an example, suppose the title structure feature sets of the first document and the second document are A title and B title , respectively. A title contains elements {"Research Background", "Current Research Status in China", "Current Research Status Abroad", "Research Progress in the Past Five Years", etc.}, and B title contains elements {"Research Background and Significance", "Current Research Status at Home and Abroad", "Theoretical Basis", etc.}. Through analysis, the system identifies the intersection elements as {"Research Background", "Research Status"}, with an intersection cardinality of 2; the union cardinality is 7. Therefore, the Jaccard similarity of the title structure is 2 / 7, approximately equal to 0.286.
[0070] The Jaccard similarity of the word frequency statistics feature, the document topic semantic feature, and the text paragraph structure feature is calculated. Suppose the results are: word frequency statistics feature similarity 0.65, document topic semantic feature similarity 0.72, and text paragraph structure feature similarity 0.58.
[0071] The similarity of each feature dimension is multiplied by the corresponding weight coefficient, and the sum of the products is divided by the sum of the weight coefficients to obtain a weighted similarity. In this embodiment, the weight coefficients of the four feature dimensions are set as follows: 0.3 for the hierarchical title structure feature, 0.25 for the word frequency statistical feature, 0.3 for the document topic semantic feature, and 0.15 for the text paragraph structure feature.
[0072] The weighted similarity calculation process is: (0.286 x 0.3 + 0.65 x 0.25 + 0.72 x 0.3 + 0.58 x 0.15) ÷ (0.3 + 0.25 + 0.3 + 0.15) = 0.5573.
[0073] The weighted similarity is determined based on a preset determination threshold. In this embodiment, the preset determination threshold is set to 0.6. Since the calculated weighted similarity is 0.5573, which is less than the preset determination threshold 0.6, the system determines that the first document and the second document do not constitute homogeneous documents.
[0074] In another example, assume that the Jaccard similarity of the four feature dimensions of the third document and the fourth document are: 0.75 for the hierarchical title structure feature, 0.68 for the word frequency statistical feature, 0.82 for the document topic semantic feature, and 0.7 for the text paragraph structure feature. Using the same weight coefficients, the weighted similarity is calculated as: (0.75 x 0.3 + 0.68 x 0.25 + 0.82 x 0.3 + 0.7 x 0.15) ÷ (0.3 + 0.25 + 0.3 + 0.15) = 0.7465. Since the weighted similarity 0.7465 is greater than the preset determination threshold 0.6, the system determines that the third document and the fourth document are homogeneous documents.
[0075] Through the above determination method, the system can effectively identify the degree of homogeneity between documents, providing strong support for document duplication detection, plagiarism detection, and content review. This method considers both the structural features and content features of the documents, which can more comprehensively reflect the similarity between documents and improve the accuracy and reliability of homogeneity determination.
[0076] In an optional implementation, the two base Word documents are respectively disassembled into A chains and B chains according to the homogeneous documents, and the title block in the A chain and the B chain is subjected to variation processing, which includes:
[0077] Obtaining a title block sequence in a Word document, the title block sequence comprising a plurality of title blocks, each title block comprising a title and content corresponding to the title;
[0078] splitting the title block sequence into an A chain and a B chain according to odd-even position relationship, the A chain containing title blocks at odd positions in the title block sequence, and the B chain containing title blocks at even positions in the title block sequence;
[0079] performing mutation processing on the title blocks in the A chain and the B chain based on a preset mutation probability, the mutation processing including position mutation and structure mutation, wherein the position mutation is implemented by performing position exchange on adjacent title blocks in the A chain or the B chain, and the structure mutation is implemented by adjusting the hierarchical relationship of the title blocks;
[0080] performing the mutation processing on the title blocks when a randomly generated mutation trigger value is less than the preset mutation probability.
[0081] When obtaining the title block sequence of two base Word documents, the document parsing module reads the titles and their corresponding contents in the documents. Each title block in the title block sequence contains a title text, a title level, title position information, and corresponding body content under the title. Taking a certain base Word document as an example, its title block sequence contains six title blocks: title block 1 is "document evaluation method", the title level is level 1; title block 2 is "evaluation parameter acquisition", the title level is level 2; title block 3 is "parameter standardization", the title level is level 2; title block 4 is "weight calculation", the title level is level 2; title block 5 is "evaluation execution", the title level is level 2; and title block 6 is "result output", the title level is level 2.
[0082] When splitting the title block sequence into an A chain and a B chain, the titles are divided according to odd-even positions in the sequence. For the above example, title block 1, title block 3, and title block 5 are divided into the A chain, and title block 2, title block 4, and title block 6 are divided into the B chain. Through this splitting method, the number of title blocks in the A chain and the B chain is close, and the adjacent title blocks have a reasonable hierarchical relationship.
[0083] In the mutation processing process, the preset mutation probability is set to 0.3. For each title block, a random number between 0 and 1 is generated as a mutation trigger value. When the random number is less than 0.3, the mutation processing is triggered. The mutation processing includes two ways of position mutation and structure mutation.
[0084] The specific implementation of the position mutation is to exchange the positions of adjacent title blocks in the same chain. Taking the A chain as an example, when title block 1 triggers mutation, it is exchanged with title block 3. After the exchange, it is checked whether the hierarchical relationship between the title blocks is reasonable, and if not, the exchange operation is rolled back.
[0085] The structural variation is achieved by adjusting the hierarchical relationship of the title blocks. When a title block triggers the structural variation, it can be promoted or demoted by one level. Taking the title block 2 in the B chain as an example, which is originally a second-level title, it can be adjusted to a first-level title or a third-level title through the structural variation. When adjusting, it is necessary to ensure that the hierarchical relationship after the variation meets the document structure specification.
[0086] In actual application, a document is subjected to variation processing, a title sequence containing 6 title blocks is obtained, and the title sequence is split into the A chain and the B chain each containing 3 title blocks. Then a random number is generated for each title block. Assuming that the random number generated by the title block 1 is 0.25, which is less than the preset variation probability 0.3, the variation processing is triggered. The title block 1 and the title block 3 are interchanged in position through the position variation, and it is found that the hierarchical relationship is reasonable after the interchanging, so the variation result is retained. The random number generated by the title block 2 is 0.35, which is greater than the preset variation probability, so the variation processing is not performed. All the title blocks are processed in this way, and finally the A chain and the B chain subjected to the variation processing are obtained.
[0087] In an alternative embodiment, recombining the A chain of the first base Word document with the B chain of the second base Word document to form a first sub-document and recombining the A chain of the second base Word document with the B chain of the first base Word document to form a second sub-document comprises:
[0088] obtaining a first base document and a second base document, the first base document comprising a first A chain and a first B chain, and the second base document comprising a second A chain and a second B chain, wherein the first A chain and the first B chain contain title blocks at odd positions and even positions in the first base document respectively, and the second A chain and the second B chain contain title blocks at odd positions and even positions in the second base document respectively;
[0089] recombining and matching the first A chain of the first base document with the second B chain of the second base document to form a first sub-document, the first sub-document sequentially arranging the title blocks according to the order of the title blocks in the first A chain and the order of the title blocks in the second B chain;
[0090] recombining and matching the second A chain of the second base document with the first B chain of the first base document to form a second sub-document.
[0091] Two base Word documents, namely a first base document and a second base document, are obtained. The first base document contains a first A-chain and a first B-chain, and the second base document contains a second A-chain and a second B-chain. Here, the first A-chain contains the title blocks in the first base document that are located at odd positions, such as the title blocks at positions 1, 3, 5, etc., and the first B-chain contains the title blocks in the first base document that are located at even positions, such as the title blocks at positions 2, 4, 6, etc. Similarly, the second A-chain contains the title blocks in the second base document that are located at odd positions, and the second B-chain contains the title blocks in the second base document that are located at even positions.
[0092] For the sake of illustration, assume that the first base document contains the sequence of title blocks: "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6". According to the rule of dividing by odd and even positions, the first A-chain will contain {"Title 1", "Title 3", "Title 5"}, and the first B-chain will contain {"Title 2", "Title 4", "Title 6"}. Similarly, assume that the second base document contains the sequence of title blocks: "Title A", "Title B", "Title C", "Title D", "Title E", "Title F". Then the second A-chain will contain {"Title A", "Title C", "Title E"}, and the second B-chain will contain {"Title B", "Title D", "Title F"}.
[0093] After obtaining the two base documents and their A-chains and B-chains, the system begins to perform the recombination matching process. The first step of recombination matching is to combine the first A-chain of the first base document with the second B-chain of the second base document to form a first sub-document. The specific implementation of this step is to arrange the title blocks in the first A-chain and the title blocks in the second B-chain in the first sub-document in the original order of the title blocks in the first A-chain and the original order of the title blocks in the second B-chain, respectively.
[0094] Taking the above example data as an example, the first sub-document will contain the following sequence of title blocks: {"Title 1", "Title 3", "Title 5", "Title B", "Title D", "Title F"}. Here, the first three title blocks come from the first A-chain, maintaining their relative order in the first base document; the last three title blocks come from the second B-chain, also maintaining their relative order in the second base document.
[0095] The second step of recombination matching is to combine the second A-chain of the second base document with the first B-chain of the first base document to form a second sub-document. Similarly, the specific implementation of this step is to arrange the title blocks in the second A-chain and the title blocks in the first B-chain in the second sub-document in the original order of the title blocks in the second A-chain and the original order of the title blocks in the first B-chain, respectively.
[0096] Using the example data above, the second sub-document would contain the following sequence of header blocks: {"Header A", "Header C", "Header E", "Header 2", "Header 4", "Header 6"}. The first three header blocks come from the second A chain, maintaining their relative order in the second base document; the last three header blocks come from the first B chain, similarly maintaining their relative order in the first base document.
[0097] In practical applications, a header block not only contains the header text, but also possibly related content paragraphs, figures, lists, and other elements. The reorganization process needs to ensure that these elements are correctly transferred to the new sub-document along with their corresponding header block. To this end, the system, when processing a header block, will also process all content elements under the header block, maintaining their hierarchical relationships and format styles.
[0098] When performing the reorganization operation, the system also needs to consider the hierarchical structure of the header blocks. For example, if "Header 3" in the first base document is a subheader of "Header 1", then when forming the first sub-document, this hierarchical relationship needs to be maintained. This can be achieved by analyzing the indentation levels of the header blocks or using the outline level properties in a Word document.
[0099] An important advantage of this method is the ability to generate documents with new structures while maintaining the internal structure and content integrity of the header blocks in the original documents. This is very useful for scenarios that require creating new document templates based on existing documents, integrating the content of multiple documents, or generating different document variants.
[0100] Through the above method, four different combinations of two base documents can be achieved: the first A chain with the second A chain, the first A chain with the second B chain, the second A chain with the first B chain, and the first B chain with the second B chain. This embodiment describes in detail the implementation method of two of these combinations, namely the first A chain and the second B chain combination to form the first sub-document, and the second A chain and the first B chain combination to form the second sub-document. Other combinations can be implemented in a similar manner.
[0101] In an optional implementation, the first sub-document and the second sub-document are evaluated based on an adaptability function, and the document download volume and a recommendation index are used as evaluation parameters based on the adaptability function, and the recommendation index is the arithmetic mean of the user group's score for the document, including:
[0102] The download volumes of the first sub-document and the second sub-document are standardized by dividing the download volumes of the first sub-document and the second sub-document by the historical maximum download volume, respectively, to obtain the standardized download volume;
[0103] The recommendation index of the first sub-document and the second sub-document is calculated, and the recommendation index is obtained by dividing the sum of the user scores by the number of users participating in the scoring.
[0104] The first sub-document and the second sub-document are evaluated based on an adaptive function, and the normalized download quantity and the recommendation index are weighted according to the adaptive function, wherein the sum of the weight coefficient of the normalized download quantity and the weight coefficient of the recommendation index is one.
[0105] An arithmetic mean of the first sub-document and the second sub-document is obtained according to the calculation result of the adaptive function.
[0106] A user query is received, and relevant documents are retrieved according to the query content. The retrieval returns a result containing multiple documents, and the system needs to decompose and evaluate these documents. Taking a technical article returned by the retrieval as an example, the system decomposes the article into a first sub-document and a second sub-document. The first sub-document is the first half of the technical article, containing basic concepts and principle introduction; and the second sub-document is the second half of the technical article, containing practical application and case analysis.
[0107] When evaluating the first sub-document and the second sub-document, the system adopts an adaptive function, which takes the download quantity and the recommendation index of the document as evaluation parameters. The specific evaluation process includes the following steps:
[0108] The download quantities of the first sub-document and the second sub-document are standardized. Assuming that the download quantity of the first sub-document is 1500 times, the download quantity of the second sub-document is 2000 times, and the historical maximum download quantity recorded by the system is 5000 times. The system divides the download quantity of the first sub-document by the historical maximum download quantity to obtain a standardized download quantity of 0.3; similarly, the standardized download quantity of the second sub-document is 0.4. This standardization enables documents of different download quantity levels to be compared on the same scale.
[0109] The recommendation index of the first sub-document and the second sub-document is calculated. Assuming that the first sub-document has received ratings from 20 users, and the total rating sum is 86, the system divides the total rating sum by the number of users participating in the rating to obtain a recommendation index of 4.3; the second sub-document has received ratings from 30 users, and the total rating sum is 123, and the recommendation index is calculated to be 4.1. The recommendation index reflects the overall evaluation of the user group on the content quality of the document.
[0110] The first sub-document and the second sub-document are evaluated based on an adaptive function. The adaptive function calculates a weighted sum of the normalized download amount and the recommendation index, where the sum of the weight coefficients of the normalized download amount and the weight coefficient of the recommendation index is one. In this example, the system sets the weight coefficient of the normalized download amount to 0.4 and the weight coefficient of the recommendation index to 0.6. For the first sub-document, the adaptive function calculates a result of 0.4 x 0.3 + 0.6 x 4.3 = 2.7; for the second sub-document, the adaptive function calculates a result of 0.4 x 0.4 + 0.6 x 4.1 = 2.62.
[0111] The arithmetic mean of the first sub-document and the second sub-document is obtained according to the calculation result of the adaptive function. The evaluation result of the first sub-document 2.7 is added to the evaluation result of the second sub-document 2.62 and divided by 2, obtaining an arithmetic mean of 2.66. This arithmetic mean represents the comprehensive evaluation result of the entire document.
[0112] In practical applications, the weight coefficients can be dynamically adjusted according to different application scenarios. For example, in an educational resource platform, the recommendation index may be more important, and the weight coefficient can be set to 0.7 or higher; while in a professional technical paper library, the download amount may better reflect the value of the document, and the weight coefficient of the download amount can be increased.
[0113] An evaluation threshold can also be set. If the arithmetic mean exceeds the preset threshold, such as 2.5, the document is marked as a high-quality document. In this example, the calculated arithmetic mean is 2.66, which exceeds the threshold of 2.5, so the document is marked as a high-quality document.
[0114] To improve evaluation accuracy, the system regularly updates the historical maximum download amount. For example, the download situation of all documents is counted once a month, and if a new maximum download amount record is found, the historical maximum download amount value is updated to ensure the accuracy of the standardization process.
[0115] The system monitors user scoring behavior to prevent score cheating. For example, if the same user scores multiple documents with the same score within a short period of time, or if the score distribution is found to be abnormally concentrated, the system will mark these scores as suspicious scores and not count them in the recommendation index calculation. For example, a document suddenly receives 50 full marks in one hour, and the scores come from similar IP addresses, the system will mark these scores as suspicious scores.
[0116] Through the above evaluation method, the system can objectively evaluate the quality of the document and sort or recommend the document based on the evaluation result. For example, when a user searches for "artificial intelligence introduction" related content, the system will preferentially display documents with higher evaluation scores, improving user experience. At the same time, this evaluation method also provides an improvement direction for content creators, encouraging the creation of more popular high-quality content among users.
[0117] In an alternative embodiment, the first sub-document and the second sub-document are evaluated based on an adaptability function, and the weighting calculation of the normalized download volume and the recommendation index according to the adaptability function comprises:
[0118] The first sub-document and the second sub-document are evaluated based on an adaptability function respectively, and the adaptability function multiplies the normalized download volume by a first weight coefficient, multiplies the recommendation index by a second weight coefficient, and adds the two products to obtain an adaptability score.
[0119] In a document evaluation system, an adaptability function is used to evaluate a first sub-document and a second sub-document, which generates an adaptability score by weighting calculation of a normalized download volume and a recommendation index. The system first obtains the normalized download volume and the recommendation index of the first sub-document and the second sub-document. The normalized download volume reflects the popularity of the document and is obtained by dividing the original download count by the document publishing time, which can eliminate the influence of the difference in publishing time on the download volume. The recommendation index is calculated based on user evaluation and feedback of the document, reflecting the quality and practicality of the document.
[0120] The core of the adaptability function is the weighting calculation process. The system assigns a first weight coefficient to the normalized download volume and a second weight coefficient to the recommendation index. In practical applications, the first weight coefficient can be set to 0.6 and the second weight coefficient can be set to 0.4, which reflects that the relative importance of the download volume in evaluation is slightly higher than that of the user recommendation. For the first sub-document, assuming that its normalized download volume is 85 (i.e., an average of 85 downloads per day) and the recommendation index is 92 (full score 100), the adaptability score is calculated as: 85×0.6+92×0.4=87.8. Similarly, for the second sub-document, if its normalized download volume is 70 and the recommendation index is 95, the adaptability score is: 70×0.6+95×0.4=80.0. By comparing the adaptability scores of the two sub-documents, the system can determine that the first sub-document has a higher comprehensive evaluation.
[0121] The setting of the weight coefficients can be adjusted according to specific application scenarios. In a technical document platform, if users pay more attention to the practicality and accuracy of the document, the weight of the recommendation index can be increased; if in an entertainment content platform, the download volume can better reflect the popularity of the content, the weight of the normalized download volume can be increased. For example, the technical document platform can adjust the first weight coefficient to 0.4 and the second weight coefficient to 0.6; while the entertainment content platform can set the first weight coefficient to 0.7 and the second weight coefficient to 0.3.
[0122] An adaptive mechanism can also be introduced to dynamically adjust the weight coefficients based on the document type. For educational documents, the system can detect their content characteristics and automatically increase the second weight coefficient to 0.55 and decrease the first weight coefficient to 0.45, giving more weight to user evaluations of educational quality. Taking a programming tutorial as an example, if its standardized download volume is 60 and the recommendation index is 98, the adaptive score is: 60 x 0.45 + 98 x 0.55 = 80.9. This dynamic adjustment makes the evaluation more accurately reflect the characteristics of different types of documents.
[0123] To handle exceptional cases, the system also checks the validity of the standardized download volume and the recommendation index. If the standardized download volume of a certain document is abnormally high (e.g. more than 300% of the historical average), the system will perform outlier processing, possibly using truncation or smoothing methods to adjust the value. Similarly, if the recommendation index is based on too few samples (e.g. less than 10 user evaluations), the system will reduce its weight in the calculation. For example, for a document with only 5 user evaluations but a high score (recommendation index 95), the system may reduce the second weight coefficient from 0.4 to 0.2 and increase the first weight coefficient to 0.8 accordingly.
[0124] In certain cases, the system also considers the impact of time factors. For newly released documents, the standardized download volume may not be sufficient to reflect its true value, so the system will increase the weight of the recommendation index. For example, for documents released less than 7 days, the second weight coefficient can be temporarily adjusted to 0.6 and the first weight coefficient to 0.4. Assuming a new document has a standardized download volume of 30 and a recommendation index of 90, the temporary adaptive score is: 30 x 0.4 + 90 x 0.6 = 66.0, which is higher than the score 54.0 calculated using the standard weight, giving the new document a more fair evaluation.
[0125] The adaptive function can also integrate seasonal factors. Some documents may have a surge in downloads during certain periods (e.g. tax-related documents during tax season), and the system will identify this pattern and adjust the weights accordingly. During these peak periods, the system may temporarily reduce the first weight coefficient to 0.5 to reduce the impact of seasonal fluctuations.
[0126] The scores calculated by the adaptive function are used to rank and recommend documents. Documents with higher adaptive scores will have higher display priority, increasing their chances of being discovered by users. In addition, the system will regularly review historical evaluation results to analyze the effectiveness of weight coefficients and make adjustments based on changes in user behavior and platform development, ensuring continuous optimization of the evaluation mechanism. Through this adaptive function that considers both download volume and user recommendations, the system can more accurately identify high-value documents, improving user experience and platform content quality.
[0127] For example, Figure 2As shown, the method further comprises:
[0128] When obtaining homogeneous documents, the similarity of two basic Word documents needs to be calculated. The similarity calculation method is to extract the title and keyword set in the two documents, and divide the intersection number of the two sets by the base. For example, the first Word document contains the keywords "software testing, security detection, performance evaluation, vulnerability scanning", and the second Word document contains the keywords "software testing, security evaluation, performance detection, penetration testing". The intersection of the keywords of the two documents is "software testing", and the base is 6, so the similarity is 1 / 6, which is about 17%. When the calculated similarity is greater than 50%, it is determined as a homogeneous document.
[0129] When the homogeneous document is disassembled, the document is split according to the title level. The splitting rule is divided into type I rule and type II rule. Type I rule splits the first-level title, and disassembles the first-level title and all the contents under it as a whole. Type II rule splits the second-level title, keeps the first-level title unchanged, and only disassembles and reorganizes the second-level title and its content.
[0130] Taking type I rule as an example, a certain technical solution specification is disassembled. The specification contains six first-level titles: "background technology", "invention content", "drawing description", "specific implementation", "beneficial effect", and "application scenario". According to the odd-even position relationship, "background technology", "drawing description", and "beneficial effect" are divided into A chain, and "invention content", "specific implementation", and "application scenario" are divided into B chain.
[0131] In the disassembly process, a variation mechanism is introduced, and the variation probability is set to 5%. When the randomly generated variation trigger value is less than 5%, the positions of adjacent title blocks are exchanged. For example, "background technology" and "drawing description" in A chain are exchanged, and the A chain after variation becomes "drawing description", "background technology", and "beneficial effect".
[0132] After the two basic documents are disassembled into A chain and B chain, they are cross-recombined. The A chain of the first document is combined with the B chain of the second document, and the A chain of the second document is combined with the B chain of the first document to generate two new sub-documents. When recombining, the original number order of the title is combined to ensure the rationality of the document structure.
[0133] The recombined document is evaluated, and the evaluation indicators include the download volume and user score of the document. The user score adopts a five-star system, and the score range is 1-5 points. The download volume and the score are weighted to calculate the adaptability score of the document. The document with higher adaptability score will enter the document resource pool and participate in the subsequent disassembly and recombination process as a new basic document.
[0134] Taking a software test report template as an example, the template is formed by multiple rounds of disassembly and reorganization and evaluation and screening, and becomes a high-quality template with a score of 4.5 and a monthly download quantity of more than 1000 times. The template combines the advantages of multiple basic templates, retains the description of the standard test process, and supplements the detailed test case design method, and becomes a standard template widely used by test personnel.
[0135] In a second aspect, the application provides a Word document processing system based on a DNA genetic model, comprising:
[0136] A first unit is configured to determine homogeneity of two base Word documents based on preset rules, wherein the preset rules include calculating a ratio of an intersection and a union of a feature set of the two base Word documents, and determining the two base Word documents as homogenized documents when the ratio is greater than a preset set threshold value.
[0137] A second unit is configured to separate the two base Word documents into A chains and B chains respectively according to the homogenized documents, and perform mutation processing on title blocks in the A chains and the B chains, wherein the mutation processing includes randomly adjusting positions of the title blocks according to a preset mutation probability.
[0138] A third unit is configured to recombine the A chain of a first base Word document with the B chain of a second base Word document to form a first sub-document, and recombine the A chain of the second base Word document with the B chain of the first base Word document to form a second sub-document.
[0139] A fourth unit is configured to evaluate the first sub-document and the second sub-document based on an adaptive function, and take a document download quantity and a recommendation index as evaluation parameters based on the adaptive function, wherein the recommendation index is an arithmetic mean of scores of the document given by a user group.
[0140] A fifth unit is configured to add a sub-document with an evaluation result of the adaptive function higher than a preset evaluation threshold value to a base Word document resource pool, for subsequent document genetic processing.
[0141] In a third aspect, the application provides an electronic device, comprising:
[0142] A processor;
[0143] A memory for storing processor-executable instructions;
[0144] The processor is configured to invoke the instructions stored in the memory to execute the method described above.
[0145] In a fourth aspect, the present application provides a computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method described above.
[0146] The present application can be a method, an apparatus, a system, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for performing various aspects of the present application.
[0147] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing a Word document based on a DNA genetic model, characterized in that, The method comprises the following steps: homogenization determination is performed on two base Word documents based on preset rules, the preset rules comprising calculating the ratio of the intersection and union of the feature sets of the two base Word documents, and determining that the two base Word documents are homogenized documents when the ratio is greater than a preset set threshold value; the two base Word documents are respectively disassembled into A chains and B chains according to the homogenized documents, and the title blocks in the A chains and the B chains are subjected to mutation processing, the mutation processing comprising randomly adjusting the positions of the title blocks according to a preset mutation probability; the A chain of a first base Word document is recombined with the B chain of a second base Word document to form a first sub-document, and the A chain of the second base Word document is recombined with the B chain of the first base Word document to form a second sub-document; the first sub-document and the second sub-document are evaluated based on an adaptive function, and the adaptive function takes the number of document downloads and a recommendation index as evaluation parameters, the recommendation index being the arithmetic mean of the scores of the documents given by a user group; sub-documents with evaluation results of the adaptive function higher than a preset evaluation threshold value are added to a base Word document resource pool for subsequent document genetic processing.
2. The method of claim 1, wherein, Homogenization determination is performed on two base Word documents based on preset rules, the preset rules comprising calculating the ratio of the intersection and union of the feature sets of the two base Word documents, and determining that the two base Word documents are homogenized documents when the ratio is greater than a preset set threshold value, which comprises: constructing feature sets of a first document and a second document, the feature sets containing hierarchical title structure feature vectors, word frequency statistics features, document theme semantic features, and text paragraph structure features of the first document and the second document; calculating the similarity of the feature sets of the first document and the second document based on a Jaccard coefficient, the similarity being obtained by the ratio of the intersection cardinality and the union cardinality of the feature sets of the first document and the second document; multiplying the similarity of each feature dimension of the first document and the second document by the corresponding weight coefficient, and dividing the sum of the products by the sum of the weight coefficients to obtain a weighted similarity; determining that the first document and the second document are homogenized documents based on a preset determination threshold value when the weighted similarity is greater than or equal to the preset determination threshold value.
3. The method of claim 1, wherein, The two base Word documents are respectively disassembled into A chains and B chains according to the homogenized documents, and the title blocks in the A chains and the B chains are subjected to mutation processing, which comprises: obtaining a title block sequence in a Word document, the title block sequence containing a plurality of title blocks, each title block containing a title and content corresponding to the title; splitting the title block sequence into A chains and B chains according to the odd-even position relationship, the A chains containing title blocks at odd positions in the title block sequence, and the B chains containing title blocks at even positions in the title block sequence; The title blocks in the A chain and the B chain are subjected to mutation processing based on a preset mutation probability, the mutation processing including position mutation and structure mutation, wherein the position mutation is achieved by position interchanging of adjacent title blocks in the A chain or the B chain, and the structure mutation is achieved by adjusting the hierarchical relationship of the title blocks; When a randomly generated mutation trigger value is less than the preset mutation probability, the mutation processing is performed on the title blocks.
4. The method of claim 1, wherein, Recombining the A chain of the first base Word document with the B chain of the second base Word document to form a first sub-document, and recombining the A chain of the second base Word document with the B chain of the first base Word document to form a second sub-document includes: Obtaining a first base document and a second base document, the first base document including a first A chain and a first B chain, and the second base document including a second A chain and a second B chain, wherein the first A chain and the first B chain respectively contain title blocks at odd positions and even positions in the first base document, and the second A chain and the second B chain respectively contain title blocks at odd positions and even positions in the second base document; Recombining and matching the first A chain of the first base document with the second B chain of the second base document to form a first sub-document, the first sub-document sequentially arranging the title blocks according to the order of the title blocks in the first A chain and the order of the title blocks in the second B chain; Recombining and matching the second A chain of the second base document with the first B chain of the first base document to form a second sub-document.
5. The method of claim 1, wherein, Evaluating the first sub-document and the second sub-document based on an adaptive function, and taking the number of document downloads and a recommendation index as evaluation parameters based on the adaptive function, the recommendation index being an arithmetic mean of user group scores of the documents includes: Standardizing the number of downloads of the first sub-document and the second sub-document, and dividing the number of downloads of the first sub-document and the second sub-document by a historical maximum download amount to obtain standardized download amounts; Calculating a recommendation index of the first sub-document and the second sub-document, the recommendation index being obtained by dividing a sum of user scores by a number of users participating in scoring; Evaluating the first sub-document and the second sub-document based on an adaptive function, and performing weighted calculation on the standardized download amounts and the recommendation index according to the adaptive function, wherein the sum of a weight coefficient of the standardized download amount and a weight coefficient of the recommendation index is one; Obtaining an arithmetic mean of the first sub-document and the second sub-document according to a calculation result of the adaptive function.
6. The method of claim 5, wherein, Evaluating the first sub-document and the second sub-document based on an adaptive function, and performing weighted calculation on the standardized download amounts and the recommendation index according to the adaptive function includes: Evaluating the first sub-document and the second sub-document based on an adaptive function, respectively, the adaptive function multiplying the standardized download amount by a first weight coefficient, multiplying the recommendation index by a second weight coefficient, and adding the two products to obtain an adaptive score.
7. A system for processing Word documents based on a DNA genetic model for implementing the method of any of the preceding claims 1-6, characterized in that, Evaluating the first sub-document and the second sub-document based on an adaptive function, respectively, the adaptive function multiplying the standardized download amount by a first weight coefficient, multiplying the recommendation index by a second weight coefficient, and adding the two products to obtain an adaptive score. The first unit is configured to determine homogeneity of two base Word documents based on a preset rule, the preset rule including calculating a ratio of an intersection and a union of a feature set of the two base Word documents, and determining the two base Word documents as homogenized documents when the ratio is greater than a preset set threshold value; The second unit is configured to respectively split the two base Word documents into A chains and B chains according to the homogenized documents, and perform mutation processing on title blocks in the A chains and the B chains, the mutation processing including randomly adjusting positions of the title blocks according to a preset mutation probability; The third unit is configured to recombine the A chain of a first base Word document with the B chain of a second base Word document to form a first sub-document, and recombine the A chain of the second base Word document with the B chain of the first base Word document to form a second sub-document; The fourth unit is configured to evaluate the first sub-document and the second sub-document based on an adaptive function, and take a document download amount and a recommendation index as evaluation parameters based on the adaptive function, the recommendation index being an arithmetic mean of scores of the documents given by a user group; The fifth unit is configured to add a sub-document with an evaluation result of the adaptive function being higher than a preset evaluation threshold value to a base Word document resource pool, for subsequent document genetic processing.
8. An electronic device, comprising: The computer program instructions are executed by the processor to implement the method in any one of claims 1 to 6. The computer program instructions are executed by the processor to implement the method in any one of claims 1 to 6. 9. A computer-readable storage medium having stored thereon computer program instructions, wherein,