How to plot confusion matrix for RNN output

When doing the excersice questions from the RNN notebook, i am unable to tackle the questions 0 and 3.

They are:

  1. Compute language-wise accuracy, plot confusion matrix

  2. Increase performance by moving to GPUs

For 2, you just need to change the device to gpu and check the performance. Whereas in 1, the task is quite clear

I should have rephrased for the first mainly how to plot the confusion matrix is the primary doubt.

You can use sklearn to do that.
Refer this for more.

You can also inspire a bit from here for the confusion plot:
Evaluating the RNN results - PyTorch

Thanks @Ishvinder and @GokulNC :+1: