Cboth processing method and device, equipment and storage medium

The method automates text consistency checks in front-end systems by processing text into words, calculating semantic similarity, and replacing inconsistencies, thereby addressing inefficiencies and errors in traditional manual methods, improving efficiency and accuracy.

CN119692348AActive Publication Date: 2025-03-25CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411696567.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-25
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

Traditional methods for checking the consistency of front-end system text in complex systems are inefficient and prone to human errors due to their reliance on manual review, which becomes increasingly difficult as system scale and complexity grow, especially across multiple development teams.

Method used

A method that involves text processing by dividing text into words, calculating semantic similarity, grouping similar words, identifying inconsistencies, and automatically replacing them to ensure consistency, using techniques like word vectors and similarity thresholds.

Benefits of technology

This approach significantly enhances the efficiency and accuracy of text consistency checks, reducing human error and saving time and resources by automating the process across the front-end system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692348A_ABST
    Figure CN119692348A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a copywriting processing method and device, equipment and a storage medium, and the method comprises the steps: carrying out the word segmentation processing of a copywriting, and obtaining a plurality of to-be-grouped words; calculating a first semantic similarity between the words to be grouped; grouping the to-be-grouped words into word combinations according to the first semantic similarity, wherein the word combinations comprise to-be-grouped words with similar semantics; searching a word inconsistent with a preset correct word in the word combination as a word to be replaced; replacing the to-be-replaced word according to the preset correct word to obtain a target word combination; and correcting the word combination in the copywriting by adopting the target word combination to obtain a target copywriting. According to the embodiment of the invention, based on the first semantic similarity, the copywriting of the front-end system is automatically subjected to consistency check and processing, so that the efficiency and accuracy of copywriting consistency check of the front-end system are improved, and the manpower and time costs are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a document processing method and device, an electronic device and a storage medium. Background Art

[0002] In today's digital age, front-end systems have become one of the main ways for enterprises and individuals to interact with users. However, the copywriting management of front-end systems often faces the severe challenge of ensuring consistency. Due to the complexity of the system structure and the inherent limitations of manual inspection, traditional copywriting consistency inspection methods are often inefficient and prone to missed inspections and misjudgments.

[0003] The copy consistency checking methods in related technologies usually rely on manual review, which is not only time-consuming and labor-intensive, but also easily affected by human factors such as fatigue and lack of concentration. As the scale and complexity of front-end systems continue to increase, the number and types of copy are also growing sharply, making manual inspection more difficult and unreliable. In addition, front-end systems are usually composed of multiple modules and pages, which may be developed by different development teams or individuals, further increasing the difficulty of copy consistency management.

[0004] Therefore, there is an urgent need in the art for a front-end system document consistency checking and processing method that can significantly improve the checking efficiency and accuracy. Summary of the invention

[0005] The embodiment of the present application provides a document processing method to solve the problem of how to provide a front-end system document consistency checking and processing method that can significantly improve the checking efficiency and accuracy.

[0006] Correspondingly, the embodiments of the present application also provide a document processing device, an electronic device and a storage medium to ensure the implementation and application of the above method.

[0007] In order to solve the above problems, the present application discloses a document processing method, which includes:

[0008] Perform word segmentation on the text to obtain a number of words to be grouped;

[0009] Calculating a first semantic similarity between the words to be grouped;

[0010] According to the first semantic similarity, the words to be grouped are grouped into word combinations, wherein the word combinations contain words to be grouped with similar semantics;

[0011] Searching for words in the word combination that are inconsistent with the preset correct words as words to be replaced;

[0012] Replacing the words to be replaced according to the preset correct words to obtain a target word combination;

[0013] The target word combination is used to correct the word combination in the text to obtain a target text.

[0014] Optionally, the calculating the first semantic similarity between the words to be grouped includes:

[0015] Convert the words to be grouped into word vectors;

[0016] Calculate the first semantic similarity between each of the word vectors and the remaining word vectors.

[0017] Optionally, grouping the words to be grouped into word combinations according to the first semantic similarity includes:

[0018] For the target word vector corresponding to the target word to be grouped, obtaining the target first semantic similarity between the target word vector and the remaining word vectors;

[0019] Filter the remaining word vectors whose target first semantic similarity is higher than a preset similarity threshold to obtain the remaining target word vectors;

[0020] The words to be grouped corresponding to the remaining target word vectors are regarded as similar semantic words;

