Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DownSpeechDeepLearning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
davifer
DownSpeechDeepLearning
Commits
ba2dd2a8
Commit
ba2dd2a8
authored
Jun 17, 2024
by
davifer
Browse files
Options
Downloads
Patches
Plain Diff
Delete build_dataset.py
parent
9c6c4bca
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
create_dataset/python/build_dataset.py
+0
-62
0 additions, 62 deletions
create_dataset/python/build_dataset.py
with
0 additions
and
62 deletions
create_dataset/python/build_dataset.py
deleted
100755 → 0
+
0
−
62
View file @
9c6c4bca
import
sys
import
pandas
as
pd
import
subprocess
import
re
dir
=
sys
.
argv
[
1
]
+
"
/data
"
# leemos el csv
data
=
pd
.
read_csv
(
'
../csv/csv_formated.csv
'
)
data
=
data
.
sample
(
frac
=
1
)
# Cambiamos el nombre de las columnas para estandarizarlo a cualquier dataset
data
.
columns
=
[
"
audio
"
,
"
transcription
"
]
# Creamos el path donde se guardaran los wavs
save_dir
=
dir
+
"
/
"
num
=
0
train_fem
=
[
"
041
"
,
"
036
"
,
"
038
"
,
"
039
"
,
"
060
"
,
"
061
"
,
"
063
"
,
"
050
"
,
"
055
"
,
"
057
"
]
train_mas
=
[
"
033
"
,
"
034
"
,
"
043
"
,
"
044
"
,
"
032
"
,
"
022
"
,
"
023
"
,
"
062
"
,
"
064
"
,
"
045
"
,
"
053
"
,
"
059
"
,
"
094
"
]
test_fem
=
[
"
024
"
,
"
027
"
,
"
029
"
,
"
031
"
,
"
046
"
,
"
048
"
,
"
058
"
]
test_masc
=
[
"
047
"
,
"
049
"
,
"
051
"
,
"
052
"
,
"
035
"
,
"
037
"
,
"
040
"
,
"
042
"
,
"
025
"
,
"
026
"
,
"
028
"
,
"
030
"
]
for
i
in
range
(
len
(
data
)):
# Obtenemos donde esta el WAV que estamos utilizando
wav
=
str
(
data
.
iloc
[
i
][
'
audio
'
])
# Obtenemos el nombre del WAV
url_split
=
wav
.
split
(
"
/
"
)
wav_name
=
url_split
[
len
(
url_split
)
-
1
]
# Obtenemos el ID del hablante
id
=
wav_name
[
4
:
7
]
# Vemos donde hay que meter cada auido segun el hablante
if
id
in
train_fem
or
id
in
train_mas
:
save_dir
=
dir
+
"
/
"
+
"
train
"
if
id
in
test_fem
or
id
in
test_masc
:
save_dir
=
dir
+
"
/
"
+
"
test
"
# Obtenemos donde esta la transcripcion del WAV que estamos utilizando
transcription
=
str
(
data
.
iloc
[
i
][
'
transcription
'
])
if
transcription
!=
""
:
# Obtenemos la transcripcion y la ponemos un formato estandar
transcription
=
re
.
sub
(
r
"
\n
"
,
""
,
transcription
)
transcription
=
re
.
sub
(
r
"
\r
"
,
""
,
transcription
)
transcription
=
re
.
sub
(
r
"
\t
"
,
""
,
transcription
)
transcription
=
re
.
sub
(
r
'
[.,
"
\'-?:!;#]<>
'
,
''
,
transcription
)
transcription
=
transcription
.
lower
()
# Movemos el audio y le cambiamos el nombre
salida
=
subprocess
.
run
([
'
.././scripts/copy_audio
'
,
wav
,
save_dir
,
str
(
num
),
wav_name
,
transcription
])
num
+=
1
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment