text_plain_output_1.png
from tensorflow.keras.preprocessing.text import Tokenizer

import json

dataset = []
for line in open('/kaggle/input/news-headlines-dataset-for-sarcasm-detection/Sarcasm_Headlines_Dataset.json', 'r'):
    dataset.append(json.loads(line))
    json.load

article_link = []
headline = []
is_sarcastic = []

for item in dataset:
    article_link.append(item['article_link'])
    headline.append(item['headline'])
    is_sarcastic.append(item['is_sarcastic'])

token = Tokenizer(oov_token='<oov>')

token.fit_on_texts(headline)
word_index = token.word_index
len(word_index)

seq = token.texts_to_sequences(headline)
padded = pd(seq, padding='post')
padded[0]