train_sents = [[('select', 'VB'), ('the', 'DT'), ('files', 'NNS')], [('use',
    'VB'), ('the', 'DT'), ('select', 'JJ'), ('function', 'NN'), ('on', 'IN'
    ), ('the', 'DT'), ('sockets', 'NNS')], [('the', 'DT'), ('select', 'NN'),
    ('files', 'NNS')]]
tagger = nltk.TrigramTagger(train_sents, backoff=default_tagger)
evaluate(tagger, sentences)
custom tagging with nltk