does ValueError: 'rat' is not in list means not exist in tokenizer
Does this error means that the word doesn't exist in the tokenizer
return sent.split( ).index(word)
ValueError: 'rat' is not in list
the code sequences like
def sentences():
for sent in sentences:
token = tokenizer.tokenize(sent)
for i in token :
idx = get_word_idx(sent,i)
def get_word_idx(sent: str, word: str):
return sent.split( ).index(word)
sentences split returns ['long', 'restaurant', 'table', 'with', 'rattan', 'rounded', 'back', 'chairs']
which rattan
here is the problem as i think
Topic bert tokenization word-embeddings nlp
Category Data Science