- It is a subclass of ClassifierBasedTagger that uses classification technique to do part-of-speech tagging.
- From the words, features are extracted and then passed to an internal classifier.
- It classifies the features and returns a label i.e. a part-of-speech tag.
- The feature detector finds multiple length suffixes, does some regular expression matching, and looks at the unigram, bigram, and trigram history to produce a fairly complete set of features for each word
Code #1 : Using ClassifierBasedPOSTagger
Accuracy : 0.9309734513274336
ClassifierBasedPOSTagger class inherits from ClassifierBasedTagger and only implements a feature_detector() method. All the training and tagging is done in ClassifierBasedTagger.
Code #2 : Using MaxentClassifier
Accuracy : 0.9258363911072739
custom feature detector detecting features
There are two ways to do it:
- Subclass ClassifierBasedTagger and implement a feature_detector() method.
- Pass a function as the feature_detector keyword argument into ClassifierBasedTagger at initialization.
Code #3 : Custom Feature Detector
Accuracy : 0.8733865745737104
- NLP | WordNet for tagging
- NLP | Regex and Affix tagging
- NLP | Trigrams'n'Tags (TnT) Tagging
- Python | PoS Tagging and Lemmatization using spaCy
- NLP | Distributed Tagging with Execnet - Part 1
- NLP | Distributed Tagging with Execnet - Part 2
- NLP | Backoff Tagging to combine taggers
- NLP | Part of Speech - Default Tagging
- Python | Part of Speech Tagging using TextBlob
- Part of Speech Tagging with Stop words using NLTK in python
- rangev2 - A new version of Python range class
- How Should a Machine Learning Beginner Get Started on Kaggle?
- Python | Binary Group Tuple list elements
- Python | OCR on All the Images present in a Folder Simultaneously
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.