Skip to content

Commit

Permalink
update jnv and jvnv
Browse files Browse the repository at this point in the history
  • Loading branch information
bagustris committed Feb 4, 2025
1 parent badb8fa commit 3978a91
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
9 changes: 5 additions & 4 deletions data/jnv/exp.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[EXP]
root = ./tmp
name = exp_jnv_hubert_knn
root = ./results
name = exp_jnv_hubert
runs = 1
epochs = 1
save = True
Expand All @@ -19,12 +19,13 @@ test.type = csv
test.absolute_path = False
test.split_strategy = test
target = emotion
; labels = ['angry', 'disgust', 'surprise', 'sad']
labels = ['angry', 'disgust', 'surprise', 'sad']
[FEATS]
type = ['hubert-xlarge-ll60k']
; scale = standard
[MODEL]
type = knn
type = svm
; save = True
C_val = 10
[RESAMPLE]
replace = True
8 changes: 7 additions & 1 deletion data/jnv/process_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ def main(args):
train_df, dev_df, test_df = np.split(df.sample(frac=1, random_state=42), [
int(.8 * len(df)), int(.9 * len(df))])

# print number of files in each set
print(f"Number of files in train set: {len(train_df)}")
print(f"Number of files in dev set: {len(dev_df)}")
print(f"Number of files in test set: {len(test_df)}")
print(f"Number of files in total: {len(df)}")

train_df.to_csv(os.path.join(output_dir, "jnv_train.csv"), index=False)
dev_df.to_csv(os.path.join(output_dir, "jnv_dev.csv"), index=False)
test_df.to_csv(os.path.join(output_dir, "jnv_test.csv"), index=False)
Expand All @@ -38,7 +44,7 @@ def main(args):
parser.add_argument(
"--data_dir",
type=str,
default="jnv_corpus_ver2/JNV/",
default="JNV/",
help="Directory containing audio files")
parser.add_argument(
"--output_dir",
Expand Down
1 change: 1 addition & 0 deletions data/jvnv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

```bash
wget https://ss-takashi.sakura.ne.jp/corpus/jvnv/jvnv_ver1.zip
unzip jvnv_ver1.zip
# process the database, need to add nkululeko to use find_files function
python3 process_database.py
cd ../..
Expand Down
9 changes: 5 additions & 4 deletions data/jvnv/exp.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[EXP]
root = /tmp/results/
name = exp_jvnv_hubert_all
root = ./results/
name = exp_jvnv_hubert
; runs = 1
; epochs = 1
; save = True
Expand All @@ -19,14 +19,15 @@ test.type = csv
test.absolute_path = False
test.split_strategy = test
target = emotion
; labels = ['anger', 'fear', 'sad', 'happy']
labels = ['anger', 'fear', 'sad', 'happy']
; get the number of classes from the target column automatically
[FEATS]
type = ['hubert-xlarge-ll60k']
; no_reuse = False
scale = standard
[MODEL]
type = knn
type = svm
; save = True
C_val = 10
[RESAMPLE]
replace = True
3 changes: 3 additions & 0 deletions data/jvnv/process_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def process_database(data_dir, output_dir):
writer.writerow(["file", "emotion", "gender"])
writer.writerows(set_data)

# print number of files in each set
for set_name, set_data in data.items():
print(f"Number of files in {set_name} set: {len(set_data)}")
print("Database processing completed.")


Expand Down

0 comments on commit 3978a91

Please sign in to comment.