[0021] The target words to be grouped and the words with similar semantics are divided into the word combinations.

[0022] Optionally, searching for a word in the word combination that is inconsistent with a preset correct word as a word to be replaced includes:

[0023] Combining the preset correct words into a correct word set;

[0024] Acquire a target preset correct word from the correct word set;

[0025] Calculating a second semantic similarity between the target preset correct word and the words to be grouped in each word combination;

[0026] According to the second semantic similarity, selecting a target word combination;

[0027] Search the target word combination for words that are inconsistent with the target preset correct words as the words to be replaced.

[0028] Optionally, the replacing the to-be-replaced words according to the preset correct words to obtain a target word combination includes:

[0029] Determining whether the first semantic similarity corresponding to the to-be-replaced word is higher than a replacement threshold;

[0030] When the first semantic similarity corresponding to the word to be replaced is higher than a replacement threshold, the preset correct word is used to replace the word to be replaced.

[0031] Optionally, the word segmentation process is performed on the text to obtain a plurality of words to be grouped, including:

[0032] Using the text extraction expression, traverse the code to be processed to obtain the text;

[0033] Performing word segmentation processing on the text to obtain a number of word segmentation words;

[0034] The plurality of segmented words are filtered to obtain the plurality of words to be grouped.

[0035] Optionally, the method comprises:

[0036] Detecting the target code corresponding to the target text;

[0037] If the target code does not contain the word to be replaced, the target code is allowed to be submitted;

[0038] If the target code contains the word to be replaced, the submission of the target code is suspended.

[0039] The present application also discloses a document processing device, which includes:

[0040] A word segmentation module is used to perform word segmentation processing on the text to obtain a number of words to be grouped;

[0041] A first semantic similarity calculation module, used for calculating the first semantic similarity between the words to be grouped;

[0042] A word grouping module, used for grouping the words to be grouped into word combinations according to the first semantic similarity, wherein the word combinations contain words to be grouped with similar semantics;

[0043] A to-be-replaced word search module, used to search for words in the word combination that are inconsistent with preset correct words as to-be-replaced words;

[0044] A word replacement module, used to replace the words to be replaced according to the preset correct words to obtain a target word combination;

[0045] The consistency processing module is used to use the target word combination to correct the word combination in the text to obtain the target text.

[0046] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the document processing method as described in one or more of the embodiments of the present application.

[0047] The embodiments of the present application also disclose one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the document processing method as described in one or more of the embodiments of the present application.

[0048] Compared with the prior art, the embodiments of the present application have the following advantages:

[0049] In an embodiment of the present application, a text is segmented to obtain a number of words to be grouped; a first semantic similarity between the words to be grouped is calculated; the words to be grouped are grouped into word combinations according to the first semantic similarity, and the word combinations contain words to be grouped with similar semantics; words inconsistent with preset correct words are searched in the word combinations as words to be replaced; the words to be replaced are replaced according to the preset correct words to obtain a target word combination; the target word combination is used to correct the word combination in the text to obtain a target text. Based on the first semantic similarity, the embodiment of the present application automatically performs consistency check and processing on the text of the front-end system, thereby improving the efficiency and accuracy of the consistency check of the text of the front-end system, thereby saving manpower and time costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a flowchart of steps of an embodiment of a document processing method of the present application;

[0051] Figure 2 It is an implementation flow chart of an embodiment of a document processing method of the present application;

[0052] Figure 3 It is a structural block diagram of an embodiment of a document processing device of the present application;

[0053] Figure 4 It is a schematic diagram of the structure of a device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0055] Reference Figure 1 , is a flowchart of a method for processing a document in the present application, comprising the following steps:

[0056] Step 101: perform word segmentation processing on the text to obtain a number of words to be grouped.

[0057] In the embodiment of the present application, before performing word segmentation processing on the text, it is necessary to first extract the text from the target code.

[0058] In one embodiment, the target code may be a code used by the front-end system. If the user wishes the copywriting of the front-end system to be consistent in semantics and style, that is, to use the same vocabulary to describe the same things, so that customers browsing the front-end system can understand the copywriting content, the copywriting can be extracted from the target code of the front-end system for consistency processing, so that the same vocabulary is used to describe the same things in the copywriting.

[0059] Before step 101, in one embodiment, a regular expression may be used to extract a text string from the target code as the text of the target code.

[0060] In step 101, the text is segmented and converted into a unified word format to obtain a number of words to be grouped. In an optional embodiment, the Jieba word segmentation dictionary can be used to segment the Chinese in the text. Jieba word segmentation is a Chinese word segmentation tool that assists word segmentation by using a dictionary.

[0061] Step 102: Calculate the first semantic similarity between the words to be grouped.

[0062] In one embodiment, the words to be grouped may be first converted into corresponding word vectors, and then the first semantic similarities between the words to be grouped may be calculated based on the word vectors.

[0063] In one embodiment, for each word to be grouped, a method such as cosine similarity may be used to calculate the first semantic similarity between the word vectors of each word to be grouped.

[0064] Step 103: group the words to be grouped into word combinations according to the first semantic similarity, wherein the word combinations contain words to be grouped with similar semantics.

[0065] In step 103, words to be grouped with similar semantics are grouped into the same word combination according to the first semantic similarity, thereby obtaining one or more word combinations.

[0066] In one embodiment, a plurality of first semantic similarities corresponding to each word to be grouped are screened, and words corresponding to the first semantic similarities higher than a preset similarity threshold are taken as words with similar semantics corresponding to the words to be grouped, and are classified into the same word combination as the words to be grouped.

[0067] For example, if the current word to be grouped is "network management method", and the first semantic similarity between "network management policy", "network management plan", "network management plan", "network management means" and "network management method" is higher than the preset similarity threshold, then "network management policy, network management plan, network management plan, network management method, network management means" will be regarded as a word combination.

[0068] In one example, the word combination may be presented via a results page.

[0069] Step 104: Search the word combination for words that are inconsistent with the preset correct words as words to be replaced.

[0070] In step 104, a preset correct word for each word combination can be set in advance to replace the word to be replaced in the word combination. The word to be replaced is a word in the word combination that is inconsistent with the preset correct word, so the word inconsistent with the preset correct word can be searched in the word combination as the word to be replaced.

[0071] For example, if a word combination is obtained as "network management policy, network management plan, network management plan, network management method, network management means", and the preset correct word of the word combination is "network management method", then "network management policy, network management plan, network management plan, network management means" will be used as the words to be replaced.

[0072] Step 105: Replace the words to be replaced with the preset correct words to obtain a target word combination.

[0073] Use the preset correct words to replace the words to be replaced in the word combination to obtain the target word combination.

[0074] In one example, if a word combination is "network management policy, network management plan, network management plan, network management method, network management means", and the preset correct word of the word combination is "network management method", then the target word combination after replacement is "network management method, network management method, network management method, network management method, network management method", so that the same vocabulary is used to describe the same thing.

[0075] Step 106: Use the target word combination to correct the word combination in the text to obtain a target text.

[0076] After obtaining the target word combination, the target word combination is used to correct the word combination in the copy, that is, the words corresponding to the words to be replaced in the word combination and in the same position in the original copy are replaced with the words corresponding to the target word combination, thereby obtaining the target copy. The target copy is the copy that uses the same vocabulary to describe the same thing after consistency processing.

[0077] Furthermore, the code used by the front-end system can be corrected according to the target text to achieve consistency of the text in the code used by the front-end system. In one embodiment, the code file can be scanned and the replaceAll function (used to replace all matching substrings in a string) in JavaScript (a scripting language widely used in client development) can be executed to perform global replacement, automatically correcting inconsistent text in the code.

[0078] In an embodiment of the present application, a text is segmented to obtain a number of words to be grouped; a first semantic similarity between the words to be grouped is calculated; the words to be grouped are grouped into word combinations according to the first semantic similarity, and the word combinations contain words to be grouped with similar semantics; words inconsistent with preset correct words are searched in the word combinations as words to be replaced; the words to be replaced are replaced according to the preset correct words to obtain a target word combination; the target word combination is used to correct the word combination in the text to obtain a target text. Based on the first semantic similarity, the embodiment of the present application automatically performs consistency check and processing on the text of the front-end system, thereby improving the efficiency and accuracy of the consistency check of the text of the front-end system, thereby saving manpower and time costs.

[0079] In an optional embodiment of the present application, in step 102, the calculating the first semantic similarity between the words to be grouped includes:

[0080] Convert the words to be grouped into word vectors;

[0081] Calculate the first semantic similarity between each of the word vectors and the remaining word vectors.

[0082] In an embodiment of the present application, the words to be grouped may be converted into word vectors before calculating the first semantic similarity. In one embodiment, a pre-trained word vector model, such as Word2Vec (a word embedding technology), GloVe (Global Vectors for Word Representation, a word embedding technology), BERT (Bidirectional Encoder Representations from Transformers, a pre-trained language model), etc., may be used to convert each word to be grouped into a word vector.

[0083] For each word vector, the first semantic similarity between each word vector and the other word vectors is calculated, so as to obtain the first semantic similarity between the words to be grouped.

[0084] In the embodiment of the present application, the words to be grouped are first converted into word vectors, and then the first semantic similarity between the words to be grouped is calculated. The first semantic similarity can be used for subsequent grouping of the words to be grouped.

[0085] In an optional embodiment of the present application, in step 103, grouping the words to be grouped into word combinations according to the first semantic similarity includes:

[0086] For the target word vector corresponding to the target word to be grouped, obtaining the target first semantic similarity between the target word vector and the remaining word vectors;

[0087] Filter the remaining word vectors whose target first semantic similarity is higher than a preset similarity threshold to obtain the remaining target word vectors;

[0088] The words to be grouped corresponding to the remaining target word vectors are regarded as similar semantic words;

[0089] The target words to be grouped and the words with similar semantics are divided into the word combinations.

[0090] In this embodiment, the following method may be used to group the words to be grouped into word combinations.

[0091] The words to be grouped are traversed, and the currently traversed words to be grouped are used as the target words to be grouped. For the target word vector corresponding to the target word to be grouped, the target first semantic similarity between the target word vector and the remaining word vectors corresponding to the remaining words to be grouped is obtained.

[0092] The remaining word vectors whose target first semantic similarity is higher than a preset similarity threshold are selected to obtain the target remaining word vectors. In one embodiment, the remaining word vectors can also be sorted from high to low according to the target first semantic similarity, and the remaining word vectors ranked in the top N are selected as the target remaining word vectors, where N is an integer.

[0093] The words to be grouped corresponding to the remaining target word vectors are regarded as similar semantic words, so that the target words to be grouped and the similar semantic words are divided into word combinations. Each word to be grouped that is traversed is processed in turn to obtain one or more word combinations.

[0094] The embodiment of the present application obtains one or more word combinations by grouping words to be grouped with similar semantics into the same word combination, so that preset correct words can be used to replace the words to be replaced in the word combination later, thereby improving the efficiency and accuracy of the front-end system's text consistency check, thereby saving manpower and time costs.

[0095] In an optional embodiment of the present application, in step 104, searching the word combination for a word that is inconsistent with a preset correct word as a word to be replaced includes:

[0096] Combining the preset correct words into a correct word set;

[0097] Acquire a target preset correct word from the correct word set;

[0098] Calculating a second semantic similarity between the target preset correct word and the words to be grouped in each word combination;

[0099] According to the second semantic similarity, selecting a target word combination;

[0100] Search the target word combination for words that are inconsistent with the target preset correct words as the words to be replaced.

[0101] In this embodiment, the preset correct words can be combined into a correct word set, and a group of semantically similar word combinations can be automatically analyzed for replacement. In one embodiment, different preset correct words can be distinguished by commas or spaces to obtain a correct word set.

[0102] The correct word set is traversed, and the currently traversed preset correct word is used as the target preset correct word, so as to obtain the target preset correct word from the correct word set.

[0103] Calculate the second semantic similarity between the target preset correct word and the words to be grouped in each word combination. In an optional embodiment, the second semantic similarity between the target preset correct word and the words to be grouped in each word combination can be calculated using a method such as cosine similarity. Furthermore, the second semantic similarities between the target preset correct word and the words to be grouped in each word combination can be summarized according to the word combination to obtain the second semantic similarity corresponding to each word combination.

[0104] According to the second semantic similarity, the target word combination is screened out. In one example, the word combinations can be sorted from high to low according to the second semantic similarity, and the word combination ranked first is selected as the target word combination. After the target word combination is obtained, the words that are inconsistent with the target preset correct words are searched in the target word combination as words to be replaced, and replaced.

[0105] The embodiment of the present application can first combine preset correct words into a correct word set, automatically analyze a group of semantically similar word combinations for replacement, improve the efficiency of the front-end system's text consistency check, and save manpower and time costs.

