New word discovery algorithm based on reasoning, high confidence, and genetic iteration

Through a new word discovery algorithm based on reasoning and confidence indicators, combined with a distributed computing architecture, the problem of low efficiency and unclear goals in new word discovery is solved, efficient and accurate new word discovery and dictionary updating are achieved, and the quality of word segmentation is improved. .

CN114417848BActive Publication Date: 2024-08-30EAST MONEY INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111639010.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-08-30
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

Existing new word discovery algorithms have problems such as low efficiency of new word sources, inefficiency of TF-IDF statistics and unclear goals, which results in the inability to effectively and automatically discover new words, making dictionary updates difficult and affecting the quality of word segmentation.

Method used

Adopt a new word discovery algorithm based on reasoning, high confidence, and genetic iteration, obtain candidate new words through word segmentation direct reasoning and elastic granularity combination, use confidence indicators to classify the quality of new words, and design a distributed computing technology architecture to achieve efficient new words. word discovery.

Benefits of technology

It reduces the size of the candidate new word collection, improves the efficiency and accuracy of new word discovery, reduces the workload of reviewers, clarifies the goal of new word discovery, and achieves "perfect" dictionary construction and word segmentation coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417848B
    Figure CN114417848B
Patent Text Reader

Abstract

The present invention proposes a new word discovery algorithm based on reasoning, high confidence, and genetic iteration. The present invention proposes to use reasoning to replace the combinatorial exhaustive method to generate candidate new words, reducing the new word candidate set from an ultra-huge sparse space to the order of hundreds of thousands, making the existing computing and storage resources from unprocessable to processable; the present invention proposes a confidence index with normalized properties, which can well define the confidence threshold, give high-quality candidate new words, and greatly improve the work efficiency of manual editing. The present invention proposes a high-confidence genetic iteration process. In each iteration cycle, only new words with high confidence and manually reviewed are added to the dictionary, and the dictionary coverage is gradually improved in stages until the goal of 100%. The present invention proposes a technical solution for the implementation method of the distributed computing technology architecture of the above-mentioned new word discovery algorithm. Its design principles of specialized division of labor, risk dispersion and independent management can improve the overall stability and scheduling performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an automatic new word discovery algorithm, which can efficiently construct a "perfect" dictionary. The present invention also relates to a technical solution for realizing a distributed computing technology architecture applicable to the new word discovery algorithm. Background Art

[0002] New word discovery is the most basic service application in natural semantic analysis. Word segmentation is the basis of natural language services such as search, recommendation, and speech recognition. The word segmentation algorithm is highly dependent on dictionaries, and the quality and completeness of dictionaries directly affect the quality of word segmentation. Natural language services are closely linked. Even though dictionaries are the lowest and most inconspicuous role in natural language services, the errors in dictionaries will be transmitted all the way to upper-level applications such as search engines and chatbots, ultimately affecting the output quality of the final results. The dictionary used in the word segmentation algorithm is manually sorted, but natural language processing is a dynamically developing discipline. In order to adapt to the needs of changes in the social environment, a large number of new words emerge every day, such as "new energy", "carbon neutrality", "carbon peak", "Moutai", "Dongcai", etc. Static dictionaries cannot meet the needs of the ever-changing language environment. It is costly and even impractical to manually discover new words from massive information. How to automatically discover new words from massive information every day through algorithms and add them to dictionaries has been an urgent need for many years.

[0003] Words are fixed combinations of characters, and we can find some probability features in statistics, and use statistics to "mine" new words. The problem seems very simple, but it is not easy.

[0004] The traditional new word discovery algorithm first obtains a set of candidate new words by exhaustively enumerating the permutations and combinations of characters, and then calculates the TF-IDF (Term Frequency Inverse Document Frequency) of the new words based on the corpus to obtain statistically significant new words. The above technical solution seems simple, but it is actually not feasible. It has the following three major disadvantages:

[0005] Disadvantage 1) Inefficient source of new words

[0006] In fact, brute force is not feasible. There are about 10,000 commonly used Chinese characters (if long-tail Chinese characters are included, it will be close to 20,000). According to the theory of permutations and combinations: there are 10,000 × 10,000 possibilities for a word with a length of 2 characters (the limit of the number of records in a single MySQL machine is about 10 million); there are 10,000 × 10,000 × 10,000 possibilities for a word with a length of 3 characters. The same is true for words of different lengths. Here, I will not give examples of more character combinations because it is meaningless. Even a combination of two characters is meaningless because the performance of a single MySQL machine drops rapidly after more than 10 million rows. Of course, distributed storage can also be used as an alternative, but a combination of two characters requires 10 stand-alone machines, which has exceeded the budget of all small and medium-sized enterprises. However, the actual commonly used Chinese vocabulary is about 600,000, which means that in the huge sparse space formed by the candidate new word set, the real new words are only a very small subset. Traditional new word discovery algorithms traverse the entire huge sparse space through brute force. In reality, there are no hardware resources to store and calculate, so they face the dilemma of being unable to achieve.

