Analysis of MMSEG Chinese word segmentation algorithm

Source: Internet
Author: User

Analysis of Mmseg Chinese word segmentation algorithm

@author linjiexing

When developing Chinese search and Chinese thesaurus semantics, I use them to develop jcseg Open source project based on mmseg Chinese word segmentation algorithm . The use of the scene involves the creation of the search index Chinese word segmentation, new words found in Chinese word segmentation, semantic word vector space construction process of Chinese word segmentation and the article feature vector before the Chinese word segmentation, etc., the overall use down, feel jcseg is a very good open-source Chinese word breaker tool , and can be configured and open source, it can satisfy the Chinese word segmentation logic of very many scenes. This paper first uses jcseg to the most important mmseg algorithm analysis.

1. Contention of Chinese word segmentation algorithm

Before analyzing the mmseg algorithm, we first describe the basic history of Chinese word segmentation, which is detailed in Wu's "beauty of mathematics". I mainly talk about my thoughts. The thought flow of algorithmic development is in fact basically consistent with this history. Our intuitive thinking is very easy to be limited by our knowledge reserves and experience, for example, before we design the aircraft, think of the bionic way to simulate the flapping wing posture of the birds, until later aerodynamics found that the essence of flying is flapping wings can produce air vortex and give rise to the driving force, An object propelled by a propeller to a higher quality than air. The airplane was invented by this.

In the Chinese word of the road, has also traversed such a similar way of exploration.

Start. In order to achieve a reasonable Chinese word segmentation. What we can think of is the use of the grammatical rules that linguists have summed up, according to the traditional "punctuation" cut, to the sentence participle. But. We know that very many famous verses or literary statements are not from the normal grammar, and even some colloquial statements do not satisfy the grammatical rules, but do not affect the recognition of people, and may be spread through the ages of innovation.

So. The limited definition of intuition does not satisfy the ever-changing language environment.

After IBM spends a lot of time and effort. It is impossible to find a way to take traditional thinking. Turn to the popular statistical language model today. I personally understand the statistical model. In essence, the grammatical rules of linguists also come from the statistics and induction of large numbers of corpus. and organized into a limited number of grammatical rules by personal or expert team, but this grammatical rule is constrained to be limited, thus not satisfying the possibility of human wireless creation--in the perspective of probability, grammatical rules may be able to cover a possible event within a standard deviation (in fact. And not to this coverage). But other small probability events are not covered, even with the evolution of time, the rapid addition of corpora, the long tail effect and the existence of innovative effects, coverage is reduced faster. Using a finite, non-exhaustive approach is a very difficult way to cope with infinite expansion. At this point, machine learning based on statistics has gained the upper hand of practice.

to the present. There are a lot of Chinese word segmentation algorithms based on statistical theory, and there are very many mature products. Although they do not achieve the hundred percent correct rate in practice, but in a very many application scenarios have been able to meet the requirements, the suitability of a grammar-based approach is much superior.

Of course, the path to exploration means never-ending, with a statistical model.

Different algorithm models also have different adaptation scenarios. You can try it on your own. The scenes I used to use the mmseg algorithm can have very good results, so there is no further insight into the principles of other algorithms. It is not possible to give a more objective comparison in the interim.

2. Mmseg Algorithm principle

As mentioned above, themmseg algorithm is based on the statistical model, so the rule of the algorithm is also from the corpus analysis and induction, the author summarizes the rules of the word segmentation according to the corpus, divided into four steps. The original algorithm is http://technology.chtsai.org/mmseg/ .

Detailed rules such as the following:

① Rule 1, maximum match: Assuming that the word can find a simple word match, it is thought that the term is a participle of the word

Similar. The word "internationalization", through the dictionary participle. Can have such as the following participle results

1. International _ 2. International _ of 3. Internationalization

1. C1_c2_c32. C1c2_c33. C1_c2c34. C1c2c3

It can be seen that "internationalization" has a completely corresponding word, that is, the term is a word.

The rule summary is for example the following:

Select c1c2c3 mode

② Rule 2, maximum average vocabulary length. If Word segmentation does not meet rule 1, use rule 2:

Similar. Word "Nanjing Yangtze River Bridge", the participle results may be as follows

1. Nanjing _ Changjiang  River Bridge-the average word length is 7/2=3.52. Nanjing-Mayor-Jiang Bridge  -average word length is 7/3=2.3

Induction of the rule is the first type of word segmentation, it can be seen that this rule is compatible with the first rule

1. c1c2_c3c4c5c62. C1c2_c3c4_c5c6

③ Rule 3, the minimum word rectangle difference. If the rule ② is not established, rule three is performed. This rule is related to our usual language, generally we in the organization statement, in order to be catchy, often uses the lexical composition length to be consistent.

For example, "happiness _ Happy", "the beginning of human _ good", "a gentleman a word, irrevocable."

Similarly, the word "Study Life science"

1. Graduate student _ science-  -the word rectangle difference 0.822. Study _ Life _ science-  -the word rectangle difference 0

The above average word length is 2, but the word rectangular difference is inconsistent. According to the rule ③. Choose another word-breaker, such rules can be summed up as

1. _c1c2_c3c4_c5c6_2. _c1c2c3_c4_c5c6_


④ Rule 4. Maximum word freedom.

The so-called single degree of freedom can be easily understood as the number of contexts in which the word appears alone. For example, "" is often used as an attribute modifier, often out of today's various contexts. But "the" occasionally also with other words form an idiom. For example, "purpose" and so on, such a combination will affect the degree of freedom of the word modifier.

About degrees of freedom and solidification. Later in the "New word discovery" in the discussion. This inference is mainly the use of the existence of the word in the scene.

In the case that the rule ③ is not established, the inference of the rule ④.

1. Make up _ and (10) _ Clothing 2. Make-Up _ Kimono _ Pack (3)

This rule is summed up as ( remark, the above degrees of freedom belongs to the individual ) The average word length and the word rectangle difference is the same, but the freedom of the words is different. Select the first type of word breaker

1. _c1c2_c3_c4c5_

2. _c1c2_c3c4_c5_

Compare the Freedom (C3) to Freedom (C5)

3. Error condition of the algorithm

The error case of this algorithm can be described in the example of Errors section of the original paper. Individual errors can be avoided, especially the word freedom, which is mainly a corpus training problem. Some problems can be solved by finding new words. Review the constraint to be able to infer whether or not to meet your own application scenario.

4. Summary

Can feel this algorithm elaboration or is very refined beautiful, in very many scenarios are also very strong. Perhaps an analysis will be made of jcseg based on mmseg algorithm Open source .

Analysis of MMSEG Chinese word segmentation algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.