Articles → NLP → Chinking In NLPChinking In NLPThis article describes chinking in NLP.Purpose The chinking is the process of removing specific words (or sequences) from a chunk that was created during chunking.Consider the following example: -The quick brown fox jumps over the lazy dogIn the above example, the word jumps is a verb, and the word over is a preposition. So, the words jumps and over should not be a part of a noun phrase. In chinking, we remove these words.NounA noun is a word that names a person, place, thing, or idea. Example: The dog is barking.VerbA verb is a word that shows an action or a state of being. Example: She runs every morning.PrepositionA preposition is a word that shows the relationship between a noun and another word in a sentence. It often tells us about place, time, direction, or position. Example: The book is on the table.Example Consider the following example.import nltk from nltk import pos_tag, word_tokenize, RegexpParser sentence = "The quick brown fox jumps over the lazy dog" tokens = word_tokenize(sentence) tagged = pos_tag(tokens) # First, chunk everything grammar = r""" NP: {<.*>+} # Chunk everything }<VB.*|IN>+{ # Chink verbs AND prepositions """ chunk_parser = RegexpParser(grammar) tree = chunk_parser.parse(tagged) print(tree)Output Posted By - Karan Gupta Posted On - Thursday, September 4, 2025 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
The quick brown fox jumps over the lazy dog
A noun is a word that names a person, place, thing, or idea. Example: The dog is barking.
A verb is a word that shows an action or a state of being. Example: She runs every morning.
A preposition is a word that shows the relationship between a noun and another word in a sentence. It often tells us about place, time, direction, or position. Example: The book is on the table.
import nltk from nltk import pos_tag, word_tokenize, RegexpParser sentence = "The quick brown fox jumps over the lazy dog" tokens = word_tokenize(sentence) tagged = pos_tag(tokens) # First, chunk everything grammar = r""" NP: {<.*>+} # Chunk everything }<VB.*|IN>+{ # Chink verbs AND prepositions """ chunk_parser = RegexpParser(grammar) tree = chunk_parser.parse(tagged) print(tree)
Query/Feedback