[0007] Disadvantage 2) TF-IDF is statistically inefficient

[0008] Traditional new word discovery algorithms determine whether a character combination is a new word by calculating the TF-IDF (Term Frequency Inverse Document Frequency) of the new word. TF-IDF is proportional to the frequency of the word and inversely proportional to the number of documents in which it appears. It means the average number of times it appears in the document. TF-IDF is not a time-stable indicator (for example, a new word may be the protagonist in the most recent document, but may be a supporting role at other times). TF-IDF is a non-normalized indicator, that is, it is not defined between 0 and 1. Filtering new words by setting absolute thresholds / relative thresholds often does not have a good signal-to-noise ratio and will have a lot of noise. Among the predicted new words, the proportion of true new words is less than 5%, that is, among 100 new words discovered, less than 5 are true new words. A large number of false new words are discovered, and a large number of true new words are filtered by unreasonable thresholds, which brings a huge workload to the reviewers and seriously affects the review efficiency of the personnel.

[0009] Disadvantage 3) The goal of new word discovery is not clear

[0010] From the perspective of traversing the entire huge sparse space, traditional new word discovery algorithms do not have a clear objective function for new word discovery, which is why they choose brute force enumeration.

[0011] In actual business, the above defects have prevented new word discovery from moving forward. New word discovery has been shelved for several years, and it mainly relies on manual maintenance of dictionaries after business discovers problems. However, this manual maintenance method has a long feedback cycle and high vocabulary maintenance costs. According to incomplete statistics, in the financial market alone, there are hundreds of new terms such as new stocks issued every day, new businesses, new products, and new concepts, and the actual speed of personal maintenance is to add a few per day. Vocabulary only increases and never decreases, and outdated and incorrect vocabulary remain in the dictionary for a long time. Summary of the invention

[0012] The purpose of the present invention is to automatically discover new words from massive information every day through algorithms and add them to the dictionary, so as to obtain a "perfect dictionary".

[0013] In order to achieve the above object, a technical solution of the present invention is to provide a new word discovery algorithm based on reasoning, high confidence, and genetic iteration, characterized in that it includes the following steps:

[0014] Step 1: Update the word segmentation algorithm with its own dictionary after the t-1th round of iteration (Dictionary), third-party dictionaries provided by third-party databases And the new dictionary added to this algorithm (Initial round is an empty set) to form the dictionary Dict used in the tth round of iteration t ;

[0015] Step 2: Obtain the candidate new word set of the tth iteration, obtain the candidate new words in the candidate new word set by direct inference of word segmentation, and obtain the candidate new words in the candidate new word set based on the elastic granularity, where:

[0016] Obtaining candidate new words in the candidate new word set by direct word segmentation reasoning includes the following steps:

[0017] The word segmentation algorithm is based on the dictionary Dict t Perform word segmentation on the current given corpus. If any word segmentation meets one of the following conditions, the current word segmentation will be considered as a candidate new word and added to the candidate new word set:

[0018] Condition 1) The context of the current word is in the dictionary Dict t In the dictionary Dict, only the current word is not in the dictionary Dict t If the current word segmentation is inferred to be a new word with a high probability, it is added to the candidate new word set and globally counted;

[0019] Condition 2) The current word segmentation is a combination of multiple single characters, and the word segmentation context of the current word segmentation is in the dictionary Dict t, the current word segmentation composed of a combination of multiple single characters is most likely a new word, which is added to the candidate new word set and globally counted;

[0020] Condition 3) The context of the current word is divided by a special symbol, and the current word is not in the dictionary Dict t In the above example, the current word segmentation is most likely a new word, so it is added to the candidate new word set and globally counted;

[0021] Obtaining a candidate new word in a candidate new word set based on the elastic granularity includes the following steps:

[0022] On the basis of the minimum word granularity, the N nearest neighbor single word forms are combined to obtain the elastic granularity word through the nearest neighbor relationship, and the elastic granularity word is added as a candidate new word to the candidate new word set;

[0023] Step 3: Perform global corpus statistics on the candidate new words in the candidate new word set. According to the statistical results, the candidate new words are divided into (predicted) true new words, (predicted) uncertain new words and (predicted) false new words. After manual review, the (predicted) true new words are added to the new dictionary as (reviewed) true new words. Thus, the newly added dictionary after the tth round of iteration is obtained Specifically include the following:

[0024] definition:

[0025] Segment Frequency Index SF (Segment Frequency):

[0026] Indicates the frequency of the current word appearing in the form of a single word, applicable to the smallest granularity word.

[0027] Term Frequency (TF):

[0028] Indicates the frequency of the current word appearing in the form of a single word or a combined word. The characteristic is that there are word separators before and after the current word, which is suitable for flexible granularity word segmentation.

[0029] Document Frequency (DF):

[0030] Indicates the number of documents in the current corpus where the current word appears.

[0031] Sliding window frequency indicator WF (Window Frequency):

[0032] Indicates the frequency of the current word segmentation in the form of a sliding window. The characteristic is that the number of times the word segmentation occurs in a pure Chinese string without punctuation marks in a sliding window of the same size is not considered, similar to N-Gram.

[0033] Confidence indicators, including:

[0034] The confidence index SF-IWF (Segment Frequency Inverse Window Frequency) is applicable to the smallest granularity segmentation;

[0035] The confidence index TF-IWF (Term Frequency Inverse Window Frequency) is suitable for flexible granularity word segmentation;

[0036] If the candidate new word in the candidate new word set is in the form of a single segmentation word, the segmentation frequency index SF, the document number index DF, the sliding window frequency index WF and the confidence index SF-IWF of the current candidate new word are calculated, where:

[0037] If the candidate new word in the candidate new word set is in the form of combined segmentation, the word frequency index TF, document number index DF, sliding window frequency index WF and confidence index TF-IWF of the current candidate new word are calculated, where:

[0038] The candidate new words with a confidence index of more than 95% in the candidate new word set are defined as (predicted) true new words, the candidate new words with a confidence index of 5% to 95% are defined as (predicted) uncertain new words, and the candidate new words with a confidence index of less than 5% are defined as (predicted) false new words;

[0039] Step 4: The word segmentation algorithm comes with the dictionary and third-party dictionaries The word segmentation in the global corpus statistics is performed. For the single word segmentation form, its confidence index SF-IWF is calculated. For the combined word segmentation form, its confidence index TF-IWF is calculated. The word segmentation algorithm dictionary and third-party dictionaries The word segmentation outputs with low confidence index (below 5%) will be deleted after manual review.

[0040] Because it is considered that the dictionary is not only incomplete, but also overly redundant, such as: incorrect words; seriously outdated and no longer used words; overly combined words. Overly redundant dictionaries will also affect the word segmentation quality of the word segmentation algorithm. and third-party dictionaries The present invention outputs words with low confidence, and manually reviews and then deletes them;

[0041] Step 5: Repeat steps 1 to 4 for multiple rounds of iterations, so that the dictionary consisting of the word segmentation algorithm's own dictionary, third-party dictionaries, and newly added dictionaries can cover the word segmentation results of the word segmentation algorithm by nearly 100%, and obtain a "perfect" dictionary.

[0042] Preferably, in step 2, if the segmentation in the form of a single segmentation is not a nearest neighbor or the segmentation with a special part of speech does not need to be combined, the current segmentation is not used to form the elastic granularity segmentation.

[0043] Preferably, in step 2, when combining the single segmentation forms of the nearest N (including the current segmentation) segments to obtain the elastic granularity segmentation, the frequency TF of the elastic granularity segmentation obtained by the combination in a local single article in the current corpus is counted, if:

[0044] If the current participle is consistent with the previous N f The frequency of the elastic granularity segmentation formed by the combination of the segmentation words is equal to the frequency of the following N b The frequency of the elastic granularity segmentation formed by the combination of segmentations, where N f +N b = N-1, then the above N f participle and the current participle and the following N b The elastic granularity participle formed by the combination of the participles is taken as the candidate new word;

[0045] If the current participle is consistent with the previous N f The frequency of the elastic granularity segmentation formed by the combination of the segmentations is greater than that of the following N b The frequency of the elastic granularity segmentation formed by the combination of segmentations, where N f +N b = N-1, then the above N f The elastic granularity segmentation formed by combining the segmentation with the current segmentation is used as a candidate new word;

[0046] If the current participle is consistent with the previous N f The frequency of the elastic granularity participle formed by the combination of the participles is less than that of the following N b The frequency of the elastic granularity segmentation formed by the combination of N segmentations, then the current segmentation is combined with the following N b The elastic granularity segmentation formed by the combination of segmentations is taken as the candidate new word.

[0047] Preferably, in step 3, on the manually reviewed page, all SF, TF, DF, WF, TF-IWF, and SF-IWF indicator results of true new words are output, and context examples are given as references. After manual review, the (reviewed) true segmentation words are obtained.

[0048] Another technical solution of the present invention is to provide a method for implementing the above-mentioned distributed computing technology architecture of the new word discovery algorithm based on reasoning, high confidence, and genetic iteration, wherein the technology architecture includes three parts: input Source, calculation Trans., and output Sink, and is characterized in that it includes the following steps:

[0049] The input Source, calculation Trans. and output Sink are managed and guarded separately through multiple parallel processes, and the processes communicate through Queues to fully utilize the CPU and IO. Specifically:

[0050] Persist the input source and output sink to external storage, and use Kafka to smooth out the peaks and fill the valleys;

[0051] Externalize the word segmentation algorithm application into a microservice cluster, allocate sufficient parallelism, and achieve stable memory management and asynchronous high-concurrency response;

[0052] Externalize the global memory management of multiple processes to the Redis cache microservice cluster, aggregate the local calculation results of multiple processes and the process survival status monitoring results, and centralize the statistical output and global status control at the end of a round of iteration.

[0053] Preferably, both the input Source and the output Sink are linked to their upstream and downstream applications, without the need for restart and initialization in multiple iterations.

