Natural Language Processing, automatic part-of-speech recognition is important. There are several ways to automatically detect parts of speech; this article discusses the use of a hidden Markov model based on the Viterbi algorithm using the Python environment.