Datasets:
Update classifications
Browse filesSplit southern American accent zone into three accent zones to improve dataset balance, and moved Florida to midland. Also created an "anglophone" column for easier filtering. I want to avoid oversampling or undersampling datasets during training given how small the dataset already is, so it's better to balance out the classifications somewhat even at the expense of potentially nitpicky accent granularity.
- metadata.csv +0 -0
- metadata.py +16 -8
metadata.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
metadata.py
CHANGED
@@ -115,35 +115,41 @@ def getDialect(country, locale, city):
|
|
115 |
if locale in SouthernBritish or city in SouthernBritish:
|
116 |
return "Southern British (Welsh or Southern English)"
|
117 |
|
118 |
-
|
119 |
WesternAmerican = {'california, usa', 'washington, usa', 'oregon, usa', 'colorado, usa', 'idaho, usa', 'utah, usa', 'alaska, usa', 'new mexico, usa', 'hawaii, usa', 'arizona, usa', 'montana, usa', 'nevada, usa', 'wyoming, usa'}
|
120 |
-
MidlandAmerican = {'ohio, usa', 'missouri, usa', 'indiana, usa', 'west virginia, usa', 'kansas, usa', 'iowa, usa', 'oklahoma, usa', 'nebraska, usa'}
|
121 |
MidAtlanticAmerican = {'pennsylvania, usa', 'maryland, usa', 'district of columbia, usa', 'dc, usa', 'new jersey, usa', 'illinois, usa'}
|
122 |
NewEnglandAmerican = {'queens, new york, usa', 'brooklyn, new york, usa', 'new york, new york, usa', 'massachusetts, usa', 'connecticut, usa', 'rhode island, usa', 'vermont, usa', 'new hampshire, usa', 'maine, usa'}
|
123 |
NorthernAmerican = {'new york, usa', 'chicago, illinois, usa', 'minnesota, usa', 'michigan, usa', 'wisconsin, usa', 'south dakota, usa', 'north dakota, usa'}
|
|
|
|
|
124 |
|
125 |
if locale in NewEnglandAmerican or city in NewEnglandAmerican:
|
126 |
return "New England American and NYC"
|
127 |
if locale in NorthernAmerican or city in NorthernAmerican:
|
128 |
return "Northern American (Great Lakes / Upper Midwest)"
|
129 |
-
if locale in
|
130 |
-
return "Southern American (US South)"
|
131 |
if locale in WesternAmerican:
|
132 |
return "Western American"
|
133 |
if locale in MidlandAmerican:
|
134 |
return "Midland American (Lower Midwest)"
|
135 |
if locale in MidAtlanticAmerican:
|
136 |
return "Mid-Atlantic American"
|
|
|
|
|
|
|
|
|
137 |
|
138 |
raise ValueError(city)
|
139 |
|
140 |
-
AnglophoneAccents = {'Southern American
|
141 |
|
142 |
labels = Counter()
|
143 |
|
144 |
file = open('speakers_all.csv', newline='')
|
145 |
outfile = open('metadata.csv', 'w', newline='')
|
146 |
-
writer = csv.DictWriter(outfile, ["file_name", "label", "birthplace", "country", "native_language", "sex", "age", "age_onset"])
|
147 |
detail_countries = {"usa","uk","canada","australia"}
|
148 |
def processrow(row):
|
149 |
filename = "recordings/" + row["filename"] + ".mp3"
|
@@ -162,9 +168,11 @@ def processrow(row):
|
|
162 |
language = row["native_language"]
|
163 |
if row["file_missing?"] != "TRUE" and language != "synthesized":
|
164 |
label = getLabel(language, country, locale, birthplace)
|
|
|
165 |
if label in AnglophoneAccents:
|
166 |
-
|
167 |
-
|
|
|
168 |
|
169 |
writer.writeheader()
|
170 |
for row in csv.DictReader(file):
|
|
|
115 |
if locale in SouthernBritish or city in SouthernBritish:
|
116 |
return "Southern British (Welsh or Southern English)"
|
117 |
|
118 |
+
DeepSouthernAmerican = { 'georgia, usa', 'south carolina, usa', 'alabama, usa', 'louisiana, usa', 'mississippi, usa'}
|
119 |
WesternAmerican = {'california, usa', 'washington, usa', 'oregon, usa', 'colorado, usa', 'idaho, usa', 'utah, usa', 'alaska, usa', 'new mexico, usa', 'hawaii, usa', 'arizona, usa', 'montana, usa', 'nevada, usa', 'wyoming, usa'}
|
120 |
+
MidlandAmerican = {'florida, usa', 'ohio, usa', 'missouri, usa', 'indiana, usa', 'west virginia, usa', 'kansas, usa', 'iowa, usa', 'oklahoma, usa', 'nebraska, usa'}
|
121 |
MidAtlanticAmerican = {'pennsylvania, usa', 'maryland, usa', 'district of columbia, usa', 'dc, usa', 'new jersey, usa', 'illinois, usa'}
|
122 |
NewEnglandAmerican = {'queens, new york, usa', 'brooklyn, new york, usa', 'new york, new york, usa', 'massachusetts, usa', 'connecticut, usa', 'rhode island, usa', 'vermont, usa', 'new hampshire, usa', 'maine, usa'}
|
123 |
NorthernAmerican = {'new york, usa', 'chicago, illinois, usa', 'minnesota, usa', 'michigan, usa', 'wisconsin, usa', 'south dakota, usa', 'north dakota, usa'}
|
124 |
+
InlandSouthernAmerican = {'texas, usa', 'kentucky, usa', 'tennessee, usa', 'arkansas, usa'}
|
125 |
+
UpperSouthernAmerican = {'virginia, usa','north carolina, usa'}
|
126 |
|
127 |
if locale in NewEnglandAmerican or city in NewEnglandAmerican:
|
128 |
return "New England American and NYC"
|
129 |
if locale in NorthernAmerican or city in NorthernAmerican:
|
130 |
return "Northern American (Great Lakes / Upper Midwest)"
|
131 |
+
if locale in DeepSouthernAmerican:
|
132 |
+
return "Southern American (US Deep South)"
|
133 |
if locale in WesternAmerican:
|
134 |
return "Western American"
|
135 |
if locale in MidlandAmerican:
|
136 |
return "Midland American (Lower Midwest)"
|
137 |
if locale in MidAtlanticAmerican:
|
138 |
return "Mid-Atlantic American"
|
139 |
+
if locale in InlandSouthernAmerican:
|
140 |
+
return "Inland Southern American and Texan"
|
141 |
+
if locale in UpperSouthernAmerican:
|
142 |
+
return "Upper Atlantic Southern American"
|
143 |
|
144 |
raise ValueError(city)
|
145 |
|
146 |
+
AnglophoneAccents = {'Upper Atlantic Southern American', 'Inland Southern American and Texan', 'Canadian', 'Western American', 'Southern American (US Deep South)', 'Mid-Atlantic American', 'Northern American (Great Lakes / Upper Midwest)', 'Midland American (Lower Midwest or Florida)', 'New England American and NYC', 'Australian or New Zealander', 'Middle British (Northern and Midlands English)', 'Southern British (Welsh or Southern English)', 'Northern British (Scottish or Irish)'}
|
147 |
|
148 |
labels = Counter()
|
149 |
|
150 |
file = open('speakers_all.csv', newline='')
|
151 |
outfile = open('metadata.csv', 'w', newline='')
|
152 |
+
writer = csv.DictWriter(outfile, ["file_name", "label", "anglosphere", "birthplace", "country", "native_language", "sex", "age", "age_onset"])
|
153 |
detail_countries = {"usa","uk","canada","australia"}
|
154 |
def processrow(row):
|
155 |
filename = "recordings/" + row["filename"] + ".mp3"
|
|
|
168 |
language = row["native_language"]
|
169 |
if row["file_missing?"] != "TRUE" and language != "synthesized":
|
170 |
label = getLabel(language, country, locale, birthplace)
|
171 |
+
anglosphere = 0
|
172 |
if label in AnglophoneAccents:
|
173 |
+
labels[label] += 1
|
174 |
+
anglosphere = 1
|
175 |
+
writer.writerow({"file_name": filename, "label": label, "anglosphere": anglosphere, "birthplace": birthplace, "country": country, "native_language": language, "sex": sex, "age": age, "age_onset": age_onset})
|
176 |
|
177 |
writer.writeheader()
|
178 |
for row in csv.DictReader(file):
|