[0054] Preferably, the computing Trans. process memory and Redis global memory can be selectively restarted and initialized in multiple rounds of iterations.

[0055] The present invention has the following characteristics:

[0056] 1. The present invention proposes to infer a candidate new word set from a given corpus based on the Hanlp word segmentation context through a combination of different elastic granularities. The present invention reduces the original ultra-large sparse space where the candidate set is located to the order of hundreds of thousands, making the existing computing resources and storage resources from being unprocessable to processable.

[0057] 2. The present invention proposes a confidence index. By utilizing the normalized property of the confidence index, the present invention can well define the confidence threshold and provide high-quality candidate new words, of which more than 75% are (reviewed) true new words, greatly improving the work efficiency of manual editing.

[0058] 3. The present invention proposes a high-confidence genetic iterative process, which clearly states that the goal of new word discovery is to ensure that the dictionary covers 100% of the corpus segmentation results (i.e., the dictionary coverage rate is 100%). In each iteration cycle, only new words with high confidence and passed manual review are added to the dictionary, and the dictionary coverage rate is gradually improved in stages, rather than improving the dictionary coverage rate in one step.

[0059] 4. Design a distributed word segmentation algorithm microservice cluster, use Redis to implement new word statistics, global memory management, and multi-process lifecycle management, design a lightweight Source / Trans. / Sink technical architecture, and remotely call heavyweight word segmentation algorithms and global statistics to improve the overall stability and scheduling performance of the system.

[0060] Compared with the existing method based on exhaustive character permutation and combination and TD-IDF statistics, the present invention has the following advantages:

[0061] 1. The present invention greatly reduces the complexity of the problem, effectively saving hardware resources and computing time;

[0062] 2. The present invention clearly defines the previously ambiguous segmentation target and the path to achieve the target;

[0063] 3. The present invention defines a normalized confidence index to classify the quality of candidate new words and improve the work efficiency of auditors;

[0064] 4. The present invention applies the most advanced distributed computing concept and designs a technical architecture for separately building lightweight applications and heavyweight applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1A and Figure 1B It shows that the brute force exhaustive enumeration of candidate new words through character permutations and combinations will form a very huge sparse space;

[0066] Figure 2 It shows that the Hanlp word segmentation algorithm obtains candidate new words based on context reasoning, and its neighborhood combination as candidate new words with flexible granularity;

[0067] Figure 3 It shows that word segmentation has flexible granularity. Candidate new words can be obtained by combining nearest neighbor word segmentations. Different granularities need to be confirmed based on the context, otherwise ambiguity will occur.

[0068] Figure 4 It shows that the candidate new words are divided into true new words, uncertain new words and false new words according to the confidence level;

[0069] Figure 5It shows that only new words with high confidence are added to the dictionary in each round of iteration. Through multiple rounds of algorithm iteration, the objective function - dictionary coverage rate is gradually improved to 100%;

[0070] Figure 6 It shows that the words with low confidence in the word segmentation algorithm's own dictionary and third-party dictionary are deleted, and the words with high confidence are retained. After multiple rounds of algorithm iterations, the new dictionary can be merged to obtain a "perfect" dictionary.

[0071] Figure 7 It illustrates the distributed computing technology architecture of "lightweight Source / Trans. / Sink monomer" + "heavyweight microservices". DETAILED DESCRIPTION

[0072] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.

[0073] The present invention discloses a new word discovery algorithm based on reasoning, high confidence, and genetic iteration, and proposes a feasible distributed computing technology architecture. The present invention solves the following technical problems:

[0074] First, the present invention provides an effective and feasible source of new words, and the present invention can be implemented on limited computing resources and limited storage resources, for example, a budget of about 5 single machines;

[0075] Second) the present invention provides effective statistical indicators, thereby reducing the workload of auditors as much as possible;

[0076] Thirdly, the goal of new word discovery is clearly stated, including how each round of iteration is performed, when to stop iteration, and how the perfect dictionary is defined;

[0077] Fourth) Design a distributed computing technology architecture for new word discovery algorithms to solve the following technical problems:

[0078] 1) The word segmentation algorithm takes up a lot of memory, and the global intermediate statistical results also take up a lot of memory, and need to be shared by multiple processes;

[0079] 2) The word segmentation algorithm requires a lot of CPU computing, and the global intermediate statistical results also take up a lot of CPU computing;

[0080] 3) Stand-alone programs are prone to crashing. How can we decompose the pressure of memory storage and CPU computing onto multiple machines to achieve professional division of labor and load balancing?

[0081] To this end, taking the Hanlp word segmentation algorithm (those skilled in the art may also use the Jieba word segmentation algorithm or other popular word segmentation algorithms) as an example, the technical solution disclosed in this embodiment specifically includes the following steps:

[0082] Step 1: Update the dictionary of the Hanlp word segmentation algorithm after the t-1th round of iteration Third-party dictionaries provided by third-party databases And new dictionaries (Initial round iteration is an empty set) to form the dictionary Dict used in the tth round of iteration t ;

