For your problem, if I say you can use the NLTK library, then I’d also want to say that there is not any perfect method in machine learning that can fit your model properly. So you have to try some different techniques also to get the best accuracy on unknown data.
There is a class in NLTK called perceptron tagger, which can help your model to return correct parts of speech.
>>> import inspect
>>> print inspect.getsource(pos_tag)
def pos_tag(tokens, tagset=None):
tagger = PerceptronTagger()
return _pos_tag(tokens, tagset, tagger)
Still, it's better but not perfect:
>>> from nltk import pos_tag
>>> pos_tag("The quick brown fox jumps over the lazy dog".split())
[('The', 'DT'), ('quick', 'JJ'), ('brown', 'NN'), ('fox', 'NN'), ('jumps', 'VBZ'), ('over', 'IN'), ('the', 'DT'), ('lazy', 'JJ'), ('dog', 'NN')]
The above code will improve the output of your model.
I hope this answer helps.