The second course of natural language processing, Stanford University, "Text Processing basics (Basic text Processing)"

Source: Internet
Author: User

Text Processing Basics 1. Regular Expressions (Regular Expressions)

Regular expressions are important text preprocessing tools.
Part of the regular notation is truncated below:



2. Participle (word tokenization)

We work with uniform normalization (text normalization) for every single text processing.

  • Text size How many words?

    We introduce variable type and token
    Represents the elements in the dictionary (an element of the vocabulary) and the presence of this element in the article (an instance of this type in running text).

    If you define N = number of tokens and V = Vocabulary = set of types,| v| Is the size of the vocabulary, then according to the research work of Church and Gale (1990), we know: | v| > O (N?), we can see the above conclusions from the statistics of Shakespeare works and Google multivariate models, among others:

  • Word Segmentation algorithm:

    Sometimes we implement non-alphabetic characters as token separators as a simple word breaker, but there are a number of disadvantages like:

    • Finland ' s capital–> Finland finlands Finland ' s?
    • What ' Re, I ' m, isn ' t and what's, I am, is not
    • Hewlett-Packard, Hewlett Packard?
    • lowercase, lower-case lowercase lower case?
    • 。。。
      Although the above method is effective in the language of English, which contains fixed separators, there is no space between words such as Chinese and Japanese.

    Chinese word tokenization in Chinese or word segmentation, the simplest and most commonly used method is called the maximum matching method maximum Matching (also called greedy)

    Where the forward maximum matching method FFM steps as follows (forward Maximum Matching):

    • Forward from the back to the word, the dictionary to match the words
    • If no match succeeds, delete the last word and continue the match.
    • Repeat 2 steps until the match succeeds, then take the matched word out as a successful word fragment and continue to match the remaining words (the ones that were deleted earlier)

    The specific method can refer to this article:
    Http://blog.sina.com.cn/s/blog_53daccf401011t74.html

  • Normalization of text (normalization):

    It mainly includes capitalization conversion, stemming, simplified conversion and so on.

  • Segmentation (sentence segmentation and decision Trees):

    Like!? Such symbols are clearly divided in meaning, but in English. " "will be used in a variety of scenarios, such as the abbreviation" INC "," Dr ",". 2% "," 4.3 "and so on, can not be processed by simple regular expression, we introduced the decision tree classification method to determine whether the sentence is interrupted endofsentence/ Notendofsentence:

    We can solve the problem by using the decision tree, we can also use other classification methods based on the above characteristics such as: Logistic regression, SVM, neural network and so on.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The second course of natural language processing, Stanford University, "Text Processing basics (Basic text Processing)"

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.