[0083] Step 2: Obtain the candidate new word set for the tth iteration

[0084] Traversing the sparse space formed by character arrangement and combination is an impractical logical starting point. Considering that new words come from corpus, the present invention obtains a set of candidate new words by reasoning, including the following contents:

[0085] 1) Obtaining candidate new words in the candidate new word set through direct word segmentation reasoning, including:

[0086] The basis of reasoning is to use the Hanlp word segmentation algorithm (abbreviated as: Hanlp, note: in actual work, there is no need to reinvent the wheel. Hanlp is a very popular and highly accurate word segmentation algorithm. In order to avoid reinventing the wheel or other uncertainties, the present invention assumes that in the presence of a perfect dictionary, the word segmentation results of Hanlp are 100% accurate. In actual situations, the dictionary is not perfect, and the accuracy of the word segmentation results decreases. If the word segmentation exists in the dictionary, the accuracy of the local word segmentation results will increase).

[0087] For the word segmentation of a given corpus, statistics show that Hanlp's own dictionary only covers 50% of the results of word segmentation, and the remaining 50% are obtained through algorithmic reasoning, or simply split into single characters (equivalent to no word segmentation), such as Figure 2 shown.

[0088] The Hanlp word segmentation algorithm is based on the dictionary Dict t Perform word segmentation on the current given corpus. If any word segmentation meets one of the following conditions, the current word segmentation will be considered as a candidate new word and added to the candidate new word set:

[0089] Condition 1) The context of the current word is in the dictionary Dict t In the dictionary Dict, only the current word is not in the dictionary Dict t If the current word segmentation is highly likely to be a new word, it is added to the candidate new word set and globally counted;

[0090] Condition 2) The current word segmentation is a combination of multiple single characters, and the word segmentation context of the current word segmentation is in the dictionary Dict t , the current segmented word composed of a combination of multiple single characters is most likely a new word, which is added to the candidate new word set and globally counted;

[0091] Condition 3) The context of the current word is divided by a special symbol, and the current word is not in the dictionary Dict t In the above example, the current word segmentation is most likely a new word, so it is added to the candidate new word set and globally counted.

[0092] The above conditions 1) to 3) do not exhaust all possible new words. For example, one of the left and right participles of the new word (i.e., the participles in the context) is not in the dictionary Dict. t Neither the middle participle nor the two participles are in the dictionary Dict t In the above situation, the accuracy of the new words inferred from these two situations is low. Only when the participles on both sides are in the dictionary, the accuracy of the new words is high. Therefore, the present invention adopts the method of "slow coverage" + "multiple rounds of iterations" to cover the above situation. A set of candidate new words with high confidence is slowly generated through multiple rounds of iterations, rather than trying to obtain all the new words through one calculation.

[0093] 2) Obtaining candidate new words in the candidate new word set based on the elastic granularity, including:

[0094] In addition to the above-mentioned new words obtained by direct reasoning through word segmentation, in order to expand the scope of the candidate new word set, the present invention assumes that the word segmentation has elastic granularity. On the basis of the minimum word segmentation granularity, through the nearest neighbor relationship, the word segmentation with a larger word segmentation granularity (defined as "elastic granularity") is obtained by N combinations and added to the candidate new word set. Figure 3 As shown in the figure, from the perspective of elastic granularity, word segmentation is ambiguous without considering the context. Ambiguity of word segmentation means that the finest granularity and the elastic granularity exist at the same time. In the absence of contextual prompts, both granularities are reasonable, but in the presence of contextual prompts, only one of the granularities is reasonable. The only advantage of ambiguity is to increase the probability of discovering new words of this combination and improve the recall rate of the algorithm.

[0095] In the present invention, the following situations do not require merging the segmented words with the smallest segmentation granularity:

[0096] Case 1) If the segmented words are not nearest neighbors and there are special symbols, spaces, or other artificial spaces between the segmented words, they should not be merged;

[0097] Case 2) Prepositions, copulas, quantifiers, and measurement units play special roles in the language. According to the part-of-speech tags provided by Hanlp, these participles cannot be merged into new words.

[0098] This embodiment takes the example of obtaining a word segmentation with a larger word segmentation granularity by performing 2 combinations or 3 combinations as an example to further illustrate the present invention. However, in the case of N>3, there are problems such as too much calculation and storage, and easy errors.

[0099] Assume that A, B, and C are all segmented words. For the case of ABC, we can merge forward to get AB or merge backward to get BC. The term frequency TF (TermFrequency) of the segmented words in the current corpus is:

[0100] If TF(AB) is equal to TF(BC), then ABC is selected as a candidate new word;

[0101] If TF(AB) is greater than TF(BC), AB is selected as a candidate new word;

[0102] If TF(AB) is less than TF(BC), BC is selected as a candidate new word.

[0103] Step 3: Perform global corpus statistics on the candidate new words in the candidate new word set. According to the statistical results, the candidate new words are divided into (predicted) true new words, (predicted) uncertain new words and (predicted) false new words. After the (predicted) true new words are manually reviewed, the (reviewed) true new words are added to the new dictionary. Thus, the newly added dictionary after the tth round of iteration is obtained Specifically include the following:

