MarMont commited on
Commit
eeaa85e
1 Parent(s): 310771b

fixed keywords

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -38,12 +38,7 @@ client = tweepy.Client(bearer_token=bearer_token)
38
  nlp = spacy.load('en_core_web_lg')
39
  print('hi')
40
 
41
- def scrape(keyword_list):
42
- if len(keyword_list) > 1:
43
- keywords = '(' + ' OR '.join(keyword_list) + ')'
44
- else:
45
- keywords = keyword_list[0]
46
-
47
  query = keywords + ' (lang:en OR lang:tl) -is:retweet'
48
  max_results = 100
49
  tweet_fields=['geo', 'id', 'lang', 'created_at']
@@ -513,9 +508,12 @@ def main(dataset, model):
513
  "taft"
514
  ]
515
  keyword_list = dataset.split(',')
516
- keyword_list = ' OR '.join(keyword_list)
 
 
 
517
  if dataset in examples:
518
- df = get_example(keyword_list)
519
  place_data = 'test'
520
  else:
521
  print(dataset)
 
38
  nlp = spacy.load('en_core_web_lg')
39
  print('hi')
40
 
41
+ def scrape(keywords):
 
 
 
 
 
42
  query = keywords + ' (lang:en OR lang:tl) -is:retweet'
43
  max_results = 100
44
  tweet_fields=['geo', 'id', 'lang', 'created_at']
 
508
  "taft"
509
  ]
510
  keyword_list = dataset.split(',')
511
+ if len(keyword_list) > 1:
512
+ keywords = '(' + ' OR '.join(keyword_list) + ')'
513
+ else:
514
+ keywords = keyword_list[0]
515
  if dataset in examples:
516
+ df = get_example(keywords)
517
  place_data = 'test'
518
  else:
519
  print(dataset)