Spaces:
Running on Zero
Running on Zero
File size: 506 Bytes
45c8776 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import pandas as pd
protocol_file = "dataset/LA/ASVspoof2019_LA_cm_protocols/ASVspoof2019.LA.cm.dev.trl.txt"
rows = []
with open(protocol_file, "r") as f:
for line in f:
parts = line.strip().split()
filename = parts[1] + ".flac"
label = parts[-1]
rows.append([filename, label])
df = pd.DataFrame(rows, columns=["file_name", "label"])
print(df.head())
df.to_csv("dataset/dev_labels.csv", index=False)
print("\nSaved Successfully!")
print("Total Files:", len(df)) |