- 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 | Trigrams'n'Tags (TnT) Tagging
- NLP | Regex and Affix tagging
- NLP | Distributed Tagging with Execnet - Part 2
- NLP | Distributed Tagging with Execnet - Part 1
- Python | PoS Tagging and Lemmatization using spaCy
- 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
- How to Learn Python in 21 Days?
- Visualising ML DataSet Through Seaborn Plots and Matplotlib
- How to make a Google Translation API using Python?
- numpy.linalg.eig() Method in Python
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.
Improved By : shubham_singh