write a function called cky_parsing that accepts a list of sentences to be parsed and the PCFG used for parsing. This function should construct a set of known words present in the given productions. Initialize a viterbi parser using the pcfg. Iterate over each sentence in sentences:
Tokenize the sentence.Replace any word not found in the set of known words with . Parse the sentence using the Viterbi parser. Select the parse with the highest probability, or handle cases where no valid parse is found (check the parse_all method of the ViterbiParser object from the nltk.parse library). Return a list of tuples. one tuple per sentence made of the index of the sentence within the input list, the original sentence, the best parse tree found or an appropriate value indicating he grammatical structure of sentences.