update
Browse files- .gitignore +2 -3
- data/52.zip +3 -0
- data/55.zip +3 -0
- data/60.zip +3 -0
- data/82.zip +3 -0
- data/es-MX.zip +1 -1
- data/ms-MY.zip +3 -0
- data/pt-BR.zip +2 -2
- examples/count.py +11 -7
- examples/make_test_audios.py +24 -60
.gitignore
CHANGED
|
@@ -9,13 +9,12 @@
|
|
| 9 |
|
| 10 |
data/es-MX
|
| 11 |
data/ko-KR
|
|
|
|
| 12 |
data/pt-BR
|
| 13 |
data/52
|
| 14 |
data/55
|
|
|
|
| 15 |
data/82
|
| 16 |
-
data/52.zip
|
| 17 |
-
data/55.zip
|
| 18 |
-
data/82.zip
|
| 19 |
/docs/
|
| 20 |
/dotenv/
|
| 21 |
/hub_datasets/
|
|
|
|
| 9 |
|
| 10 |
data/es-MX
|
| 11 |
data/ko-KR
|
| 12 |
+
data/ms-MY
|
| 13 |
data/pt-BR
|
| 14 |
data/52
|
| 15 |
data/55
|
| 16 |
+
data/60
|
| 17 |
data/82
|
|
|
|
|
|
|
|
|
|
| 18 |
/docs/
|
| 19 |
/dotenv/
|
| 20 |
/hub_datasets/
|
data/52.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d8b9bcc625e9b1fb4b13f203e2eb991898f6eef24df1ae6a9e3a647b1439eb0
|
| 3 |
+
size 8638469
|
data/55.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cdb73b434ca9fa7d53c76602e03c2081fd7a987b60dcca1a641c32462b92b26d
|
| 3 |
+
size 4960160
|
data/60.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f10d9f49d7357c637347af575a6f5791d1c66b89560e0a342691ae01c6df314
|
| 3 |
+
size 6007685
|
data/82.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:501f4bb4025f4333807bae70776e333717b3631021915dde26522a2804e4d237
|
| 3 |
+
size 12797706
|
data/es-MX.zip
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 8678165
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8368179805334ad077cef6fa432090b1dff5cae5bc2e78e4d2cff0c0ca2977b8
|
| 3 |
size 8678165
|
data/ms-MY.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0711d203a28b81f0cde0a11490f0b6a27e496e519deba4b75fcd1dd72778ddaf
|
| 3 |
+
size 6288133
|
data/pt-BR.zip
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5a5ef0c7ffacfc7219108f3e73863563e2ef1367f4ef1d601e500dd1af35f65
|
| 3 |
+
size 5944334
|
examples/count.py
CHANGED
|
@@ -19,11 +19,10 @@ def get_args():
|
|
| 19 |
parser = argparse.ArgumentParser()
|
| 20 |
parser.add_argument(
|
| 21 |
"--src_dir",
|
| 22 |
-
# default=
|
| 23 |
-
# default=r"D:\Users\tianx\HuggingDatasets\
|
| 24 |
-
# default=r"D:\Users\tianx\HuggingDatasets\
|
| 25 |
-
default=r"D:\Users\tianx\HuggingDatasets\calling_analysis\data\
|
| 26 |
-
# default=r"D:\Users\tianx\HuggingDatasets\international_voice\data\sea-idn\audio_lib_hkg_1\sea-bra-mex-audio-lib-20250923-24\audio_lib\es-MX",
|
| 27 |
type=str
|
| 28 |
)
|
| 29 |
args = parser.parse_args()
|
|
@@ -48,13 +47,18 @@ def main():
|
|
| 48 |
**dict(counter)
|
| 49 |
})
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
connected_count = 0
|
| 52 |
for k, v in counter.items():
|
| 53 |
-
print(f"{k}: {v}, {v}%")
|
| 54 |
|
| 55 |
if not k.endswith("not_connected"):
|
| 56 |
connected_count += v
|
| 57 |
-
print(f"connected_count: {connected_count}")
|
| 58 |
return
|
| 59 |
|
| 60 |
|
|
|
|
| 19 |
parser = argparse.ArgumentParser()
|
| 20 |
parser.add_argument(
|
| 21 |
"--src_dir",
|
| 22 |
+
# default=r"D:\Users\tianx\HuggingDatasets\calling_analysis\data\es-MX",
|
| 23 |
+
# default=r"D:\Users\tianx\HuggingDatasets\calling_analysis\data\ko-KR",
|
| 24 |
+
# default=r"D:\Users\tianx\HuggingDatasets\calling_analysis\data\ms-MY",
|
| 25 |
+
default=r"D:\Users\tianx\HuggingDatasets\calling_analysis\data\pt-BR",
|
|
|
|
| 26 |
type=str
|
| 27 |
)
|
| 28 |
args = parser.parse_args()
|
|
|
|
| 47 |
**dict(counter)
|
| 48 |
})
|
| 49 |
|
| 50 |
+
total = 0
|
| 51 |
+
for k, v in counter.items():
|
| 52 |
+
total += v
|
| 53 |
+
|
| 54 |
+
|
| 55 |
connected_count = 0
|
| 56 |
for k, v in counter.items():
|
| 57 |
+
print(f"{k}: {v}, {round(v/total*100, 3)}%")
|
| 58 |
|
| 59 |
if not k.endswith("not_connected"):
|
| 60 |
connected_count += v
|
| 61 |
+
print(f"total: {total}, connected_count: {connected_count}")
|
| 62 |
return
|
| 63 |
|
| 64 |
|
examples/make_test_audios.py
CHANGED
|
@@ -14,77 +14,41 @@ def get_args():
|
|
| 14 |
parser = argparse.ArgumentParser()
|
| 15 |
parser.add_argument(
|
| 16 |
"--audio_dir",
|
| 17 |
-
default=(project_path / "data/
|
|
|
|
| 18 |
# default=(project_path / "data/pt-BR").as_posix(),
|
|
|
|
| 19 |
type=str
|
| 20 |
)
|
| 21 |
parser.add_argument(
|
| 22 |
"--output_dir",
|
| 23 |
-
default=(project_path / "data/
|
|
|
|
| 24 |
# default=(project_path / "data/55").as_posix(),
|
|
|
|
| 25 |
type=str
|
| 26 |
)
|
| 27 |
args = parser.parse_args()
|
| 28 |
return args
|
| 29 |
|
| 30 |
|
| 31 |
-
quantity_to_use1 = """
|
| 32 |
-
bell_and_mute: 2, 2%
|
| 33 |
-
bell_and_mute_1_second_then_voicemail: 1, 1%
|
| 34 |
-
bell_and_not_connected: 17, 17%
|
| 35 |
-
bell_and_voice: 1, 1%
|
| 36 |
-
bell_and_voicemail: 6, 6%
|
| 37 |
-
busy_and_not_connected: 11, 11%
|
| 38 |
-
busy_or_disconnected_or_out_of_coverage_and_not_connected: 1, 1%
|
| 39 |
-
disconnected_or_out_of_service_and_not_connected: 1, 1%
|
| 40 |
-
early_media_voicemail_and_not_connected: 11, 11%
|
| 41 |
-
early_media_voicemail_and_voicemail: 30, 30%
|
| 42 |
-
early_media_voicemail_is_full_and_not_connected: 9, 9%
|
| 43 |
-
music_and_voicemail: 2, 2%
|
| 44 |
-
mute_and_not_connected: 1, 1%
|
| 45 |
-
mute_and_voicemail: 2, 2%
|
| 46 |
-
out_of_service_and_not_connected: 2, 2%
|
| 47 |
-
unavailable_and_not_connected: 1, 1%
|
| 48 |
-
unavailable_or_out_of_service_and_not_connected: 2, 2%
|
| 49 |
-
|
| 50 |
-
"""
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
quantity_to_use2 = """
|
| 54 |
-
bell_and_di_then_mute: 3, 3%
|
| 55 |
-
bell_and_mute: 8, 8%
|
| 56 |
-
bell_and_mute_4_second_then_voicemail: 1, 1%
|
| 57 |
-
bell_and_noise_mute: 1, 1%
|
| 58 |
-
bell_and_not_connected: 8, 8%
|
| 59 |
-
bell_and_voice: 10, 10%
|
| 60 |
-
bell_and_voicemail: 6, 6%
|
| 61 |
-
blocked_or_cannot_receive_this_call: 2, 2%
|
| 62 |
-
busy_and_not_connected: 1, 1%
|
| 63 |
-
early_media_voicemail_and_di_then_mute: 5, 5%
|
| 64 |
-
early_media_voicemail_and_not_connected: 46, 46%
|
| 65 |
-
early_media_voicemail_and_not_connected2: 2, 2%
|
| 66 |
-
invalid_number: 2, 2%
|
| 67 |
-
mute_and_mute: 2, 2%
|
| 68 |
-
mute_and_noise_mute: 1, 1%
|
| 69 |
-
mute_and_not_connected: 1, 1%
|
| 70 |
-
unable_to_complete_this_call: 1, 1%
|
| 71 |
-
"""
|
| 72 |
-
|
| 73 |
-
|
| 74 |
quantity_to_use = """
|
| 75 |
-
bell_and_mute:
|
| 76 |
-
bell_and_noise_mute:
|
| 77 |
-
bell_and_not_connected:
|
| 78 |
-
bell_and_voice:
|
| 79 |
-
bell_and_voicemail:
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
music_and_noise_mute: 1, 1%
|
| 84 |
mute_and_not_connected: 2, 2%
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
"""
|
| 89 |
|
| 90 |
|
|
@@ -92,7 +56,7 @@ def main():
|
|
| 92 |
args = get_args()
|
| 93 |
audio_dir = Path(args.audio_dir)
|
| 94 |
output_dir = Path(args.output_dir)
|
| 95 |
-
output_dir.mkdir(parents=True, exist_ok=
|
| 96 |
suffix_count = 0
|
| 97 |
|
| 98 |
call_id_to_wav_file_list = defaultdict(list)
|
|
@@ -125,7 +89,7 @@ def main():
|
|
| 125 |
splits = filename.stem.split("_")
|
| 126 |
call_id = splits[3]
|
| 127 |
|
| 128 |
-
tgt_dir = output_dir / f"{suffix_count:
|
| 129 |
tgt_dir.mkdir(parents=True, exist_ok=True)
|
| 130 |
suffix_count += 1
|
| 131 |
wav_file_list = call_id_to_wav_file_list[call_id]
|
|
@@ -145,7 +109,7 @@ def main():
|
|
| 145 |
tgt_filename.as_posix(),
|
| 146 |
)
|
| 147 |
result.append({
|
| 148 |
-
"suffix": f"{suffix_count-1:
|
| 149 |
"label": folder_name
|
| 150 |
})
|
| 151 |
result = pd.DataFrame(result)
|
|
|
|
| 14 |
parser = argparse.ArgumentParser()
|
| 15 |
parser.add_argument(
|
| 16 |
"--audio_dir",
|
| 17 |
+
# default=(project_path / "data/es-MX").as_posix(),
|
| 18 |
+
# default=(project_path / "data/ko-KR").as_posix(),
|
| 19 |
# default=(project_path / "data/pt-BR").as_posix(),
|
| 20 |
+
default=(project_path / "data/ms-MY").as_posix(),
|
| 21 |
type=str
|
| 22 |
)
|
| 23 |
parser.add_argument(
|
| 24 |
"--output_dir",
|
| 25 |
+
# default=(project_path / "data/52").as_posix(),
|
| 26 |
+
# default=(project_path / "data/82").as_posix(),
|
| 27 |
# default=(project_path / "data/55").as_posix(),
|
| 28 |
+
default=(project_path / "data/60").as_posix(),
|
| 29 |
type=str
|
| 30 |
)
|
| 31 |
args = parser.parse_args()
|
| 32 |
return args
|
| 33 |
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
quantity_to_use = """
|
| 36 |
+
bell_and_mute: 1, 1%
|
| 37 |
+
bell_and_noise_mute: 1, 1%
|
| 38 |
+
bell_and_not_connected: 25, 25%
|
| 39 |
+
bell_and_voice: 1, 1%
|
| 40 |
+
bell_and_voicemail: 41, 41%
|
| 41 |
+
bell_and_voicemail2: 2, 2%
|
| 42 |
+
busy_and_not_connected: 3, 3%
|
| 43 |
+
engaged_and_not_connected: 1, 1%
|
|
|
|
| 44 |
mute_and_not_connected: 2, 2%
|
| 45 |
+
mute_and_voicemail: 3, 3%
|
| 46 |
+
not_available_and_not_available: 1, 1%
|
| 47 |
+
not_available_and_not_connected: 4, 4%
|
| 48 |
+
not_reachable_and_not_connected: 8, 8%
|
| 49 |
+
no_answer_and_not_connected: 1, 1%
|
| 50 |
+
no_response_and_not_connected: 2, 2%
|
| 51 |
+
out_of_service_and_not_connected: 4, 4%
|
| 52 |
"""
|
| 53 |
|
| 54 |
|
|
|
|
| 56 |
args = get_args()
|
| 57 |
audio_dir = Path(args.audio_dir)
|
| 58 |
output_dir = Path(args.output_dir)
|
| 59 |
+
output_dir.mkdir(parents=True, exist_ok=False)
|
| 60 |
suffix_count = 0
|
| 61 |
|
| 62 |
call_id_to_wav_file_list = defaultdict(list)
|
|
|
|
| 89 |
splits = filename.stem.split("_")
|
| 90 |
call_id = splits[3]
|
| 91 |
|
| 92 |
+
tgt_dir = output_dir / f"{suffix_count:03}"
|
| 93 |
tgt_dir.mkdir(parents=True, exist_ok=True)
|
| 94 |
suffix_count += 1
|
| 95 |
wav_file_list = call_id_to_wav_file_list[call_id]
|
|
|
|
| 109 |
tgt_filename.as_posix(),
|
| 110 |
)
|
| 111 |
result.append({
|
| 112 |
+
"suffix": f"{suffix_count-1:03}",
|
| 113 |
"label": folder_name
|
| 114 |
})
|
| 115 |
result = pd.DataFrame(result)
|