[0106] In an optional embodiment of the present application, in step 105, replacing the to-be-replaced words according to the preset correct words to obtain a target word combination includes:

[0107] Determining whether the first semantic similarity corresponding to the to-be-replaced word is higher than a replacement threshold;

[0108] When the first semantic similarity corresponding to the word to be replaced is higher than a replacement threshold, the preset correct word is used to replace the word to be replaced.

[0109] In the embodiment of the present application, a replacement threshold can be preset. When replacing a word to be replaced, first determine whether the first semantic similarity corresponding to the word to be replaced is higher than the replacement threshold. If the first semantic similarity corresponding to the word to be replaced is higher than the replacement threshold, the preset correct word is used to replace the word to be replaced; if the first semantic similarity corresponding to the word to be replaced is lower than the replacement threshold, no replacement is performed.

[0110] In an optional embodiment, multiple preset correct words and corresponding replacement thresholds may be set for the same word combination. After the first semantic similarity corresponding to the word to be replaced meets a certain replacement threshold, the preset correct word corresponding to the replacement threshold is used to replace the word to be replaced.

[0111] The embodiment of the present application pre-sets a replacement threshold. When replacing a word to be replaced, it is first determined whether the first semantic similarity corresponding to the word to be replaced is higher than the replacement threshold before replacement, thereby improving the accuracy of the front-end system's text consistency check.

[0112] In an optional embodiment of the present application, in step 101, the text is segmented to obtain a plurality of words to be grouped, including:

[0113] Using the text extraction expression, traverse the code to be processed to obtain the text;

[0114] Performing word segmentation processing on the text to obtain a number of word segmentation words;

[0115] The plurality of segmented words are filtered to obtain the plurality of words to be grouped.

[0116] In the embodiment of the present application, before the text is processed for consistency, it is necessary to perform word segmentation and filtering on the text.

[0117] Specifically, before the text is segmented, a text extraction expression can be used to traverse the code to be processed to obtain the text. For example, the text extraction expression can be a regular expression. Taking Chinese sentences as an example, the corresponding regular expression can be ^[\u4e00-\u9fa5\uff01-\uff5e 0-9, . , ? ! ; :]+$.

[0118] The text is segmented to obtain a number of segmented words, which can be filtered to obtain a number of words to be grouped. In an example, the number of segmented words can be filtered to remove meaningless words such as stop words to reduce noise impact.

[0119] Before the consistency processing is performed on the text, the embodiment of the present application first obtains the text from the code to be processed, and performs word segmentation and filtering processing, thereby improving the accuracy of the text consistency check of the front-end system.

[0120] In an optional embodiment of the present application, the method includes:

[0121] Detecting the target code corresponding to the target text;

[0122] If the target code does not contain the word to be replaced, the target code is allowed to be submitted;

[0123] If the target code contains the word to be replaced, the submission of the target code is suspended.

[0124] In an embodiment of the present application, before code merging is performed, that is, before the code is submitted to the CI stage (Continuous Integration) of the code repository for merging, the code can be checked for consistency to find out whether there are still words to be replaced.

[0125] Specifically, the target code corresponding to the target text is detected. If the target code does not contain the words to be replaced, the target code is allowed to be submitted; if the target code contains the words to be replaced, the submission of the target code is suspended, and the target text in the target code is processed for consistency according to a text processing method of the above embodiment, and then re-detected.

[0126] In one embodiment, the target code corresponding to the target document can be detected through git hook (Git hook, a mechanism provided by Git).

[0127] The embodiment of the present application performs a consistency check on the code before merging the codes to find out whether there are still words to be replaced, thereby improving the accuracy of the consistency check of the text in the front-end system.

[0128] In an optional embodiment of the present application, a vscode (Visual Studio Code, a code editor) plug-in can be set to automatically perform verification actions in the current system root directory, group them according to synonyms and display them on the result page. For each group of words, enter the correct text, perform a replacement action, and automatically replace the relevant text, thereby further improving the efficiency of the front-end system text consistency check and saving manpower and time costs.

[0129] In an embodiment of the present application, a text is segmented to obtain a number of words to be grouped; a first semantic similarity between the words to be grouped is calculated; the words to be grouped are grouped into word combinations according to the first semantic similarity, and the word combinations contain words to be grouped with similar semantics; words inconsistent with preset correct words are searched in the word combinations as words to be replaced; the words to be replaced are replaced according to the preset correct words to obtain a target word combination; the target word combination is used to correct the word combination in the text to obtain a target text. Based on the first semantic similarity, the embodiment of the present application automatically performs consistency check and processing on the text of the front-end system, thereby improving the efficiency and accuracy of the consistency check of the text of the front-end system, thereby saving manpower and time costs.

[0130] Reference Figure 2 , is an implementation flow chart of an embodiment of a document processing method of the present application.

[0131] like Figure 2 As shown, the complete process of an embodiment of a document processing method provided by the present application is demonstrated.

[0132] Step 1: Extract all the copy data in the code.

[0133] Step 2: Preprocess and segment the text data and convert it into a standardized word format.

[0134] Step 3: Use similarity calculation to group and display words with similar semantics.

[0135] Step 4: Enter the correct copy set to automatically correct inconsistent copy in the code.

[0136] Step 5: Integrate the function into the front-end development environment.

[0137] In an embodiment of the present application, a text is segmented to obtain a number of words to be grouped; a first semantic similarity between the words to be grouped is calculated; the words to be grouped are grouped into word combinations according to the first semantic similarity, and the word combinations contain words to be grouped with similar semantics; words inconsistent with preset correct words are searched in the word combinations as words to be replaced; the words to be replaced are replaced according to the preset correct words to obtain a target word combination; the target word combination is used to correct the word combination in the text to obtain a target text. Based on the first semantic similarity, the embodiment of the present application automatically performs consistency check and processing on the text of the front-end system, thereby improving the efficiency and accuracy of the consistency check of the text of the front-end system, thereby saving manpower and time costs.

[0138] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0139] On the basis of the above embodiments, this embodiment further provides a document processing device, which is applied to electronic devices such as terminal devices and servers.

[0140] Reference Figure 3 , shows a structural block diagram of an embodiment of a document processing device of the present application, which may specifically include the following modules:

[0141] A word segmentation module 301 is used to perform word segmentation processing on the text to obtain a number of words to be grouped;

[0142] A first semantic similarity calculation module 302, used to calculate the first semantic similarity between the words to be grouped;

[0143] A word grouping module 303, configured to group the words to be grouped into word combinations according to the first semantic similarity, wherein the word combinations contain words to be grouped with similar semantics;

[0144] A to-be-replaced word search module 304 is used to search for words in the word combination that are inconsistent with the preset correct words as to-be-replaced words;

[0145] A word replacement module 305, used to replace the words to be replaced according to the preset correct words to obtain a target word combination;

[0146] The consistency processing module 306 is used to use the target word combination to correct the word combination in the text to obtain the target text.

[0147] In an optional embodiment of the present application, the first semantic similarity calculation module 302 includes:

[0148] A vector conversion submodule, used for converting the words to be grouped into word vectors;

[0149] The first similarity calculation submodule is used to calculate the first semantic similarity between each of the word vectors and the remaining word vectors.

[0150] In an optional embodiment of the present application, the word grouping module 303 includes:

[0151] A target first semantic similarity acquisition submodule is used to acquire the target first semantic similarity between the target word vector corresponding to the target words to be grouped and the remaining word vectors;

[0152] A word vector screening submodule, used for screening the remaining word vectors whose target first semantic similarity is higher than a preset similarity threshold, to obtain the remaining target word vectors;

[0153] A similar semantic words determination submodule, used for taking the words to be grouped corresponding to the remaining target word vectors as similar semantic words;

[0154] The combination division submodule is used to divide the target words to be grouped and the words with similar semantics into the word combinations.

[0155] In an optional embodiment of the present application, the to-be-replaced word search module 304 includes:

[0156] A correct word set setting submodule, used for combining the preset correct words into a correct word set;

[0157] A target preset correct word acquisition submodule is used to acquire a target preset correct word from the correct word set;

[0158] A second similarity calculation submodule, used for calculating a second semantic similarity between the target preset correct word and the words to be grouped in each word combination;

[0159] a target word combination screening submodule, used for screening the target word combination according to the second semantic similarity;

[0160] The to-be-replaced word determination submodule is used to search for words in the target word combination that are inconsistent with the target preset correct words as the to-be-replaced words.

[0161] In an optional embodiment of the present application, the word replacement module 305 includes:

