Даже когда я печатаю предложение, он выводит количество строк, разделенных запятыми. Вот мой код: -
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
import json
sentence = []
urls = []
labels = []
data = [json.loads(line) for line in open('Sarcasm_Headlines_Dataset.json', 'r')]
for item in data:
sentence.append(item["headline"])
urls.append(item['article_link'])
labels.append(item['is_sarcastic'])
print(sentence)
tokenizer = Tokenizer(oov_token="<00V>")
tokenizer = tokenizer.fit_on_texts(sentence)
word_index =tokenizer.word_index