The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

vojko (4) [Avatar] Offline
#1
Hi,

In Listing 6.6:

pad_sequences(x_train, maxlen = maxlen)


truncates the sequence from the begining, so we look at the last 20 words in every review?

Thanks!
256385 (47) [Avatar] Offline
#2
There is a "truncating" argument that controls this behavior: https://keras.rstudio.com/reference/pad_sequences.html
vojko (4) [Avatar] Offline
#3
Yes, I understand that, I was referring to the explanation in text :

"You get to a validation accuracy of ~76%, which is pretty good considering that you’re only looking at the first 20 words in every review".

Thx!
256385 (47) [Avatar] Offline
#4
Indeed, I see that now! Just fixed within the manuscript.