Implement Beam Search Decoding to find the most likely sequence of words given a probability matrix. **Example:** Given a probability matrix [[0.1, 0.2, 0.7], [0.5, 0.3, 0.2]], the most likely sequence of words is the one with the highest probability. **Constraints:** The probability matrix is a 2D numpy array where each row represents a time step and each column represents a word in the vocabulary.
Test Cases
Test Case 1
Input:
[[[0.1, 0.2, 0.7], [0.5, 0.3, 0.2]]], 1Expected:
[0, 0]Test Case 2
Input:
[[[0.1, 0.2, 0.7], [0.5, 0.3, 0.2]]], 2Expected:
[0, 0]+ 3 hidden test cases