Python code retrieve empty list when analyzing terms of frequencies using twitter APIs

the result when I run the analysis to the tweets comes empty as below there is nothing wrong with the code but the result is an empty list!

result is below []

import re
import operator
import json
from collections import Counter
from nltk.corpus import stopwords
from nltk import bigrams
import string
from collections import defaultdict
import sys
com = defaultdict(lambda: defaultdict(int))
fname = '/content/covid19.json'
with open(file, 'r') as f:
  count_all = Counter()
  for line in f.readlines():
    if line.startswith('{'):
      tweet = json.loads(line)
      terms_only = [term for term in preprocess(tweet['text']) if term not in stop and not term.startswith(('@', '#'))]

Read more here:

Content Attribution

This content was originally published by Ahd Abu Alrob at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: