Large-scale text increment fuzzy deduplication method and device, equipment and medium
Generate document signatures through global dictionaries and hash functions, compare incremental and archived document signatures, solve the problem of insufficient recall in the existing technology, and achieve efficient and accurate deduplication processing of large-scale text.
Patent Information
- Application Number
- CN202410634137.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-03
AI Technical Summary
Existing keyword-based indexing and matching methods have insufficient recall rates in the process of large-scale text deduplication, resulting in incomplete deduplication.
Use a global dictionary and a preset hash function to generate document signatures, and perform deduplication processing by comparing incremental document signatures and archived document signatures to ensure that the same content is consistent in signature, thereby achieving duplicate content detection across document sets and reducing features Reduce the amount of calculation and improve the efficiency of deduplication.
It improves the coverage and efficiency of deduplication, can more comprehensively capture various forms of duplicate documents, and achieve accurate deduplication of incremental documents.
Smart Images

Figure CN118586380A
Abstract
Description
Technical Field
[0001] The present application relates to the field of document processing, and in particular to a large-scale text incremental fuzzy deduplication method, device, equipment and medium. Background Art
[0002] In the field of document processing, with the rapid growth of data volume, text deduplication has become an important preprocessing task. Especially when processing massive document sets, how to efficiently remove duplicate documents and retain incremental documents is a common concern of the industry and academia.
[0003] At present, the industry mainly adopts the index-based fuzzy deduplication method to remove the duplication of a large number of document sets A that have been deduplicated and incremental document sets B that have not been deduplicated. In this method, documents A and B are first preprocessed, including operations such as word segmentation, removal of stop words, and case conversion to improve the accuracy of subsequent matching. Then, an inverted index is built for document set A, each document in document set A is represented as a set of keywords or phrases, and these keywords or phrases are mapped to a list of document IDs containing them. When deduplication is performed on document set B, for each document in document set B, its keywords or phrases are extracted, and matching documents are searched in the inverted index of document set A. For example, by calculating the similarity between documents, such as Jaccard similarity, cosine similarity or edit distance, the similarity between documents in document set B and documents in document set A is determined. If the similarity between a document in document set B and any document in document set A exceeds a preset threshold, it is considered that the document has a fuzzy match in document set A, and the document should be deleted from document set B.
[0004] For the above method, the keyword-based indexing and matching method may result in insufficient recall rate, that is, some truly similar documents may be ignored due to keyword mismatch, resulting in incomplete deduplication.
[0005] Therefore, how to achieve efficient and accurate deduplication for large-scale incremental document sets remains a problem that needs to be solved urgently in the current field of text processing. Summary of the invention
[0006] The present application provides a large-scale text incremental fuzzy deduplication method, device, equipment and medium, which can solve the technical problem that the existing keyword-based indexing and matching fuzzy deduplication methods may result in insufficient recall rate, that is, some truly similar documents may be ignored due to keyword mismatch, resulting in incomplete deduplication.
[0007] In a first aspect, an embodiment of the present application provides a large-scale text incremental fuzzy deduplication method, comprising:
[0008] Acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents;
[0009] Determine, based on a pre-saved global dictionary corresponding to the archived document set and a preset hash function, incremental document signatures corresponding to the plurality of first documents respectively;
[0010] Based on the signatures of the archived documents, deduplication of the plurality of first documents is performed to obtain a target first document, including:
[0011] For each of the incremental document signatures, determine whether there is an archived document signature that matches the incremental document signature in each of the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, delete the first document corresponding to the incremental document signature; if it is determined that there is no archived document signature that matches the incremental document signature, retain the first document corresponding to the incremental document signature.
[0012] In a second aspect, the embodiment of the present application further provides a large-scale text incremental fuzzy deduplication device, comprising:
[0013] An acquisition unit, used to acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents;
[0014] A determination unit, configured to determine the incremental document signatures respectively corresponding to the plurality of first documents based on a pre-saved global dictionary corresponding to the archived document set and a preset hash function;
[0015] A processing unit is used to deduplicate the multiple first documents based on each of the archived document signatures to obtain a target first document; wherein, for each of the incremental document signatures, an archived document signature that matches the incremental document signature is determined among the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is deleted; if it is determined that there is no archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is retained.
[0016] In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor and a memory;
[0017] The processor is used to execute the large-scale text incremental fuzzy deduplication method as described above by calling the program or instruction stored in the memory.
[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute the large-scale text incremental fuzzy deduplication method as described above.
[0019] The beneficial effects of this application are:
[0020] 1. Based on the global dictionary and the preset hash function, document signatures are generated for documents in different document sets, thereby ensuring that the same content in different document sets remains consistent in document signatures, thereby facilitating duplicate content detection across document sets.
[0021] 2. Since the document signature is calculated only for the first document, and there is no need to recalculate the archived document signature of the existing second document, the order of magnitude of feature calculation is greatly reduced, further improving the efficiency of deduplication processing for incremental documents.
[0022] 3. Since document signatures are used as features to measure document similarity, that is, by comparing incremental document signatures with archived document signatures, compared with simple keyword matching, in principle, it is possible to capture various forms of duplicate documents more comprehensively, with higher deduplication coverage, thus achieving accurate deduplication of incremental documents. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of a large-scale text incremental fuzzy deduplication process provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of a specific large-scale text incremental fuzzy deduplication process provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of the structure of a large-scale text incremental fuzzy deduplication device provided in an embodiment of the present application;
[0026] Figure 4 It is a structural schematic diagram of a computer device provided in an optional embodiment of the present application. DETAILED DESCRIPTION
[0027] The principles and features of the present application are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present application and are not used to limit the scope of the present application.
[0028] In order to more clearly understand the above-mentioned purpose, features and advantages of the present application, the present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is to be understood that the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. The specific embodiments described herein are merely used to explain the present disclosure, rather than to limit the present application. Based on the described embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0029] It should be noted that, in this document, relational terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0030] In order to achieve efficient and accurate deduplication for large-scale incremental document sets, the present application provides a large-scale text incremental fuzzy deduplication method, device, equipment and medium.
[0031] Embodiment 1:
[0032] Figure 1 A schematic diagram of a large-scale text incremental fuzzy deduplication process provided in an embodiment of the present application, the process includes:
[0033] S101: Acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents.
[0034] The large-scale text incremental fuzzy deduplication method provided in the present application is applied to electronic devices, which may be smart devices, such as mobile phones, tablets, computers, etc., or servers, such as business servers, application servers, etc.
[0035] The incremental document set is a collection of newly added documents (referred to as first documents), which may be newly uploaded by users, newly generated by the system, or obtained from other sources. These first documents may contain duplicate content and need to be deduplicated.
[0036] The archived document set is a collection of documents (referred to as second documents) that have been deduplicated, and multiple second documents in the archived document set are not repeated. Each second document in the archived document set corresponds to a unique archived document signature. The archived document signature can be generated based on a pre-saved global dictionary and a preset hash function, such as a Minhash algorithm, so that the archived document signature can uniquely represent the key content in a document.
[0037] It should be noted that the archive document signature corresponding to any second document can be obtained when deduplicating the second document. That is to say, when deduplicating the incremental document set based on the archive document set, it is not necessary to determine the archive document signatures corresponding to multiple second documents in the archive document set separately.
[0038] S102: Determine the incremental document signatures corresponding to the multiple first documents based on the global dictionary corresponding to the pre-stored archive document set and a preset hash function.
[0039] In this application, it is necessary to pre-define a global dictionary, which contains all possible words or phrases. The global dictionary can be constructed by preprocessing and statistically analyzing a large amount of text data, such as generated from the second documents in the archive document set. Exemplarily, a large-scale corpus can be collected, which can contain various text data, such as web page content, document collections, user inputs, etc. Perform text preprocessing on the collected corpus, such as removing irrelevant characters, punctuation marks, stop words (such as commonly used but meaningless words like "de" (of), "shi" (is), etc.). At the same time, text tokenization may also be required, that is, splitting the text into individual words or phrases to extract the effective lexical units in the corpus. Remove duplicates from the preprocessed lexical units and construct a vocabulary list. This vocabulary list contains all different words or phrases in the corpus. Based on the constructed vocabulary list, generate the global dictionary. The global dictionary is a data structure (such as a hash table or an array), which stores the unique identifier (such as an index or a hash value) of each word or phrase in the vocabulary list. In this way, when generating document signatures subsequently, the unique identifier of each word or phrase can be quickly obtained by looking up the global dictionary.
[0040] In a possible implementation manner, the global dictionary can be optimized and updated. For example, the quality and adaptability of the dictionary can be improved by adding new words, deleting low-frequency words, or updating word weights, etc.
[0041] In this application, it is also necessary to define a preset hash function (denoted as the preset hash function), which can convert text into a unique document signature. Among them, there can be multiple such preset hash functions, such as 100, 1000, etc. In the specific implementation process, the number of the preset hash functions is determined according to the length of the document signature to be generated.
[0042] After obtaining the global dictionary and the preset hash function based on the above embodiments, the document signatures can be generated for the documents in different document sets based on the global dictionary and the preset hash function, so as to ensure that the same content in different document sets remains consistent in the document signatures, thereby facilitating the detection of duplicate content across document sets.
[0043] For example, for each of the multiple first documents, the following processing is performed: necessary text preprocessing operations are performed on the first document, such as removing stop words, punctuation marks, and performing text segmentation, so as to extract the valid content of the document. Using a global dictionary, the preprocessed document content is mapped to a corresponding vocabulary identifier. Based on the vocabulary identifier included in the first document and the global dictionary, a sparse matrix of the first document in the global dictionary is determined. Based on the preset hash function and the sparse matrix, an incremental document signature of the first document is determined.
[0044] S103: Based on the signatures of the archived documents, deduplication of the plurality of first documents is performed to obtain a target first document, including:
[0045] For each of the incremental document signatures, determine whether there is an archived document signature that matches the incremental document signature in each of the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, delete the first document corresponding to the incremental document signature; if it is determined that there is no archived document signature that matches the incremental document signature, retain the first document corresponding to the incremental document signature.
[0046] After obtaining each incremental document signature based on the above embodiment, the incremental document signatures corresponding to multiple first documents can be traversed. For each incremental document signature, the following steps need to be performed to determine whether the first document corresponding to the incremental document signature should be retained or deleted:
[0047] For the incremental document signature currently traversed, a matching search is performed in the archived document signatures to determine whether there is an archived document signature that matches the incremental document signature among the saved archived document signatures. The matching here means that the incremental document signature is similar to the archived document signature. If it is determined that there is any archived document signature that matches the incremental document signature, it means that the first document corresponding to the current incremental document signature is the same or highly similar to the content of a second document in the archived document set, and the first document may be a duplicate document, then the first document corresponding to the current incremental document signature is deleted; if it is determined that there is no archived document signature that matches the incremental document signature, it means that the first document corresponding to the current incremental document signature is new and unique, and does not repeat any second document in the archived document set, then the first document corresponding to the current incremental document signature is retained, and the first document is determined as the target first document.
[0048] Through the above process, the archived document signatures can be effectively used to perform deduplication processing on multiple first documents, ensuring that the final target first document set does not contain any duplicate content.
[0049] After the target first document is acquired based on the above embodiment, if the target first document needs to be merged into the archive set, the archive document set can be updated based on the target first document and the incremental document signature corresponding to the target first document. For example, when a merge set request for the target first document is received, the archive document set can be updated based on the target first document and the incremental document signature corresponding to the target first document.
[0050] In a possible implementation, for each incremental document signature, determining whether there is any archived document signature matching the incremental document signature includes:
[0051] For each of the archived document signatures, determine the similarity between the archived document signature and the incremental document signature; if the similarity is greater than a preset similarity threshold, determine that the archived document signature matches the incremental document signature; if the similarity is not greater than the similarity threshold, determine that the archived document signature does not match the incremental document signature.
[0052] For each incremental document signature, when determining whether there is an archived document signature that matches the incremental document signature, it can be achieved by comparing their similarities. The calculation of similarity can be based on the numerical value in the document signature, and whether it matches is determined based on a preset similarity threshold. Exemplarily, for each archived document signature, its similarity with the current incremental document signature is calculated. The similarity can be calculated using various algorithms, such as cosine similarity, Jaccard similarity, etc., and a suitable algorithm is selected according to the specific situation. The calculated similarity is compared with a preset similarity threshold. This similarity threshold is set according to actual needs and is used to determine whether two document signatures are similar enough to be considered a match. If the similarity is greater than the preset similarity threshold, it means that the archived document signature and the incremental document signature have a high similarity in content, and it is determined that the archived document signature matches the incremental document signature. If the similarity is not greater than the preset similarity threshold, it means that the two document signatures have a large difference in content, and it is determined that the archived document signature does not match the incremental document signature.
[0053] In this way, it is possible to accurately determine which incremental document signatures match the archived document signatures, so that duplicate documents can be accurately identified and removed during deduplication processing. This helps ensure that the target first document set does not contain content that is duplicated with the archived document set.
[0054] In one example, for each of the incremental document signatures, determining whether there is an archived document signature matching the incremental document signature in each of the archived document signatures includes:
[0055] Sorting the signatures of the archived documents;
[0056] For each of the incremental document signatures, an efficient search algorithm is used to determine whether there is an archived document signature that matches the incremental document signature among the sorted archived document signatures.
[0057] In order to improve the efficiency of subsequent searches for matching archived document signatures, the search process can be accelerated by sorting and efficient search algorithms (such as binary search trees, hash tables, etc.). Among them, sorting algorithms include quick sort, merge sort, heap sort, etc. After sorting, the archived document signatures will be arranged in a certain order (such as dictionary order or hash value size), so that they can be quickly searched using efficient search algorithms. Exemplarily, an efficient search algorithm is used to search for archived document signatures that match the current incremental document signature in the sorted archived document signatures. If a matching archived document signature is found, it means that the first document corresponding to the incremental document signature is repeated with a second document in the archived document set; if no matching archived document signature is found, it means that the first document corresponding to the incremental document signature is new or unarchived.
[0058] In a possible implementation, the archived document signatures may be sorted according to the numerical values of the archived document signatures.
[0059] For example, suppose there is a list of 1,000 archived document signatures, which have been sorted in lexicographic order. Now there is a batch of new incremental document signatures, and it is necessary to determine whether they already exist in the archived document signatures. For each incremental document signature, perform the following operations: Use a binary search algorithm to search for an archived document signature that matches the incremental document signature in the sorted archived document signatures. If a matching archived document signature is found, record the matching result and mark the first document corresponding to the incremental document signature as a duplicate document. If no matching archived document signature is found, record the matching result and mark the first document corresponding to the incremental document signature as a new document.
[0060] In one example, after determining the incremental document signatures corresponding to the plurality of first documents respectively based on the pre-saved global dictionary corresponding to the archived document set and the preset hash function, for each of the incremental document signatures, determining an archived document signature matching the incremental document signature in each of the archived document signatures; if it is determined that there is any archived document signature matching the incremental document signature, deleting the first document corresponding to the incremental document signature; if it is determined that there is no archived document signature matching the incremental document signature, retaining the first document corresponding to the incremental document signature, the method further includes:
[0061] Deduplication processing is performed on the multiple first documents based on the incremental document signatures respectively corresponding to the multiple first documents.
[0062] After determining the incremental document signatures corresponding to the plurality of first documents respectively based on the global dictionary corresponding to the pre-saved archive document set and the preset hash function, in order to ensure the uniqueness of the first documents and avoid duplication, these first documents may be deduplicated. The deduplication process is based on the incremental document signatures. Exemplarily, after obtaining the incremental document signatures, these incremental document signatures may be compared to check whether there are duplicate incremental document signatures. Duplicate incremental document signatures mean that there are first documents with the same or similar content in the incremental document set.
[0063] For example, the incremental document signatures are traversed and the similarities between the incremental document signatures are compared one by one. A hash algorithm or other similarity comparison algorithm can be used to determine the similarity between the incremental document signatures. If the similarity between two incremental document signatures exceeds a preset similarity threshold, it is considered that the first documents corresponding to them are duplicated or highly similar, and the duplicate first document is deleted, and only one version is retained.
[0064] In a possible implementation, the performing deduplication processing on the multiple first documents based on the incremental document signatures respectively corresponding to the multiple first documents includes:
[0065] Sorting the incremental document signatures respectively corresponding to the plurality of first documents;
[0066] Based on the sorted incremental document signatures, deduplication processing is performed on the multiple first documents.
[0067] In order to improve the deduplication efficiency, the incremental document signatures corresponding to the multiple first documents can be sorted, and then deduplication processing can be performed based on the sorted incremental document signatures. Among them, by sorting the incremental document signatures, the same or similar incremental document signatures can be clustered together, so that when performing deduplication processing, duplicate first documents can be identified more quickly. The sorted incremental document signatures make adjacent incremental document signatures more likely to be repeated or similar. Based on this, after sorting the acquired incremental document signatures, deduplication processing can be performed on the multiple first documents based on the sorted incremental document signatures.
[0068] In a possible implementation, the incremental document signatures may be sorted according to the numerical values of the incremental document signatures.
[0069] In one example, the method further includes:
[0070] If a request for merging the target first document into a collection is received, the archived document set is updated based on the target first document and the incremental document signature corresponding to the target first document.
[0071] Beneficial effects of this application:
[0072] 1. Based on the global dictionary and the preset hash function, document signatures are generated for documents in different document sets, thereby ensuring that the same content in different document sets remains consistent in document signatures, thereby facilitating duplicate content detection across document sets.
[0073] 2. Since the document signature is calculated only for the first document, and there is no need to recalculate the archived document signature of the existing second document, the order of magnitude of feature calculation is greatly reduced, further improving the efficiency of deduplication processing for incremental documents.
[0074] 3. Since document signatures are used as features to measure document similarity, that is, by comparing incremental document signatures with archived document signatures, compared with simple keyword matching, in principle, it is possible to capture various forms of duplicate documents more comprehensively, with higher deduplication coverage, thus achieving accurate deduplication of incremental documents.
[0075] Embodiment 2:
[0076] Figure 2 A schematic diagram of a specific large-scale text incremental fuzzy deduplication process provided in an embodiment of the present application, the process includes:
[0077] S201: Obtain an incremental document set and a deduplicated archived document set.
[0078] The incremental document set includes multiple first documents, and the archived document set includes archived document signatures corresponding to multiple deduplicated second documents.
[0079] S202: Determine incremental document signatures corresponding to the plurality of first documents respectively based on a global dictionary corresponding to a pre-saved archived document set and a preset hash function.
[0080] S203: Sort the incremental document signatures corresponding to the plurality of first documents.
[0081] S204: Deduplication processing is performed on the plurality of first documents based on the sorted incremental document signatures.
[0082] S205: Sort the signatures of the archived documents.
[0083] For each incremental document signature, perform the following steps:
[0084] S206: Using an efficient search algorithm, determine whether there is an archived document signature that matches the incremental document signature among the sorted archived document signatures. If so, execute S207; otherwise, execute S208.
[0085] In one possible implementation, for each archived document signature, the similarity between the archived document signature and the incremental document signature is determined; if the similarity is greater than a preset similarity threshold, it is determined that the archived document signature matches the incremental document signature; if the similarity is not greater than the similarity threshold, it is determined that the archived document signature does not match the incremental document signature.
[0086] S207: Delete the first document corresponding to the incremental document signature.
[0087] S208: Keep the first document corresponding to the incremental document signature.
[0088] Embodiment 3:
[0089] Based on the same inventive concept, the present application provides a large-scale text incremental fuzzy deduplication device. Figure 3 A schematic diagram of the structure of a large-scale text incremental fuzzy deduplication device provided in an embodiment of the present application, the device comprising:
[0090] The acquisition unit 31 is used to acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents respectively;
[0091] A determination unit 32, configured to determine the incremental document signatures respectively corresponding to the plurality of first documents based on a pre-saved global dictionary corresponding to the archived document set and a preset hash function;
[0092] The processing unit 33 is used to deduplicate the multiple first documents based on each of the archived document signatures to obtain a target first document; wherein, for each of the incremental document signatures, an archived document signature that matches the incremental document signature is determined among the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is deleted; if it is determined that there is no archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is retained.
[0093] In some possible implementations, the processing unit 33 is also used for the determination unit 32 to determine the incremental document signatures corresponding to the multiple first documents respectively based on the pre-saved global dictionary corresponding to the archived document set and the preset hash function. The processing unit 33 determines, for each incremental document signature, an archived document signature that matches the incremental document signature among the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is deleted; if it is determined that there is no archived document signature that matches the incremental document signature, before retaining the first document corresponding to the incremental document signature, deduplication processing is performed on the multiple first documents based on the incremental document signatures corresponding to the multiple first documents respectively.
[0094] In some possible implementations, the processing unit 33 is specifically configured to sort the incremental document signatures corresponding to the plurality of first documents respectively; and perform deduplication processing on the plurality of first documents based on the sorted incremental document signatures.
[0095] In some possible implementations, the processing unit 33 is specifically used to sort the archived document signatures; for each incremental document signature, using an efficient search algorithm, determine whether there is an archived document signature that matches the incremental document signature among the sorted archived document signatures.
[0096] In some possible implementations, the processing unit 33 is specifically configured to sort the document signatures according to the numerical values of the document signatures if the document signatures include the incremental document signatures and the archived document signatures.
[0097] In some possible implementations, the processing unit 33 is specifically used to determine, for each of the archived document signatures, the similarity between the archived document signature and the incremental document signature; if the similarity is greater than a preset similarity threshold, it is determined that the archived document signature matches the incremental document signature; if the similarity is not greater than the similarity threshold, it is determined that the archived document signature does not match the incremental document signature.
[0098] In some possible implementations, the processing unit 33 is further configured to update the archived document set based on the target first document and the incremental document signature corresponding to the target first document if a request for merging the target first document into a collection is received.
[0099] Embodiment 4:
[0100] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present application, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0101] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0102] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0103] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0104] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0105] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0106] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0107] Embodiment 5:
[0108] On the basis of the above embodiments, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the following steps when executing:
[0109] Acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents;
[0110] Determine, based on a pre-saved global dictionary corresponding to the archived document set and a preset hash function, incremental document signatures corresponding to the plurality of first documents respectively;
[0111] Based on the signatures of the archived documents, deduplication of the plurality of first documents is performed to obtain a target first document, including:
[0112] For each of the incremental document signatures, determine whether there is an archived document signature that matches the incremental document signature in each of the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, delete the first document corresponding to the incremental document signature; if it is determined that there is no archived document signature that matches the incremental document signature, retain the first document corresponding to the incremental document signature.
[0113] Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the large-scale text incremental fuzzy deduplication method, the implementation of the above-mentioned computer-readable storage medium can refer to the embodiment of the method, and the repeated parts will not be repeated.
Claims
1. A large-scale text incremental fuzzy deduplication method, characterized in that: The method comprises: Acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents; Determine, based on a pre-saved global dictionary corresponding to the archived document set and a preset hash function, incremental document signatures corresponding to the plurality of first documents respectively; Based on the signatures of the archived documents, deduplication of the plurality of first documents is performed to obtain a target first document, including: For each of the incremental document signatures, determine whether there is an archived document signature that matches the incremental document signature in each of the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, delete the first document corresponding to the incremental document signature; if it is determined that there is no archived document signature that matches the incremental document signature, retain the first document corresponding to the incremental document signature.
2. The method according to claim 1, characterized in that After determining the incremental document signatures corresponding to the plurality of first documents respectively based on the pre-saved global dictionary corresponding to the archived document set and the preset hash function, determining, for each incremental document signature, an archived document signature matching the incremental document signature among the archived document signatures; if it is determined that there is any archived document signature matching the incremental document signature, deleting the first document corresponding to the incremental document signature; If it is determined that there is no archived document signature matching the incremental document signature, before retaining the first document corresponding to the incremental document signature, the method further includes: Deduplication processing is performed on the multiple first documents based on the incremental document signatures respectively corresponding to the multiple first documents.
3. The method according to claim 2, characterized in that The deduplication processing of the plurality of first documents based on the incremental document signatures respectively corresponding to the plurality of first documents includes: Sorting the incremental document signatures respectively corresponding to the plurality of first documents; Based on the sorted incremental document signatures, deduplication processing is performed on the multiple first documents.
4. The method according to claim 1, characterized in that The step of determining, for each of the incremental document signatures, whether there is an archived document signature matching the incremental document signature in each of the archived document signatures includes: Sorting the signatures of the archived documents; For each of the incremental document signatures, an efficient search algorithm is used to determine whether there is an archived document signature that matches the incremental document signature among the sorted archived document signatures.
5. The method according to claim 3 or 4, characterized in that If each document signature includes each incremental document signature and each archived document signature, sorting the document signatures includes: The document signatures are sorted according to the numerical values of the document signatures.
6. The method according to claim 1, characterized in that For each incremental document signature, determining whether there is any archived document signature matching the incremental document signature includes: For each of the archived document signatures, determine the similarity between the archived document signature and the incremental document signature; if the similarity is greater than a preset similarity threshold, determine that the archived document signature matches the incremental document signature; if the similarity is not greater than the similarity threshold, determine that the archived document signature does not match the incremental document signature.
7. The method according to claim 1, characterized in that The method further comprises: If a request for merging the target first document into a collection is received, the archived document set is updated based on the target first document and the incremental document signature corresponding to the target first document.
8. A large-scale text incremental fuzzy deduplication device, characterized in that: The device comprises: An acquisition unit, configured to acquire an incremental document set and a deduplicated archived document set; wherein the incremental document set includes a plurality of first documents, and the archived document set includes archived document signatures corresponding to a plurality of deduplicated second documents; A determination unit, configured to determine the incremental document signatures respectively corresponding to the plurality of first documents based on a pre-saved global dictionary corresponding to the archived document set and a preset hash function; A processing unit is used to deduplicate the multiple first documents based on each of the archived document signatures to obtain a target first document; wherein, for each of the incremental document signatures, an archived document signature that matches the incremental document signature is determined among the archived document signatures; if it is determined that there is any archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is deleted; if it is determined that there is no archived document signature that matches the incremental document signature, the first document corresponding to the incremental document signature is retained.
9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute the large-scale text incremental fuzzy deduplication method as described in any one of claims 1 to 7 by calling the program or instruction stored in the memory.
10. A computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores a program or instruction, which enables a computer to execute the large-scale text incremental fuzzy deduplication method as described in any one of claims 1 to 7.
