Skip to content Skip to sidebar Skip to footer

How To Get Common Tag Pattern For Sentences List In Python With Nltk

Here I have a list of sentences.With NLTK I can tag the sentence and get the tag pattern of that sentences. So as like this I can get the tag patterns for the whole list.But what I

Solution 1:

It sounds like you are after a regexp (with quantifiers) that will match all the different tag sequences in your data. While this is not an easy problem, I suspect that your goal is to find a pattern that captures the sequences that are legal sentences, is this right?

If so, regexps (and finite-state approaches in general) are inherently the wrong tool for the job. To even get a start on characterizing your sentence collection, you need to look at context-free grammars. Take a look at the NLTK's materials on the topic.

Post a Comment for "How To Get Common Tag Pattern For Sentences List In Python With Nltk"