Skip to content
  • Language Processing and Python
    • 1.1 Computing with Language: Texts and Words
    • 1.2 A Closer Look at Python: Texts as Lists of Words
    • 1.3 Computing with Language: Simple Statistics
    • 1.4 Back to Python: Making Decisions and Taking Control
    • 1.5 Automatic Natural Language Understanding
  • Accessing Text Corporaand Lexical Resources
    • 2.1 Accessing Text Corpora
    • 2.2 Conditional Frequency Distributions
    • 2.3 More Python: Reusing Code
    • 2.4 Lexical Resources
    • 2.5 WordNet
  • Processing Raw Text
    • 3.1 Accessing Text from the Web and from Disk
    • 3.2 Strings: Text Processing at the Lowest Level
    • 3.3 Text Processing with Unicode
    • 3.4 Regular Expressions for Detecting Word Patterns
    • 3.5 Useful Applications of Regular Expressions
  • Writing Structured Programs
    • 4.1 Back to the Basics
    • 4.2 Sequences
    • 4.3 Questions of Style
    • 4.4 Functions: The Foundation of Structured Programming
    • 4.5 Doing More with Functions
  • Categorizing and Tagging Words
    • 5.1 Using a Tagger
    • 5.2 Tagged Corpora
    • 5.3 Mapping Words to Properties Using Python Dictionaries
    • 5.4 Automatic Tagging
    • 5.5 N-Gram Tagging
  • Sentiment Checker
iatl
    • 1.1 Computing with Language: Texts and Words
    • 1.2 A Closer Look at Python: Texts as Lists of Words
    • 1.3 Computing with Language: Simple Statistics
    • 1.4 Back to Python: Making Decisions and Taking Control
    • 1.5 Automatic Natural Language Understanding
    • 2.1 Accessing Text Corpora
    • 2.2 Conditional Frequency Distributions
    • 2.3 More Python: Reusing Code
    • 2.4 Lexical Resources
    • 2.5 WordNet
    • 3.1 Accessing Text from the Web and from Disk
    • 3.2 Strings: Text Processing at the Lowest Level
    • 3.3 Text Processing with Unicode
    • 3.4 Regular Expressions for Detecting Word Patterns
    • 3.5 Useful Applications of Regular Expressions
    • 4.1 Back to the Basics
    • 4.2 Sequences
    • 4.3 Questions of Style
    • 4.4 Functions: The Foundation of Structured Programming
    • 4.5 Doing More with Functions
    • 5.1 Using a Tagger
    • 5.2 Tagged Corpora
    • 5.3 Mapping Words to Properties Using Python Dictionaries
    • 5.4 Automatic Tagging
    • 5.5 N-Gram Tagging
  • Sentiment Checker
Search this website

Yearly Archives: 2026

  1. Home>
  2. 2026

5.5 N-Gram Tagging

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

Unigram TaggingUnigram taggers are based on a simple statistical algorithm: for each token, assign thetag that is most likely for that particular token. For example, it will assign the tag…

Continue Reading5.5 N-Gram Tagging

5.4 Automatic Tagging

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

In the rest of this chapter we will explore various ways to automatically add part-ofspeech tags to text. We will see that the tag of a word depends on the…

Continue Reading5.4 Automatic Tagging

5.3 Mapping Words to Properties Using Python Dictionaries

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

As we have seen, a tagged word of the form (word, tag) is an association between aword and a part-of-speech tag. Once we start doing part-of-speech tagging, we will becreating…

Continue Reading5.3 Mapping Words to Properties Using Python Dictionaries

5.2 Tagged Corpora

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

Representing Tagged TokensBy convention in NLTK, a tagged token is represent ed using a tuple consisting of thetoken and the tag. We can create one of these special tuples from…

Continue Reading5.2 Tagged Corpora

5.1 Using a Tagger

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

A part-of-speech tagger, or POS tagger, processes a sequence of words, and attachesa part of speech tag to each word (don’t forget to import nltk): text = nltk.word_tokenize("And now for…

Continue Reading5.1 Using a Tagger

4.5 Doing More with Functions

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

So far the arguments we have passed into functions have been simple objects, such asstrings, or structured objects, such as lists. Python also lets us pass a function as anargument…

Continue Reading4.5 Doing More with Functions

4.4 Functions: The Foundation of Structured Programming

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

Functions provide an effective way to package and reuse program code, as alreadyexplained in Section 2.3. For example, suppose we find that we often want to read textfrom an HTML…

Continue Reading4.4 Functions: The Foundation of Structured Programming

4.3 Questions of Style

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

Programming is as much an art as a science. The undisputed “bible” of programming,a 2,500 page multivolume work by Donald Knuth, is called The Art of Computer Programming. Many books…

Continue Reading4.3 Questions of Style

4.2 Sequences

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

So far, we have seen two kinds of sequence object: strings and lists. Another kind ofsequence is called a tuple. Tuples are formed with the comma operator , and typicallyenclosed…

Continue Reading4.2 Sequences

4.1 Back to the Basics

  • Post author:Syeiba
  • Post published: November 3, 2026
  • Post category:Uncategorized
  • Post comments:0 Comments

AssignmentAssignment would seem to be the most elementary programming concept, not deserving a separate discussion. However, there are some surprising subtleties here. Considerthe following code fragment: foo = 'Monty'bar =…

Continue Reading4.1 Back to the Basics
  • 1
  • 2
  • 3
  • Go to the next page
Copyright - WordPress Theme by OceanWP