[0162] A similarity judgment submodule, used to judge whether the first semantic similarity corresponding to the to-be-replaced word is higher than a replacement threshold;

[0163] The to-be-replaced word replacement submodule is used to replace the to-be-replaced word with the preset correct word when the first semantic similarity corresponding to the to-be-replaced word is higher than a replacement threshold.

[0164] In an optional embodiment of the present application, the word segmentation module 301 includes:

[0165] The code traversal submodule is used to use the text extraction expression to traverse the code to be processed to obtain the text;

[0166] A word segmentation processing submodule is used to perform word segmentation processing on the text to obtain a number of word segmentation words;

[0167] The word filtering submodule is used to filter the several segmented words to obtain the several words to be grouped.

[0168] In an optional embodiment of the present application, the device includes:

[0169] A target code detection module, used to detect the target code corresponding to the target text;

[0170] A target code submission module, used for allowing submission of the target code if the target code does not contain the word to be replaced;

[0171] The target code submission suspension module is used for suspending submission of the target code if the target code contains the word to be replaced.

[0172] In an embodiment of the present application, a text is segmented to obtain a number of words to be grouped; a first semantic similarity between the words to be grouped is calculated; the words to be grouped are grouped into word combinations according to the first semantic similarity, and the word combinations contain words to be grouped with similar semantics; words inconsistent with preset correct words are searched in the word combinations as words to be replaced; the words to be replaced are replaced according to the preset correct words to obtain a target word combination; the target word combination is used to correct the word combination in the text to obtain a target text. Based on the first semantic similarity, the embodiment of the present application automatically performs consistency check and processing on the text of the front-end system, thereby improving the efficiency and accuracy of the consistency check of the text of the front-end system, thereby saving manpower and time costs.

[0173] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.

[0174] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, an electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes various types of devices such as terminal devices and servers (clusters).

[0175] The embodiments of the present disclosure may be implemented as a device configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the device may include electronic devices such as terminal devices and servers (clusters). Figure 4 An exemplary apparatus 400 that may be used to implement various embodiments described in this application is schematically illustrated.

[0176] For one embodiment, Figure 4 An exemplary apparatus 400 is shown having one or more processors 402, a control module (chip set) 404 coupled to at least one of the processor(s) 402, a memory 406 coupled to the control module 404, a non-volatile memory (NVM) / storage device 408 coupled to the control module 404, one or more input / output devices 410 coupled to the control module 404, and a network interface 412 coupled to the control module 404.

[0177] The processor 402 may include one or more single-core or multi-core processors, and the processor 402 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 400 can be used as a terminal device, server (cluster), etc. described in the embodiments of the present application.

[0178] In some embodiments, the apparatus 400 may include one or more computer-readable media (e.g., memory 406 or NVM / storage device 408) having instructions 414 and one or more processors 402 combined with the one or more computer-readable media and configured to execute the instructions 414 to implement a module to perform the actions described in the present disclosure.

[0179] For one embodiment, control module 404 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 402 and / or any suitable device or component in communication with control module 404 .

[0180] The control module 404 may include a memory controller module to provide an interface to the memory 406. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0181] The memory 406 may be used, for example, to load and store data and / or instructions 414 for the device 400. For one embodiment, the memory 406 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 406 may include a double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0182] For one embodiment, control module 404 may include one or more input / output controllers to provide interfaces to NVM / storage device 408 and input / output device(s) 410 .

[0183] For example, NVM / storage 408 may be used to store data and / or instructions 414. NVM / storage 408 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0184] NVM / storage device 408 may include storage resources that are physically part of the device on which apparatus 400 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 408 may be accessed via input / output device(s) 410 over a network.

[0185] (One or more) input / output devices 410 may provide an interface for the apparatus 400 to communicate with any other appropriate device, and the input / output device 410 may include a communication component, an audio component, a sensor component, etc. The network interface 412 may provide an interface for the apparatus 400 to communicate through one or more networks, and the apparatus 400 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.

[0186] For one embodiment, at least one of the processor(s) 402 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 404. For one embodiment, at least one of the processor(s) 402 may be packaged together with the logic of one or more controllers of the control module 404 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 402 may be integrated on the same die with the logic of one or more controllers of the control module 404. For one embodiment, at least one of the processor(s) 402 may be integrated on the same die with the logic of one or more controllers of the control module 404 to form a system-on-chip (SoC).

