Text deduplication method, device, electronic device and computer-readable storage medium
By performing word segmentation and sentence segmentation processing on the text, combined with text fingerprint and overlapping word granularity calculation, the problem of low text deduplication efficiency and accuracy in the existing technology is solved, and efficient and accurate text deduplication effect is achieved.
Patent Information
- Application Number
- CN202011637850.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Existing text deduplication methods are inefficient and inaccurate when processing massive amounts of text. They cannot effectively remove the overlap of details in the text, resulting in inaccurate deduplication results.
By performing word segmentation processing on the text to be deduplicated, constructing text fingerprints for overlapping deduplication, and performing sentence segmentation and overlapping word granularity calculation on the text after preliminary deduplication, the fine-grained deduplication of the text is achieved.
It improves the efficiency and accuracy of text deduplication, can effectively remove duplicate texts from massive texts, and improves the accuracy of deduplication.
Smart Images

Figure CN112733537B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of speech semantics technology, and in particular to a text deduplication method, device, electronic device and computer-readable storage medium. Background Art
[0002] Text deduplication is a very important part of the field of natural language processing. There are a large number of web pages with duplicate content on the Internet. Whether it is for search engine web page deduplication and filtering, content anti-piracy and tracking of news and novel content websites, or text deduplication and clustering in social media, web pages or texts need to be deduplicated.
[0003] At present, the most commonly used text deduplication method is the text deduplication algorithm based on text similarity. This algorithm analyzes the text content based on the natural language processing model and then selects texts with high similarity. However, since this method takes up a lot of computing resources when analyzing and calculating the overall content of the text, it leads to low efficiency in deduplication when deduplicating massive texts. In addition, deduplication by only analyzing the entire text cannot remove the overlap of details in the text, resulting in low deduplication accuracy. Summary of the invention
[0004] The present invention provides a text deduplication method, device and computer-readable storage medium, the main purpose of which is to solve the problem of low efficiency and accuracy when deduplicating a large amount of text.
[0005] To achieve the above object, the present invention provides a text deduplication method, comprising:
[0006] Acquire multiple texts to be deduplicated, and collect the multiple texts to be deduplicated into a corpus;
[0007] Performing word segmentation processing on each of the multiple to-be-deduplicated texts to obtain a text word segmentation corresponding to each to-be-deduplicated text;
[0008] Constructing a text fingerprint of the to-be-deduplicated text corresponding to the text segmentation according to the corpus;
[0009] De-duplication the multiple texts to be de-duplicated according to the text fingerprints to obtain multiple preliminary de-duplication texts;
[0010] Perform sentence segmentation on each of the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text;
[0011] Calculating the granularity of overlapping words between each of the text sentences;
[0012] The plurality of preliminary deduplicated texts are deduplicated by range according to the overlapping word granularity to obtain a deduplicated text set.
[0013] Optionally, performing word segmentation processing on each of the multiple to-be-deduplicated texts to obtain a text word segmentation corresponding to each to-be-deduplicated text includes:
[0014] Selecting the texts to be deduplicated from the multiple texts to be deduplicated in sequence;
[0015] Deleting the stop words contained in the selected text to be deduplicated using a preset stop word library;
[0016] The preset standard word library is used to perform word segmentation on the text to be deduplicated after deleting stop words to obtain text segmentation.
[0017] Optionally, constructing a text fingerprint of the to-be-deduplicated text corresponding to the text segmentation according to the corpus includes:
[0018] Performing a word segmentation frequency analysis on the text segmentation according to the to-be-deduplicated text corresponding to the text segmentation to obtain the word segmentation frequency;
[0019] Performing a document frequency analysis on the text segmentation words according to the corpus to obtain a document word frequency;
[0020] Constructing a word segmentation index for the text word segmentation according to the word segmentation word frequency and the file word frequency;
[0021] According to the segmentation index, a preset number of text segmentations are selected as fingerprint segmentations;
[0022] The fingerprint segmentation is hashed to obtain a text fingerprint.
[0023] Optionally, the step of performing overlapping deduplication on the multiple to-be-deduplicated texts according to the text fingerprint to obtain multiple preliminary deduplication-free texts includes:
[0024] Performing fingerprint segmentation on the text fingerprint corresponding to each of the multiple texts to be deduplicated to obtain fingerprint segments;
[0025] Position-encoding the fingerprint segments in the order of segmentation to obtain coded segments;
[0026] Calculate the overlap between the coding segments coded at the same position;
[0027] The duplicate texts in the multiple texts to be deduplicated are deleted according to the overlap degree to obtain multiple preliminary deduplicated texts.
[0028] Optionally, deleting duplicate texts from the plurality of to-be-deduplicated texts according to the overlap degree to obtain a plurality of preliminary deduplicated texts includes:
[0029] When the overlap between the code segments encoded at the same position is greater than a preset overlap threshold, the to-be-deduplicated text corresponding to the code segments is screened out;
[0030] Traversing the to-be-deduplicated texts corresponding to the encoding segments to obtain the text length of each to-be-deduplicated text;
[0031] All the to-be-deduplicated texts corresponding to the encoded segments are deleted except for the to-be-deduplicated texts whose text length is less than a preset text length threshold, to obtain a plurality of preliminary deduplicated texts.
[0032] Optionally, the sentence segmentation of each text in the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text includes:
[0033] Traversing the plurality of preliminary deduplicated texts, and determining positions of sentence separators in the plurality of preliminary deduplicated texts;
[0034] The multiple preliminary deduplication texts are segmented into sentences according to the positions of the sentence separators to obtain text sentences of each preliminary deduplication text.
[0035] Optionally, the calculating the granularity of overlapping words between each of the text sentences includes:
[0036] Selecting text sentences from the text sentences in sequence as target sentences;
[0037] The coincidence granularity of the target sentence and the unselected sentences in the text sentences is calculated using a preset coincidence granularity algorithm.
[0038] In order to solve the above problem, the present invention also provides a text deduplication device, the device comprising:
[0039] A text acquisition module, used for acquiring a plurality of texts to be deduplicated, and collecting the plurality of texts to be deduplicated into a corpus;
[0040] A text segmentation module is used to perform a segmentation process on each of the multiple to-be-deduplicated texts to obtain a text segmentation corresponding to each to-be-deduplicated text;
[0041] A fingerprint construction module, used to construct a text fingerprint of the to-be-deduplicated text corresponding to the text segmentation according to the corpus;
[0042] A first deduplication module is used to perform overlapping deduplication on the multiple to-be-deduplicated texts according to the text fingerprints to obtain multiple preliminary deduplication texts;
[0043] A sentence cutting module, used for performing sentence cutting on each text in the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text;
[0044] An overlapped word strength calculation module, used for calculating the overlapped word granularity between each of the text sentences;
[0045] The second deduplication module performs range deduplication on the plurality of preliminary deduplication texts according to the overlapping word granularity to obtain a deduplication text set.
[0046] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0047] a memory storing at least one instruction; and
[0048] The processor executes the instructions stored in the memory to implement the text deduplication method described above.
[0049] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned text deduplication method.
[0050] The embodiment of the present invention can divide a plurality of to-be-deduplicated texts of a relatively large length into text segments by performing segmentation processing on the texts to be deduplicated. The efficiency and accuracy of analyzing and processing a plurality of segmentations are higher than directly processing a plurality of to-be-deduplicated texts. By constructing text fingerprints for deduplication, the overlapping texts between the entire texts in the massive texts can be removed, avoiding content analysis of each text in the massive texts, which is beneficial to improving the efficiency of deduplication of the massive texts. By sentence cutting and calculating the granularity of overlapping words, the overlapping sentences existing in a plurality of preliminary deduplication texts are deduplicated, which realizes deduplication of the sentence granularity in the texts and improves the accuracy of deduplication. Therefore, the text deduplication method, device, electronic device and computer-readable storage medium proposed in the present invention can solve the problem of low efficiency and accuracy when deduplicating a large amount of texts. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A flowchart of a text deduplication method provided by an embodiment of the present invention;
[0052] Figure 2 A functional module diagram of a text deduplication device provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of the structure of an electronic device for implementing the text deduplication method provided by an embodiment of the present invention.
[0054] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0056] The embodiment of the present application provides a method for deduplication of text. The execution subject of the method for deduplication of text includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for deduplication of text can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0057] Reference Figure 1 FIG. 1 is a flow chart of a text deduplication method provided by an embodiment of the present invention. In this embodiment, the text deduplication method includes:
[0058] S1. Acquire multiple texts to be deduplicated, and collect the multiple texts to be deduplicated into a corpus.
[0059] In the embodiment of the present invention, the plurality of texts to be deduplicated may be any textual texts, for example, news texts of a plurality of news items.
[0060] In detail, the embodiment of the present invention can use a python statement with a data crawling function to obtain the text to be deduplicated from the blockchain node used to store the text to be deduplicated, and utilize the high throughput of the blockchain node for data to improve the efficiency of obtaining the text to be deduplicated.
[0061] Specifically, the multiple texts to be deduplicated are aggregated into a corpus, that is, the contents of the multiple texts to be deduplicated are aggregated to obtain a corpus containing the contents of all texts to be deduplicated. For example, the multiple texts to be deduplicated include text A, text B and text C, then the contents of text A, text B and text C are aggregated to obtain a corpus.
[0062] S2. Perform word segmentation processing on each of the multiple texts to be deduplicated to obtain a text segmentation corresponding to each text to be deduplicated.
[0063] In the embodiment of the present invention, the word segmentation processing is performed on each of the multiple texts to be deduplicated to obtain the text segmentation corresponding to each text to be deduplicated, including:
[0064] Selecting the texts to be deduplicated from the multiple texts to be deduplicated in sequence;
[0065] Deleting the stop words contained in the selected text to be deduplicated using a preset stop word library;
[0066] The preset standard word library is used to perform word segmentation on the text to be deduplicated after deleting stop words to obtain text segmentation.
[0067] Specifically, the preset stop word library and the preset standard word library are word libraries containing multiple word segments. The preset stop word library stores word segments of multiple stop words. For example, "hastily" and "as follows". The preset standard word library contains word segments of multiple non-stop words. For example, "eat" and "sleep".
[0068] In detail, the text word segments corresponding to each text to be deduplicated can be multiple.
[0069] In the embodiment of the present invention, the text to be deduplicated is subjected to word segmentation processing, and multiple texts to be deduplicated with a large length can be divided into text word segments. By analyzing and processing multiple word segments, the efficiency and accuracy are higher than directly processing multiple texts to be deduplicated.
[0070] S3. Construct a text fingerprint of the text to be deduplicated corresponding to the text word segment according to the corpus.
[0071] In the embodiment of the present invention, the constructing a text fingerprint of the text to be deduplicated corresponding to the text word segment according to the corpus includes:
[0072] Perform word frequency analysis on the text word segment according to the text to be deduplicated corresponding to the text word segment to obtain the word frequency of the word segment;
[0073] Perform document frequency analysis on the text word segment according to the corpus to obtain the document frequency of the word segment;
[0074] Construct a word segment index of the text word segment according to the word frequency of the word segment and the document frequency of the word segment;
[0075] Select a preset number of text word segments from the word segment index as fingerprint word segments;
[0076] Perform hash conversion on the fingerprint word segments to obtain a text fingerprint.
[0077] In the embodiment of the present invention, the performing word frequency analysis on the text word segment according to the text to be deduplicated corresponding to the text word segment means calculating the frequency of the text word segment appearing in the text to be deduplicated corresponding to the text word segment through a preset first frequency algorithm.
[0078] In detail, the performing word frequency analysis on the text word segment according to the text to be deduplicated corresponding to the text word segment to obtain the word frequency of the word segment includes:
[0079] Calculate the word frequency of the text word segment by using the following first frequency algorithm:
[0080]
[0081] where tf mis the word frequency of the mth text word, n is the number of times the mth text word appears in the to-be-deduplicated text corresponding to the mth text word, and k is the number of all text words in the to-be-deduplicated text corresponding to the mth text word.
[0082] Specifically, the word segmentation frequency can indicate the importance of the text segmentation in the to-be-deduplicated text corresponding to the text segmentation. The more times the text segmentation appears in the to-be-deduplicated text corresponding to the text segmentation, the greater the word segmentation frequency, indicating that the text segmentation is more important.
[0083] In the embodiment of the present invention, the file frequency analysis is performed on the text segmentation according to the corpus, that is, the frequency of occurrence of the text segmentation in all the to-be-deduplicated texts in the corpus is calculated by a preset second frequency algorithm.
[0084] In detail, the performing of a document frequency analysis on the text segmentation according to the corpus to obtain the document word frequency includes:
[0085] The file word frequency of text segmentation is calculated using the following second frequency algorithm:
[0086]
[0087] Among them, idf m is the file word frequency of the mth text segmentation, |D| is the number of to-be-deduplicated texts in the corpus, |j| is the number of to-be-deduplicated texts containing the mth text segmentation, and α is a preset offset correction coefficient, which is usually 1.
[0088] In the embodiment of the present invention, the step of constructing the word segmentation index of the text word segmentation according to the word segmentation word frequency and the file word frequency includes:
[0089] The following index algorithm is used to calculate the segmentation index of each segmentation word in the multiple text segmentations:
[0090] tf_idf m =tf m ×idf m
[0091] Among them, tf_idf m is the word segmentation index, tf m is the word frequency of the mth text word, idf m The document word frequency for the mth text segment.
[0092] Specifically, the word segmentation index may indicate the representativeness of the text segmentation for the text corresponding to the text segmentation in all the texts in the corpus, that is, the larger the word segmentation index is, the more representative the text segmentation is for the text to be deduplicated corresponding to the text segmentation.
[0093] In an embodiment of the present invention, a preset number of text segmentations are selected as fingerprint segmentations according to the segmentation index, that is, all text segmentations are sorted according to the size of the segmentation index, and a preset number of text segmentations are selected from front to back as fingerprint segmentations. For example, there are text segmentation 1, text segmentation 2, text segmentation 3, text segmentation 4, text segmentation 5 and text segmentation 6, wherein the segmentation index of text segmentation 1 is 80, the segmentation index of text segmentation 2 is 70, the segmentation index of text segmentation 3 is 60, the segmentation index of text segmentation 4 is 50, the segmentation index of text segmentation 5 is 40, and the segmentation index of text segmentation 6 is 30. If the preset number is 3, text segmentation 1, text segmentation 2 and text segmentation 3 are selected as fingerprint segmentations.
[0094] In an embodiment of the present invention, the performing hash conversion on the fingerprint segmentation to obtain a text fingerprint includes: calculating the fingerprint segmentation using a preset hash algorithm, and using the calculated hash value of the text segmentation as the text fingerprint of the text segmentation corresponding to the text segmentation. The hash algorithm includes but is not limited to the MD3 value algorithm and the MD5 value algorithm.
[0095] S4. De-duplication the multiple texts to be de-duplicated based on the text fingerprints to obtain multiple preliminary de-duplication texts.
[0096] In the embodiment of the present invention, the step of performing overlapping deduplication on the multiple texts to be deduplicated according to the text fingerprint to obtain multiple preliminary deduplication texts includes:
[0097] Performing fingerprint segmentation on the text fingerprint corresponding to each of the multiple texts to be deduplicated to obtain fingerprint segments;
[0098] Position-encoding the fingerprint segments in the order of segmentation to obtain coded segments;
[0099] Calculate the overlap between the coding segments coded at the same position;
[0100] The duplicate texts in the multiple texts to be deduplicated are deleted according to the overlap degree to obtain multiple preliminary deduplicated texts.
[0101] For example, there is a text fingerprint of "1010110100110110". The text fingerprint is divided into fingerprint segments at equal intervals to obtain four fingerprint segments of "1010", "1101", "0011" and "0110", and the fingerprint segments are position-encoded in sequence to obtain four coded segments: position 1: "1010", position 2: "1101", position 3: "0011", position 4: "0110".
[0102] In detail, the calculation of the overlap between the coding segments coded at the same position includes:
[0103] The overlap between the coding segments coded at the same position is calculated using the following overlap algorithm:
[0104] Sim=Pearson(R,S)
[0105] Wherein, R is any of the coding segments, S is a coding segment having the same position coding as R, Pearson is a similarity operation, and Sim is the degree of overlap between R and S.
[0106] Furthermore, the step of deleting duplicate texts from the plurality of texts to be deduplicated according to the overlap degree to obtain a plurality of preliminary deduplicated texts includes:
[0107] When the overlap between the code segments encoded at the same position is greater than a preset overlap threshold, the to-be-deduplicated text corresponding to the code segments is screened out;
[0108] Traversing the to-be-deduplicated texts corresponding to the encoding segments to obtain the text length of each to-be-deduplicated text;
[0109] All the to-be-deduplicated texts corresponding to the encoded segments are deleted except for the to-be-deduplicated texts whose text length is less than a preset text length threshold, to obtain a plurality of preliminary deduplicated texts.
[0110] S5. Perform sentence segmentation on each of the multiple preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text.
[0111] In the embodiment of the present invention, the sentence segmentation of each text in the plurality of preliminary deduplicated texts to obtain the text sentence of each preliminary deduplicated text includes:
[0112] Traversing the plurality of preliminary deduplicated texts, and determining positions of sentence separators in the plurality of preliminary deduplicated texts;
[0113] The multiple preliminary deduplication texts are segmented into sentences according to the positions of the sentence separators to obtain text sentences of each preliminary deduplication text.
[0114] In detail, the sentence separator can be pre-set, for example, a comma "," in multiple preliminary deduplicated texts is used as a sentence separator, or a period "." in multiple deduplicated texts is used as a sentence separator, thereby achieving sentence cutting of multiple preliminary deduplicated texts.
[0115] In the embodiment of the present invention, since the text fingerprint represents the characteristic information of the whole text, multiple to-be-deduplicated texts are deduplicated using the text fingerprint to obtain multiple preliminary deduplicated texts, and only the situation where the texts in the multiple to-be-deduplicated texts are overlapped as a whole can be removed. For example, if there are text A, text B, and text C, and the text fingerprint of text A is consistent with the text fingerprint of text B, then the text with the shorter text length between text A and text B is deleted. Therefore, in the embodiment of the present invention, the obtained multiple preliminary deduplicated texts are segmented into sentences to achieve sentence-level text deduplication for the multiple preliminary deduplicated texts, thereby improving the accuracy of text deduplication.
[0116] S6. Calculate the granularity of overlapping words between each of the text sentences.
[0117] In the embodiment of the present invention, the step of calculating the granularity of overlapping words between each of the text sentences includes:
[0118] Selecting text sentences from the text sentences in sequence as target sentences;
[0119] The coincidence granularity of the target sentence and the unselected sentences in the text sentences is calculated using a preset coincidence granularity algorithm.
[0120] For example, there are text sentence 1, text sentence 2, text sentence 3 and text sentence 4. Text sentence 1 is selected from the text sentences in turn, and the overlapping word granularity between text sentence 1 and text sentence 2, text sentence 3 and text sentence 4 is calculated respectively. Then text sentence 2 is selected in turn, and the overlapping word granularity between text sentence 2 and text sentence 3 and text sentence 4 is calculated respectively. Then text sentence 3 is selected in turn, and the overlapping word granularity between text sentence 3 and text sentence 4 is calculated.
[0121] In detail, the calculating the overlapping word granularity of the target sentence and the unselected sentence in the text sentence by using a preset overlapping word granularity algorithm includes:
[0122] The overlapping word granularity of the target sentence and the unselected sentences in the text sentences is calculated using the following overlapping word granularity algorithm:
[0123]
[0124] Where Z is the overlapped word granularity, T is the total number of words in the target sentence, and t i is the number of words that the i-th sentence that is not selected in the text sentence overlaps with the target sentence.
[0125] S7. Perform range deduplication on the plurality of preliminary deduplication texts according to the overlapping word granularity to obtain a deduplication text set.
[0126] In the embodiment of the present invention, the range deduplication refers to deduplicating overlapping sentences in the plurality of preliminary deduplicated texts according to the calculated overlapping word granularity, thereby improving the accuracy of deduplication.
[0127] In detail, performing range deduplication on the plurality of preliminary deduplication texts according to the overlapping word granularity to obtain a deduplication text set includes:
[0128] When the overlapping word granularity is greater than a preset word granularity threshold, filtering out text sentences corresponding to the overlapping word granularity;
[0129] Traversing the text sentences corresponding to the overlapping word granularity to obtain the sentence length of each text sentence;
[0130] The text sentences corresponding to the overlapped word granularity are deleted except for the text sentences whose sentence length is less than a preset sentence length threshold, to obtain a de-duplicate text set.
[0131] For example, there are multiple preliminary deduplicated texts A, preliminary deduplicated texts B and preliminary deduplicated texts C, wherein preliminary deduplicated text A contains text sentence a, preliminary deduplicated text B contains text sentence b, and preliminary deduplicated text C contains text sentence c, wherein the overlapping word granularity between text sentence a and text sentence b is 80, and the overlapping word granularity between text sentence a and text sentence c is 30. When the preset word granularity threshold is 50, text sentence a and text sentence b are screened out, and text sentence a and text sentence b are traversed to obtain a sentence length of text sentence a of 5 and a sentence length of text sentence b of 7. When the preset sentence length threshold is 6, text sentence a is deleted and text sentence b is retained to obtain a deduplicated text set.
[0132] Furthermore, an embodiment of the present invention also includes extracting optional events from a deduplicated text set using a preset event argument model, and finding texts in the deduplicated text set that are inconsistent in expression but consistent in actual semantics based on the event extraction results, so as to further deduplicate the deduplicated text set.
[0133] In detail, the event argument model includes but is not limited to the Event Extraction model, the NLP model and the LSTM-CRF model. The event argument model can be used to extract events from the deduplicated text set.
[0134] For example, there are deduplicated text A and deduplicated text B in the deduplicated text set. After event extraction is performed on deduplicated text A and deduplicated text B using the event argument model, it is found that both deduplicated text A and deduplicated text B describe award information, the winner is Xiao Zhang, and the award is for "Three Good Students". It is determined that deduplicated text A and deduplicated text B overlap, and any text in deduplicated text A and deduplicated text B is deleted.
[0135] The embodiment of the present invention can divide a plurality of to-be-deduplicated texts of a relatively large length into text segments by performing segmentation processing on the text to be deduplicated. The efficiency and accuracy of analyzing and processing a plurality of segments are higher than directly processing a plurality of to-be-deduplicated texts; by constructing text fingerprints for overlapping deduplication, the overlapping texts between the entire texts in the massive texts can be removed, avoiding content analysis of each text in the massive texts, which is conducive to improving the efficiency of deduplication of the massive texts; by sentence cutting and calculating the granularity of overlapping words, the overlapping sentences existing in a plurality of preliminary deduplication texts are deduplicated, which realizes deduplication of the sentence granularity in the texts and improves the accuracy of deduplication. Therefore, the text deduplication method proposed in the present invention can solve the problem of low efficiency and accuracy when deduplicating a large amount of texts.
[0136] like Figure 2 1 is a functional module diagram of a text deduplication device provided in one embodiment of the present invention.
[0137] The text deduplication device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the text deduplication device 100 can include a text acquisition module 101, a text segmentation module 102, a fingerprint construction module 103, a first deduplication module 104, a sentence cutting module 105, a overlapped word strength calculation module 106, and a second deduplication module 107. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0138] In this embodiment, the functions of each module / unit are as follows:
[0139] The text acquisition module 101 is used to acquire multiple texts to be deduplicated and collect the multiple texts to be deduplicated into a corpus.
[0140] In the embodiment of the present invention, the plurality of texts to be deduplicated may be any textual texts, for example, news texts of a plurality of news items.
[0141] In detail, the embodiment of the present invention can use a python statement with a data crawling function to obtain the text to be deduplicated from the blockchain node used to store the text to be deduplicated, and utilize the high throughput of the blockchain node for data to improve the efficiency of obtaining the text to be deduplicated.
[0142] Specifically, the multiple texts to be deduplicated are aggregated into a corpus, that is, the contents of the multiple texts to be deduplicated are aggregated to obtain a corpus containing the contents of all texts to be deduplicated. For example, the multiple texts to be deduplicated include text A, text B and text C, then the contents of text A, text B and text C are aggregated to obtain a corpus.
[0143] The text tokenization module 102 is used to perform tokenization processing on each of the multiple texts to be deduplicated, so as to obtain text tokens corresponding to each text to be deduplicated.
[0144] In the embodiment of the present invention, the text tokenization module 102 is specifically configured to:
[0145] Select the text to be deduplicated from the multiple texts to be deduplicated in sequence;
[0146] Use a preset stop word library to delete the stop words contained in the selected text to be deduplicated;
[0147] Use a preset standard word library to perform tokenization processing on the text to be deduplicated after deleting the stop words, so as to obtain text tokens.
[0148] Specifically, the preset stop word library and the preset standard word library are word libraries containing multiple tokens. The preset stop word library stores tokens of multiple stop words. For example, "rashly" and "like this". The preset standard word library contains tokens of multiple non-stop words. For example, "eat" and "sleep".
[0149] In detail, the text tokens corresponding to each text to be deduplicated can be multiple.
[0150] In the embodiment of the present invention, by performing tokenization processing on the text to be deduplicated, multiple texts to be deduplicated with larger lengths can be divided into text tokens. By analyzing and processing multiple tokens, the efficiency and accuracy are higher than directly processing multiple texts to be deduplicated.
[0151] The fingerprint construction module 103 is used to construct a text fingerprint of the text to be deduplicated corresponding to the text tokens according to the corpus.
[0152] In the embodiment of the present invention, the fingerprint construction module 103 is specifically configured to:
[0153] Perform token frequency analysis on the text tokens according to the text to be deduplicated corresponding to the text tokens, so as to obtain token frequencies;
[0154] Perform document frequency analysis on the text tokens according to the corpus, so as to obtain document frequencies;
[0155] Construct a token index of the text tokens according to the token frequencies and the document frequencies;
[0156] Select a preset number of text tokens from the token index as fingerprint tokens;
[0157] Perform hash conversion on the fingerprint tokens to obtain a text fingerprint.
[0158] In the embodiment of the present invention, the text segmentation is subjected to a segmentation frequency analysis based on the to-be-deduplicated text corresponding to the text segmentation, that is, the frequency of occurrence of the text segmentation in the to-be-deduplicated text corresponding to the text segmentation is calculated by a preset first frequency algorithm.
[0159] In detail, the performing of a word segmentation frequency analysis on the text segmentation according to the to-be-deduplicated text corresponding to the text segmentation to obtain the word segmentation frequency includes:
[0160] The word frequency of text segmentation is calculated using the following first frequency algorithm:
[0161]
[0162] Among them, tf m is the word frequency of the mth text word, n is the number of times the mth text word appears in the to-be-deduplicated text corresponding to the mth text word, and k is the number of all text words in the to-be-deduplicated text corresponding to the mth text word.
[0163] Specifically, the word segmentation frequency can indicate the importance of the text segmentation in the to-be-deduplicated text corresponding to the text segmentation. The more times the text segmentation appears in the to-be-deduplicated text corresponding to the text segmentation, the greater the word segmentation frequency, indicating that the text segmentation is more important.
[0164] In the embodiment of the present invention, the file frequency analysis is performed on the text segmentation according to the corpus, that is, the frequency of occurrence of the text segmentation in all the to-be-deduplicated texts in the corpus is calculated by a preset second frequency algorithm.
[0165] In detail, the performing of a document frequency analysis on the text segmentation according to the corpus to obtain the document word frequency includes:
[0166] The file word frequency of text segmentation is calculated using the following second frequency algorithm:
[0167]
[0168] Among them, idf m is the file word frequency of the mth text segmentation, |D| is the number of to-be-deduplicated texts in the corpus, |j| is the number of to-be-deduplicated texts containing the mth text segmentation, and α is a preset offset correction coefficient, which is usually 1.
[0169] In the embodiment of the present invention, the step of constructing the word segmentation index of the text word segmentation according to the word segmentation word frequency and the file word frequency includes:
[0170] The following index algorithm is used to calculate the segmentation index of each segmentation word in the multiple text segmentations:
[0171] tf_idf m =tf m ×idf m
[0172] Among them, tf_idf m is the word segmentation index, tf m is the word frequency of the mth text word, idf m The document word frequency for the mth text segment.
[0173] Specifically, the word segmentation index may indicate the representativeness of the text segmentation for the text corresponding to the text segmentation in all the texts in the corpus, that is, the larger the word segmentation index is, the more representative the text segmentation is for the text to be deduplicated corresponding to the text segmentation.
[0174] In an embodiment of the present invention, a preset number of text segmentations are selected as fingerprint segmentations according to the segmentation index, that is, all text segmentations are sorted according to the size of the segmentation index, and a preset number of text segmentations are selected from front to back as fingerprint segmentations. For example, there are text segmentation 1, text segmentation 2, text segmentation 3, text segmentation 4, text segmentation 5 and text segmentation 6, wherein the segmentation index of text segmentation 1 is 80, the segmentation index of text segmentation 2 is 70, the segmentation index of text segmentation 3 is 60, the segmentation index of text segmentation 4 is 50, the segmentation index of text segmentation 5 is 40, and the segmentation index of text segmentation 6 is 30. If the preset number is 3, text segmentation 1, text segmentation 2 and text segmentation 3 are selected as fingerprint segmentations.
[0175] In an embodiment of the present invention, the performing hash conversion on the fingerprint segmentation to obtain a text fingerprint includes: calculating the fingerprint segmentation using a preset hash algorithm, and using the calculated hash value of the text segmentation as the text fingerprint of the text segmentation corresponding to the text segmentation. The hash algorithm includes but is not limited to the MD3 value algorithm and the MD5 value algorithm.
[0176] The first deduplication module 104 is used to perform overlapping deduplication on the multiple to-be-deduplicated texts according to the text fingerprints to obtain multiple preliminary deduplication texts.
[0177] In the embodiment of the present invention, the first deduplication module 104 is specifically used for:
[0178] Performing fingerprint segmentation on the text fingerprint corresponding to each of the multiple texts to be deduplicated to obtain fingerprint segments;
[0179] Position-encoding the fingerprint segments in the order of segmentation to obtain coded segments;
[0180] Calculate the overlap between the coding segments coded at the same position;
[0181] The duplicate texts in the multiple texts to be deduplicated are deleted according to the overlap degree to obtain multiple preliminary deduplicated texts.
[0182] For example, there is a text fingerprint of "1010110100110110". The text fingerprint is divided into fingerprint segments at equal intervals to obtain four fingerprint segments of "1010", "1101", "0011" and "0110", and the fingerprint segments are position-encoded in sequence to obtain four coded segments: position 1: "1010", position 2: "1101", position 3: "0011", position 4: "0110".
[0183] In detail, the calculation of the overlap between the coding segments coded at the same position includes:
[0184] The overlap between the coding segments coded at the same position is calculated using the following overlap algorithm:
[0185] Sim=Pearson(R,S)
[0186] Wherein, R is any of the coding segments, S is a coding segment having the same position coding as R, Pearson is a similarity operation, and Sim is the degree of overlap between R and S.
[0187] Furthermore, the step of deleting duplicate texts from the plurality of texts to be deduplicated according to the overlap degree to obtain a plurality of preliminary deduplicated texts includes:
[0188] When the overlap between the code segments encoded at the same position is greater than a preset overlap threshold, the to-be-deduplicated text corresponding to the code segments is screened out;
[0189] Traversing the to-be-deduplicated texts corresponding to the encoding segments to obtain the text length of each to-be-deduplicated text;
[0190] All the to-be-deduplicated texts corresponding to the encoded segments are deleted except for the to-be-deduplicated texts whose text length is less than a preset text length threshold, to obtain a plurality of preliminary deduplicated texts.
[0191] The sentence segmentation module 105 is used to segment each text in the plurality of preliminary deduplicated texts into sentences to obtain text sentences of each preliminary deduplicated text.
[0192] In the embodiment of the present invention, the sentence cutting module 105 is specifically used for:
[0193] Traversing the plurality of preliminary deduplicated texts, and determining positions of sentence separators in the plurality of preliminary deduplicated texts;
[0194] The multiple preliminary deduplication texts are segmented into sentences according to the positions of the sentence separators to obtain text sentences of each preliminary deduplication text.
[0195] In detail, the sentence separator can be pre-set, for example, a comma "," in multiple preliminary deduplicated texts is used as a sentence separator, or a period "." in multiple deduplicated texts is used as a sentence separator, thereby achieving sentence cutting of multiple preliminary deduplicated texts.
[0196] In the embodiment of the present invention, since the text fingerprint represents the characteristic information of the whole text, multiple to-be-deduplicated texts are deduplicated using the text fingerprint to obtain multiple preliminary deduplicated texts, and only the situation where the texts in the multiple to-be-deduplicated texts are overlapped as a whole can be removed. For example, if there are text A, text B, and text C, and the text fingerprint of text A is consistent with the text fingerprint of text B, then the text with the shorter text length between text A and text B is deleted. Therefore, in the embodiment of the present invention, the obtained multiple preliminary deduplicated texts are segmented into sentences to achieve sentence-level text deduplication for the multiple preliminary deduplicated texts, thereby improving the accuracy of text deduplication.
[0197] The overlapped word strength calculation module 106 is used to calculate the overlapped word granularity between each of the text sentences.
[0198] In the embodiment of the present invention, the overlapped word strength calculation module 106 is specifically used for:
[0199] Selecting text sentences from the text sentences in sequence as target sentences;
[0200] The coincidence granularity of the target sentence and the unselected sentences in the text sentences is calculated using a preset coincidence granularity algorithm.
[0201] For example, there are text sentence 1, text sentence 2, text sentence 3 and text sentence 4. Text sentence 1 is selected from the text sentences in turn, and the overlapping word granularity between text sentence 1 and text sentence 2, text sentence 3 and text sentence 4 is calculated respectively. Then text sentence 2 is selected in turn, and the overlapping word granularity between text sentence 2 and text sentence 3 and text sentence 4 is calculated respectively. Then text sentence 3 is selected in turn, and the overlapping word granularity between text sentence 3 and text sentence 4 is calculated.
[0202] In detail, the calculating the overlapping word granularity of the target sentence and the unselected sentence in the text sentence by using a preset overlapping word granularity algorithm includes:
[0203] The overlapping word granularity of the target sentence and the unselected sentences in the text sentences is calculated using the following overlapping word granularity algorithm:
[0204]
[0205] Where Z is the overlapped word granularity, T is the total number of words in the target sentence, and t i is the number of words that the i-th sentence that is not selected in the text sentence overlaps with the target sentence.
[0206] The second deduplication module 107 performs range deduplication on the plurality of preliminary deduplication texts according to the overlapping character granularity to obtain a deduplication text set.
[0207] In the embodiment of the present invention, the range deduplication refers to deduplicating overlapping sentences in the plurality of preliminary deduplicated texts according to the calculated overlapping word granularity, thereby improving the accuracy of deduplication.
[0208] In detail, the second deduplication module 107 is specifically used for:
[0209] When the overlapping word granularity is greater than a preset word granularity threshold, filtering out text sentences corresponding to the overlapping word granularity;
[0210] Traversing the text sentences corresponding to the overlapping word granularity to obtain the sentence length of each text sentence;
[0211] The text sentences corresponding to the overlapped word granularity are deleted except for the text sentences whose sentence length is less than a preset sentence length threshold, to obtain a de-duplicate text set.
[0212] For example, there are multiple preliminary deduplicated texts A, preliminary deduplicated texts B and preliminary deduplicated texts C, wherein preliminary deduplicated text A contains text sentence a, preliminary deduplicated text B contains text sentence b, and preliminary deduplicated text C contains text sentence c, wherein the overlapping word granularity between text sentence a and text sentence b is 80, and the overlapping word granularity between text sentence a and text sentence c is 30. When the preset word granularity threshold is 50, text sentence a and text sentence b are screened out, and text sentence a and text sentence b are traversed to obtain a sentence length of text sentence a of 5 and a sentence length of text sentence b of 7. When the preset sentence length threshold is 6, text sentence a is deleted and text sentence b is retained to obtain a deduplicated text set.
[0213] Furthermore, an embodiment of the present invention also includes extracting optional events from a deduplicated text set using a preset event argument model, and finding texts in the deduplicated text set that are inconsistent in expression but consistent in actual semantics based on the event extraction results, so as to further deduplicate the deduplicated text set.
[0214] In detail, the event argument model includes but is not limited to the Event Extraction model, the NLP model and the LSTM-CRF model. The event argument model can be used to extract events from the deduplicated text set.
[0215] For example, there are deduplicated text A and deduplicated text B in the deduplicated text set. After event extraction is performed on deduplicated text A and deduplicated text B using the event argument model, it is found that both deduplicated text A and deduplicated text B describe award information, the winner is Xiao Zhang, and the award is for "Three Good Students". It is determined that deduplicated text A and deduplicated text B overlap, and any text in deduplicated text A and deduplicated text B is deleted.
[0216] The embodiment of the present invention can divide a plurality of long texts to be deduplicated into text segments by performing word segmentation processing on the texts to be deduplicated. The efficiency and accuracy of analyzing and processing a plurality of segments are higher than directly processing a plurality of texts to be deduplicated. By constructing text fingerprints for deduplication, the overlapping texts between the entire texts in the massive texts can be removed, avoiding content analysis of each text in the massive texts, which is conducive to improving the efficiency of deduplication of the massive texts. By sentence cutting and calculating the granularity of overlapping words, the overlapping sentences existing in a plurality of preliminary deduplication texts are deduplicated, which realizes deduplication of the sentence granularity in the texts and improves the accuracy of deduplication. Therefore, the text deduplication device proposed by the present invention can solve the problem of low efficiency and accuracy when deduplicating a large amount of texts.
[0217] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a text deduplication method provided by an embodiment of the present invention.
[0218] The electronic device 1 may include a processor 10 , a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a text deduplication program 12 .
[0219] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the text deduplication program 12, etc., but also can be used to temporarily store data that has been output or is to be output.
[0220] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as text deduplication programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
[0221] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0222] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0223] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0224] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0225] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0226] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0227] The text deduplication program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can achieve:
[0228] Acquire multiple texts to be deduplicated, and collect the multiple texts to be deduplicated into a corpus;
[0229] Performing word segmentation processing on each of the multiple to-be-deduplicated texts to obtain a text word segmentation corresponding to each to-be-deduplicated text;
[0230] Constructing a text fingerprint of the to-be-deduplicated text corresponding to the text segmentation according to the corpus;
[0231] De-duplication the multiple texts to be de-duplicated according to the text fingerprints to obtain multiple preliminary de-duplication texts;
[0232] Perform sentence segmentation on each of the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text;
[0233] Calculating the granularity of overlapping words between each of the text sentences;
[0234] The plurality of preliminary deduplicated texts are deduplicated by range according to the overlapping word granularity to obtain a deduplicated text set.
[0235] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0236] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0237] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0238] Acquire multiple texts to be deduplicated, and collect the multiple texts to be deduplicated into a corpus;
[0239] Performing word segmentation processing on each of the multiple to-be-deduplicated texts to obtain a text word segmentation corresponding to each to-be-deduplicated text;
[0240] Constructing a text fingerprint of the to-be-deduplicated text corresponding to the text segmentation according to the corpus;
[0241] De-duplication the multiple texts to be de-duplicated according to the text fingerprints to obtain multiple preliminary de-duplication texts;
[0242] Perform sentence segmentation on each of the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text;
[0243] Calculating the granularity of overlapping words between each of the text sentences;
[0244] The plurality of preliminary deduplicated texts are deduplicated by range according to the overlapping word granularity to obtain a deduplicated text set.
[0245] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0246] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0247] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0248] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0249] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0250] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0251] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0252] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A text deduplication method, characterized in that: The method comprises: Acquire multiple texts to be deduplicated, and collect the multiple texts to be deduplicated into a corpus; Performing word segmentation processing on each of the multiple to-be-deduplicated texts to obtain a text word segmentation corresponding to each to-be-deduplicated text; Performing a segmentation frequency analysis on the text segmentation according to the to-be-deduplicated text corresponding to the text segmentation to obtain a segmentation word frequency, performing a file frequency analysis on the text segmentation according to the corpus to obtain a file word frequency, constructing a segmentation index for the text segmentation according to the segmentation word frequency and the file word frequency, screening out a preset number of text segmentations as fingerprint segmentations according to the segmentation index, and performing a hash conversion on the fingerprint segmentations to obtain a text fingerprint; Fingerprint segmentation is performed on the text fingerprint corresponding to each of the multiple texts to be deduplicated to obtain fingerprint segments, position encoding is performed on the fingerprint segments in the order of segmentation to obtain encoded segments, the overlap between the encoded segments with the same position encoding is calculated, and the duplicate texts in the multiple texts to be deduplicated are deleted according to the overlap to obtain multiple preliminary deduplicated texts; Perform sentence segmentation on each of the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text; Selecting text sentences from the text sentences in sequence as target sentences, and calculating the coincidence granularity of the target sentences and the sentences not selected from the text sentences by using a preset coincidence granularity algorithm; The plurality of preliminary deduplicated texts are deduplicated by range according to the overlapping word granularity to obtain a deduplicated text set.
2. The text deduplication method according to claim 1, characterized in that: The word segmentation process is performed on each of the multiple to-be-deduplicated texts to obtain a text word segmentation corresponding to each to-be-deduplicated text, including: Selecting the texts to be deduplicated from the multiple texts to be deduplicated in sequence; Deleting the stop words contained in the selected text to be deduplicated using a preset stop word library; The preset standard word library is used to perform word segmentation on the text to be deduplicated after deleting stop words to obtain text segmentation.
3. The text deduplication method according to claim 1, characterized in that: Deleting duplicate texts from the plurality of to-be-deduplicated texts according to the overlap degree to obtain a plurality of preliminary deduplicated texts includes: When the overlap between the code segments encoded at the same position is greater than a preset overlap threshold, the to-be-deduplicated text corresponding to the code segments is screened out; Traversing the to-be-deduplicated texts corresponding to the encoding segments to obtain the text length of each to-be-deduplicated text; All the to-be-deduplicated texts corresponding to the encoded segments are deleted except for the to-be-deduplicated texts whose text length is less than a preset text length threshold, to obtain a plurality of preliminary deduplicated texts.
4. The text deduplication method according to any one of claims 1 to 3, characterized in that: The sentence segmentation of each text in the plurality of preliminary deduplicated texts to obtain the text sentence of each preliminary deduplicated text includes: Traversing the plurality of preliminary deduplicated texts, and determining positions of sentence separators in the plurality of preliminary deduplicated texts; The multiple preliminary deduplication texts are segmented into sentences according to the positions of the sentence separators to obtain text sentences of each preliminary deduplication text.
5. A text deduplication device, used to implement the text deduplication method according to any one of claims 1 to 4, characterized in that: The device comprises: A text acquisition module, used for acquiring a plurality of texts to be deduplicated, and collecting the plurality of texts to be deduplicated into a corpus; A text segmentation module is used to perform a segmentation process on each of the multiple to-be-deduplicated texts to obtain a text segmentation corresponding to each to-be-deduplicated text; A fingerprint construction module, used to construct a text fingerprint of the to-be-deduplicated text corresponding to the text segmentation according to the corpus; A first deduplication module is used to perform overlapping deduplication on the multiple to-be-deduplicated texts according to the text fingerprints to obtain multiple preliminary deduplication texts; A sentence cutting module, used for performing sentence cutting on each text in the plurality of preliminary deduplicated texts to obtain text sentences of each preliminary deduplicated text; An overlapped word strength calculation module, used for calculating the overlapped word granularity between each of the text sentences; The second deduplication module performs range deduplication on the plurality of preliminary deduplication texts according to the overlapping word granularity to obtain a deduplication text set.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the text deduplication method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the text deduplication method as described in any one of claims 1 to 4 is implemented.
