Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to try tagging without the context, you are looking for some sort of a unigram tagger, aka <code>looup tagger</code>. <strong>A unigram tagger tags a word solely based on the frequency of the tag given a word</strong>. So it avoids the context heuristics, however for any tagging task you must have data. And for the unigrams you need annotated data to train it. See the <code>lookup tagger</code> in the nltk tutorial <a href="http://nltk.googlecode.com/svn/trunk/doc/book/ch05.html" rel="nofollow noreferrer">http://nltk.googlecode.com/svn/trunk/doc/book/ch05.html</a>. </p> <p>Below is another way of training/testing an unigram tagger in <code>NLTK</code></p> <pre><code>&gt;&gt;&gt; from nltk.corpus import brown &gt;&gt;&gt; from nltk import UnigramTagger as ut &gt;&gt;&gt; brown_sents = brown.tagged_sents() # Split the data into train and test sets. &gt;&gt;&gt; train = int(len(brown_sents)*90/100) # use 90% for training # Trains the tagger &gt;&gt;&gt; uni_tag = ut(brown_sents[:train]) # this will take some time, ~1-2 mins # Tags a random sentence &gt;&gt;&gt; uni_tag.tag ("this is a foo bar sentence .".split()) [('this', 'DT'), ('is', 'BEZ'), ('a', 'AT'), ('foo', None), ('bar', 'NN'), ('sentence', 'NN'), ('.', '.')] # Test the taggers accuracy. &gt;&gt;&gt; uni_tag.evaluate(brown_sents[train+1:]) # evaluate on 10%, will also take ~1-2 mins 0.8851469586629643 </code></pre> <p>I wouldn't recommend using WordNet for pos tagging because just are sooo many words that are still has no entry in wordnet. But you can take a look at using lemma frequencies in wordnet, see <a href="https://stackoverflow.com/questions/15551195/how-to-get-the-wordnet-sense-frequency-of-a-synset-in-nltk">How to get the wordnet sense frequency of a synset in NLTK?</a>. These frequencies are based on the SemCor corpus (<a href="http://www.cse.unt.edu/~rada/downloads.html" rel="nofollow noreferrer">http://www.cse.unt.edu/~rada/downloads.html</a>) </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload