init
Browse files- download_audio.py +2 -2
download_audio.py
CHANGED
@@ -96,11 +96,11 @@ def wget(url: str, output_file: Optional[str] = None):
|
|
96 |
|
97 |
def get_metadata():
|
98 |
url_metadata = url_metadata_dict[direction]
|
99 |
-
meta_data_filename = os.path.basename(url_metadata)
|
100 |
meta_data_path = p_join("download", "meta", meta_data_filename)
|
101 |
if not os.path.exists(meta_data_path):
|
102 |
assert wget(url_metadata, output_file=meta_data_path)
|
103 |
-
df = pd.read_csv(meta_data_path, sep=r'[\t\s]', header=None)[[0, 2, 6, 9, 10, 11, 12]]
|
104 |
df.columns = ["id", "url", "text_lid_score", "laser_score", "direction", "side", "line_no"]
|
105 |
assert len(df["direction"].unique()) == 1
|
106 |
df.pop("direction")
|
|
|
96 |
|
97 |
def get_metadata():
|
98 |
url_metadata = url_metadata_dict[direction]
|
99 |
+
meta_data_filename = os.path.basename(url_metadata)
|
100 |
meta_data_path = p_join("download", "meta", meta_data_filename)
|
101 |
if not os.path.exists(meta_data_path):
|
102 |
assert wget(url_metadata, output_file=meta_data_path)
|
103 |
+
df = pd.read_csv(meta_data_path.replace(".gz", ""), sep=r'[\t\s]', header=None)[[0, 2, 6, 9, 10, 11, 12]]
|
104 |
df.columns = ["id", "url", "text_lid_score", "laser_score", "direction", "side", "line_no"]
|
105 |
assert len(df["direction"].unique()) == 1
|
106 |
df.pop("direction")
|