Skip to content

index 152 is out of bounds for axis 1 with size 152 #2

Description

@sofldoc

Hi, I am receiving an out of bounds error where my review length is 150 + 2 tokens. The error is index 152 is out of bounds for axis 1 with size 152 and occurs on the last line. Please help.

in_dta = np.zeros((df_row_length, l_rev, len(vocabulary)), dtype='float32')

for review_index, row in enumerate(df.values):
review = row[0]
tg_dta[review_index] = row[1]
empty_spaces = (l_rev - len(review) - 1)
for char_index, char in enumerate(['\t'] + list(review) + ['\n'] * empty_spaces):
in_dta[review_index, char_index, ctoi[char]] - 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions