Skip to content

Commit 6328175

Browse files
committed
Use folder name to label ai or human.
1 parent 375aea4 commit 6328175

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

notebooklm_detector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def load_dataset(dataset_path):
3535
for file in files:
3636
if file.endswith('.wav') or file.endswith('.mp3') or file.endswith('.mp4'):
3737
file_path = os.path.join(root, file)
38-
label = 'ai' if 'ai' in file_path.lower() else 'human'
38+
last_folder = os.path.basename(os.path.dirname(file_path))
39+
label = 'ai' if 'ai' in last_folder.lower() else 'human'
3940
print(f'file: {file} / file_path: {file_path} => {label}')
4041
feature = extract_features(file_path)
4142
if feature is not None:

0 commit comments

Comments
 (0)