I have the code below:
import nltk
exampleArray = ['The dog barking']
def processLanguage():
for item in exampleArray:
tokenized = nltk.word_tokenize(item)
tagged = nltk.pos_tag(tokenized)
print(tagged)
processLanguage()
The output of the code above are the tokenized words with their corresponding parts of speech. Example :
[('The', 'DT'), ('dog', 'NN'), ('barking', 'NN'), ('.', '.')]
DT = determiner
NN = noun
The text is supposed to be
The dog is barking
and supposed to have the POS sequence of
DT -> NN -> VBZ -> VBG
VBZ = verb, present tense, 3rd person singular
VBG = verb, present participle or gerund
How will I make the program locate within the sentence the position of the missing word?