Sentiment Analysis: Using Recurrent Neural Networks

https://d2l.ai/chapter_natural-language-processing-applications/sentiment-analysis-rnn.html

according to the code without modifing, my result is below.
why different ???
image

there is a “UnicodeDecodeError” when using d2l.TokenEmbedding(‘glove.6b.100d’)

can anyone help me with it?

UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 2776: character maps to

You need to set the encoding to encoding=‘utf-8’ in the open function in the load_embedding method of the TokenEmbedding class in the d2l.torch file.