print('Accuracy:', good / total)
sentences = [('select the files', lambda tags: ('select', 'VB') in tags), (
    'use the select function on the sockets', lambda tags: ('select', 'JJ') in
    tags and ('use', 'VB') in tags), ('the select was good', lambda tags: (
    'select', 'NN') in tags)]
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