[0104] Considering that the TF-IDF index is not good enough, the present invention redefines several better and more explicit indexes to achieve global corpus statistics of candidate new words:

[0105] 1) Segment Frequency Index SF (Segment Frequency):

[0106] Indicates the frequency of the current word appearing in the form of a single word, applicable to the smallest granularity word.

[0107] 2) Term Frequency (TF):

[0108] Indicates the frequency of the current word appearing in the form of a single word or a combined word. The characteristic is that there are word separators before and after the current word, which is suitable for flexible granularity word segmentation.

[0109] 3) Document Frequency (DF):

[0110] Indicates the number of documents in the current corpus where the current word appears.

[0111] 4) Sliding window frequency indicator WF (Window Frequency):

[0112] Indicates the frequency of the current word segmentation in the form of a sliding window. The characteristic is that the number of times the word segmentation occurs in a pure Chinese string without punctuation marks in a sliding window of the same size is not considered, similar to N-Gram.

[0113] 5) Confidence indicators, including

[0114] The confidence index SF-IWF (Segment Frequency Inverse Window Frequency) is applicable to the smallest granularity segmentation;

[0115] The confidence indicator TF-IWF (Term Frequency Inverse Window Frequency) is suitable for flexible granularity word segmentation.

[0116] The meaning of the confidence index is that according to the statistics of the current corpus (usually 10,000 articles as a batch of corpus), among all the character combinations that appear, the proportion of them is fixed.

[0117] If the candidate new word in the candidate new word set is in the form of a single segmentation word, the segmentation frequency index SF, the document number index DF, the sliding window frequency index WF and the confidence index SF-IWF of the current candidate new word are calculated, where:

[0118]

[0119] If the candidate new word in the candidate new word set is in the form of combined segmentation, the word frequency index SF, document number index DF, sliding window frequency index WF and confidence index TF-IWF of the current candidate new word are calculated, where:

[0120] When dividing high confidence, it is possible that the sliding window frequency index WF is very small. At this time, it is necessary to further limit the lower limit of the sliding window frequency index WF, which is generally 10.

[0121] The confidence index proposed in the present invention has the characteristics of normalization, with a value range of 0 to 1, and the error decreases as the corpus increases. The confidence index SF-IWF is applicable to the case where the candidate new words are of minimum granularity, and the confidence index TF-IWF is applicable to the case where the candidate new words are of elastic granularity. According to the confidence levels of high (above 95%), medium (5% to 95%), and low (below 5%), the present invention can divide the candidate new words into (predicted) true new words, (predicted) uncertain new words, and (predicted) false new words. Only the (predicted) true new words with a confidence level greater than 95% are output to manual review, and the (predicted) true new words that pass the review are added to the newly added dictionary as (reviewed) true new words. middle.

[0122] Among the true new words predicted by the confidence index, more than 75% are true new words, which greatly improves the efficiency of manual review. The higher the quality of the corpus, the higher the proportion of true new words. Among them, the quality of ordinary news is relatively low, and the quality of research reports is the highest.

[0123] In the manual review process, most of the fake new words are considered unnecessary to merge or segment in this way from a human perspective. After double-blind testing (the same batch of real new words are reviewed by two people separately, and then the review results are compared), the manual error is about 10% to 20%, that is, there are 10% to 20% of new words that the two people have different views on. This is related to people's understanding of language and finance, such as duration and convexity. Suggestions:

[0124] 1) If conditions permit, manual review can be performed twice, three times or more times before taking the intersection to reduce review errors.

[0125] 2) For manually reviewed pages, all SF, TF, DF, WF, TF-IWF, and SF-IWF indicator results for new words are output, and context examples are given as references, which can effectively reduce review errors and problem tracing.

[0126] Step 4: The word segmentation algorithm comes with the dictionary and third-party dictionaries The word segmentation in the global corpus statistics is performed. For the single word segmentation form, its confidence index SF-IWF is calculated. For the combined word segmentation form, its confidence index TF-IWF is calculated. The word segmentation algorithm comes with a dictionary and third-party dictionaries The word segmentation outputs with low confidence index (below 5%) will be deleted after manual review.

[0127] Because it is considered that the dictionary is not only incomplete, but also overly redundant, such as: incorrect words; seriously outdated and no longer used words; overly combined words. Overly redundant dictionaries will also affect the word segmentation quality of the word segmentation algorithm. and third-party dictionaries The present invention outputs words with low confidence, and manually reviews and then deletes them.

[0128] Step 5: Repeat steps 1 to 4 for multiple rounds of iterations, so that the dictionary composed of the word segmentation algorithm dictionary, the third-party dictionary and the newly added dictionary can cover the word segmentation results of the Hanlp word segmentation algorithm by nearly 100%, thereby obtaining a "perfect" dictionary.

[0129] The present invention introduces the objective function, i.e., 100% dictionary coverage: for static corpus, ideally, the dictionary can cover nearly 100% of the word segmentation results of the Hanlp algorithm, and no new words are found in the corpus as the end point of the algorithm iteration. The initial dictionary has only 50% coverage, and the remaining 50% relies on reasoning. In such a reasoning environment, no algorithm can guarantee that its reasoning results are 100% accurate. The quality of the reasoning environment affects the reasoning results. The better the quality of the reasoning environment, the better the reasoning results. The idea of ​​achieving everything in one step is an unrealistic logical starting point. Therefore, if Figure 6 As shown, through multiple rounds of algorithm iterations, the word segmentation algorithm's own dictionary and third-party dictionary become fewer and fewer, and the newly added dictionaries become more and more, and finally converge, and the three dictionaries are merged to obtain a "perfect dictionary".

[0130] The technical architecture of the new word discovery algorithm provided by the present invention is as follows: Figure 7 As shown in the figure, the technical architecture is designed based on the concept of streaming data computing and multi-process asynchronous parallelism, making full use of CPU and IO performance. A complete technical architecture includes three parts: input (Source), computing (Trans.) and output (Sink). The traditional technical architecture is a synchronous serial design, considering the persistent response and cache response of Source and Sink, and the essential difference between the CPU computing delay and memory consumption of Trans. If the three are designed synchronously and serially, all factors affecting "efficiency" and "stability" will be concentrated in the same process, which cannot reflect the advantages of professional division of labor and risk dispersion.

[0131] The technical architecture innovation of the new word discovery algorithm provided by the present invention is that Source, Trans., and Sink are managed and guarded separately through multiple parallel processes, and the processes communicate through Queues, thereby fully utilizing the CPU and IO. Specifically:

[0132] 1. Input and output are persisted to external storage, and Kafka is used to smooth out peaks and fill valleys.

[0133] 2. Externalize the Hanlp word segmentation application, which consumes a lot of memory and requires regular synchronization of the vocabulary, into a microservice cluster, allocate sufficient parallelism, and achieve stable memory management and asynchronous high-concurrency response.

[0134] 3. Externalize the global memory management of multiple processes to the Redis cache microservice cluster, aggregate the local calculation results of multiple processes and the process survival status monitoring results, and centralize the statistical output and global status control at the end of a round of iteration.

[0135] 4. Both Source and Sink implement long links with their upstream and downstream middleware applications Kafka, without the need for restart and initialization in multiple iterations.

[0136] 5. Trans. Process memory and Redis global memory can be selectively restarted and initialized in multiple rounds of iterations.

Claims

1. A new word discovery method based on reasoning, high confidence, and genetic iteration, characterized in that: The following steps are involved: Step 1: Update the word segmentation algorithm with its own dictionary after the t-1th round of iteration Third-party dictionaries provided by third-party databases And new dictionaries The dictionary Dict used to make up the tth iteration t ; Step 2: Obtain the candidate new word set of the tth iteration, obtain the candidate new words in the candidate new word set by direct inference of word segmentation, and obtain the candidate new words in the candidate new word set based on the elastic granularity, where: Obtaining candidate new words in the candidate new word set by direct word segmentation reasoning includes the following steps: The word segmentation algorithm is based on the dictionary Dict t Perform word segmentation on the current given corpus. If any word segmentation meets one of the following conditions, the current word segmentation will be considered as a candidate new word and added to the candidate new word set: Condition 1) The context of the current word is in the dictionary Dict t In the dictionary Dict, only the current word is not in the dictionary Dict t If the current word segmentation is highly likely to be a new word, it is added to the candidate new word set and globally counted; Condition 2) The current word segmentation is a combination of multiple single characters, and the word segmentation context of the current word segmentation is in the dictionary Dict t , the current segmented word composed of a combination of multiple single characters is most likely a new word, which is added to the candidate new word set and globally counted; Condition 3) The context of the current word is divided by a special symbol, and the current word is not in the dictionary Dict t In the above example, the current segmented word is most likely a new word, so it is added to the candidate new word set and globally counted; Obtaining a candidate new word in a candidate new word set based on the elastic granularity includes the following steps: On the basis of the minimum word granularity, the N nearest neighbor single word forms are combined to obtain the elastic granularity word through the nearest neighbor relationship, and the elastic granularity word is added as a candidate new word to the candidate new word set; Step 3: Perform global corpus statistics on the candidate new words in the candidate new word set. According to the statistical results, the candidate new words are divided into true new words, uncertain new words and false new words. True new words are added to the new dictionary after manual review. Thus, the newly added dictionary after the tth round of iteration is obtained Specifically include the following: definition: Word frequency index SF: Indicates the frequency of the current word appearing in the form of a single word, applicable to the smallest granularity word; TF: Indicates the frequency of the current word appearing in the form of a single word or a combined word. The characteristic is that there are word separators before and after the current word, which is suitable for flexible granularity word segmentation; Document number indicator DF: Indicates the number of documents in the current corpus where the current word appears; Sliding window frequency indicator WF: Indicates the frequency of the current word segmentation in the form of a sliding window. The characteristic is that the number of times the word segmentation occurs in a sliding window of the same size in a pure Chinese string without punctuation marks is ignored. Confidence indicators, including: The confidence index SF-IWF is applicable to the smallest granularity word segmentation; The confidence index TF-IWF is suitable for flexible granularity word segmentation; If the candidate new word in the candidate new word set is in the form of a single segmentation word, the segmentation frequency index SF, the document number index DF, the sliding window frequency index WF and the confidence index SF-IWF of the current candidate new word are calculated, where: If the candidate new word in the candidate new word set is in the form of combined segmentation, the word frequency index SF, document number index DF, sliding window frequency index WF and confidence index TF-IWF of the current candidate new word are calculated, where: The candidate new words with a confidence index of more than 95% in the candidate new word set are defined as true new words, the candidate new words with a confidence index between 5% and 95% are defined as uncertain new words, and the candidate new words with a confidence index below 5% are defined as false new words; Step 4: Search the dictionary for words that appear in the word segmentation algorithm and third-party dictionaries The word segmentation in the global corpus statistics is performed. For the single word segmentation form, its confidence index SF-IWF is calculated. For the combined word segmentation form, its confidence index TF-IWF is calculated. The word segmentation algorithm comes with a dictionary and third-party dictionaries The word segmentation outputs with confidence index below 5% will be deleted after manual review; Step 5: Repeat steps 1 to 4 for multiple rounds of iterations, so that the dictionary consisting of the word segmentation algorithm's own dictionary, third-party dictionaries, and newly added dictionaries can cover the word segmentation results of the word segmentation algorithm nearly 100%, and obtain a "perfect" dictionary.

2. A new word discovery method based on reasoning, high confidence, and genetic iteration as claimed in claim 1, characterized in that: In step 2, if the segmentation in the form of a single segmentation is not the nearest neighbor or the segmentation with a special part of speech does not need to be combined, the current segmentation does not need to form a flexible granularity segmentation.

3. A new word discovery method based on reasoning, high confidence, and genetic iteration as claimed in claim 1, characterized in that: In step 2, when combining the N single-word segmentations including the current segmentation and the single segmentation nearest to the current segmentation to obtain the elastic granularity segmentation, the frequency TF of the elastic granularity segmentation obtained by the combination in the local single article in the current corpus is counted, if: If the current participle is consistent with the previous N f The frequency of the elastic granularity segmentation formed by the combination of the segmentation words is equal to the frequency of the following N b The frequency of the elastic granularity segmentation formed by the combination of segmentations, where N f +N b =N-1, then the above N f participle and the current participle and the following N b The elastic granularity participle formed by the combination of the participles is taken as the candidate new word; If the current participle is consistent with the previous N f The frequency of the elastic granularity segmentation formed by the combination of the segmentations is greater than that of the following N b The frequency of the elastic granularity segmentation formed by the combination of the segmentation words, then the above N f The elastic granularity segmentation formed by combining the segmentation with the current segmentation is used as a candidate new word; If the current participle is consistent with the previous N f The frequency of the elastic granularity participle formed by the combination of the participles is less than that of the following N b The frequency of the elastic granularity segmentation formed by the combination of N segmentations, then the current segmentation is combined with the following N b The elastic granularity segmentation formed by the combination of segmentations is taken as the candidate new word.

4. The method for discovering new words based on reasoning, high confidence, and genetic iteration as claimed in claim 1, characterized in that: In step 3, during the manual review process, the intersection of the second, third or more manual reviews is taken, and all SF, TF, DF, WF, TF-IWF, and SF-IWF indicator results of truly new words are output on the manually reviewed page, and context examples are given for reference.

5. A distributed computing technology architecture implementation method for the new word discovery method based on reasoning, high confidence, and genetic iteration as claimed in claim 1, wherein the technology architecture includes three parts: input Source, calculation Trans., and output Sink, and is characterized in that: The following steps are involved: The input Source, calculation Trans., and output Sink are managed and guarded separately through multiple parallel processes, and the processes communicate through Queues to fully utilize the CPU and IO. Specifically: Persist the input source and output sink to external storage, and use Kafka to smooth out the peaks and fill the valleys; Externalize the word segmentation algorithm application into a microservice cluster, allocate sufficient parallelism, and achieve stable memory management and asynchronous high-concurrency response; Externalize the global memory management of multiple processes to the Redis cache microservice cluster, aggregate the local calculation results of multiple processes and process survival status monitoring, and centralize statistical output and global status control at the end of a round of iteration.

6. The method for implementing the technical architecture according to claim 5, characterized in that: Both the input Source and the output Sink have long links with their upstream and downstream applications, without the need for restart and initialization in multiple iterations.

7. The method for implementing the technical architecture according to claim 5, characterized in that: The computing Trans. process memory and Redis global memory can be selectively restarted and initialized in multiple rounds of iterations.

Citation Information

Patent Citations

  • Chinese new word discovery method based on novelty

    CN108509425A

  • Dictionary generation method and device, new word discovery method and device and electronic equipment

    CN109614499A