[0187] In various embodiments, the device 400 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 400 may have more or fewer components and / or different architectures. For example, in some embodiments, the device 400 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0188] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.

[0189] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0190] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0191] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable document processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable document processing terminal device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0192] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable document processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0193] These computer program instructions can also be loaded onto a computer or other programmable document processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0194] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0195] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0196] The above is a detailed introduction to a document processing method and device, an electronic device and a storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A copywriting processing method, characterized in that: The method comprises: Perform word segmentation on the text to obtain a number of words to be grouped; Calculating a first semantic similarity between the words to be grouped; According to the first semantic similarity, the words to be grouped are grouped into word combinations, wherein the word combinations contain words to be grouped with similar semantics; Searching for words in the word combination that are inconsistent with the preset correct words as words to be replaced; Replacing the words to be replaced according to the preset correct words to obtain a target word combination; The target word combination is used to correct the word combination in the text to obtain a target text.

2. The method according to claim 1, characterized in that The calculating the first semantic similarity between the words to be grouped includes: Convert the words to be grouped into word vectors; Calculate the first semantic similarity between each of the word vectors and the remaining word vectors.

3. The method according to claim 2, characterized in that The step of grouping the words to be grouped into word combinations according to the first semantic similarity includes: For the target word vector corresponding to the target word to be grouped, obtaining the target first semantic similarity between the target word vector and the remaining word vectors; Filter the remaining word vectors whose target first semantic similarity is higher than a preset similarity threshold to obtain the remaining target word vectors; The words to be grouped corresponding to the remaining target word vectors are regarded as similar semantic words; The target words to be grouped and the words with similar semantics are divided into the word combinations.

4. The method according to claim 1, characterized in that: The step of searching the word combination for a word that is inconsistent with a preset correct word as a word to be replaced includes: Combining the preset correct words into a correct word set; Acquire a target preset correct word from the correct word set; Calculating a second semantic similarity between the target preset correct word and the words to be grouped in each word combination; According to the second semantic similarity, selecting a target word combination; Search the target word combination for words that are inconsistent with the target preset correct words as the words to be replaced.

5. The method according to claim 1, characterized in that The replacing the words to be replaced according to the preset correct words to obtain a target word combination includes: Determining whether the first semantic similarity corresponding to the to-be-replaced word is higher than a replacement threshold; When the first semantic similarity corresponding to the word to be replaced is higher than a replacement threshold, the preset correct word is used to replace the word to be replaced.

6. The method according to claim 1, characterized in that The text is segmented to obtain a number of words to be grouped, including: Using the text extraction expression, traverse the code to be processed to obtain the text; Performing word segmentation processing on the text to obtain a number of word segmentation words; The plurality of segmented words are filtered to obtain the plurality of words to be grouped.

7. The method according to claim 1, characterized in that The method comprises: Detecting the target code corresponding to the target text; If the target code does not contain the word to be replaced, the target code is allowed to be submitted; If the target code contains the word to be replaced, the submission of the target code is suspended.

8. A document processing device, characterized in that: The device comprises: A word segmentation module is used to perform word segmentation processing on the text to obtain a number of words to be grouped; A first semantic similarity calculation module, used for calculating the first semantic similarity between the words to be grouped; A word grouping module, used for grouping the words to be grouped into word combinations according to the first semantic similarity, wherein the word combinations contain words to be grouped with similar semantics; A to-be-replaced word search module, used to search for words in the word combination that are inconsistent with preset correct words as to-be-replaced words; A word replacement module, used to replace the words to be replaced according to the preset correct words to obtain a target word combination; The consistency processing module is used to use the target word combination to correct the word combination in the text to obtain the target text.

9. An electronic device, characterized in that: include: processor; and A memory having executable codes stored thereon, which, when executed, enables the processor to execute the document processing method as described in one or more of claims 1-7.

10. One or more machine-readable media having executable codes stored thereon, which, when executed, enable a processor to execute the document processing method according to one or more of claims 1-7.

Citation Information

Patent Citations

  • Text correcting method and device

    CN106250364A

  • Secret communication method and device applied to text carrier

    CN108809919A

  • Method and device for acquiring same-intention statements

    CN110781687A

  • Neural network-based translation method and apparatus

    US20190138606A1

  • Normalized processing method and apparatus of named entity, and electronic device

    US20220129632A1