96abhishekarora commited on
Commit
9061724
1 Parent(s): de30f05

finalise args

Browse files
Files changed (1) hide show
  1. AmericanStories.py +7 -1
AmericanStories.py CHANGED
@@ -5,6 +5,7 @@ import datasets
5
  import os
6
  import requests
7
  import re
 
8
 
9
 
10
 
@@ -33,9 +34,14 @@ def make_year_file_splits(data_dir):
33
  def make_year_file_splits(data_dir):
34
  base_url="https://huggingface.co/datasets/dell-research-harvard/AmericanStories/resolve/main/"
35
 
36
- year_list=["1774","1804","1807"]
 
 
 
37
  data_files=[f"faro_{year}.tar.gz" for year in year_list]
38
  url_list=[base_url+file for file in data_files]
 
 
39
  splits={year:file for year,file in zip(year_list,url_list)}
40
  years=year_list
41
 
 
5
  import os
6
  import requests
7
  import re
8
+ from tqdm import tqdm
9
 
10
 
11
 
 
34
  def make_year_file_splits(data_dir):
35
  base_url="https://huggingface.co/datasets/dell-research-harvard/AmericanStories/resolve/main/"
36
 
37
+ # year_list=["1774","1804","1807"]
38
+ ###MAke a list of years from 1774 to 1960
39
+ print("Collecting all list of available files for each year")
40
+ year_list=[str(year) for year in range(1774,1960)]
41
  data_files=[f"faro_{year}.tar.gz" for year in year_list]
42
  url_list=[base_url+file for file in data_files]
43
+ ###Keep only valid urls
44
+ # url_list=[url for url in tqdm(url_list) if requests.get(url).status_code==200]
45
  splits={year:file for year,file in zip(year_list,url_list)}
46
  years=year_list
47