Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VGMT-article
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
Container 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Damien Hansen
VGMT-article
Commits
2b06876c
Commit
2b06876c
authored
2 years ago
by
Damien Hansen
Browse files
Options
Downloads
Patches
Plain Diff
Adding preprocessing steps
parent
d8f7be62
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
preprocess.sh
+75
-0
75 additions, 0 deletions
preprocess.sh
with
75 additions
and
0 deletions
preprocess.sh
0 → 100644
+
75
−
0
View file @
2b06876c
#!/bin/sh
# Directories
#############
echo
Choose directory
in
the data folder
read
DIR
export
DIR
mkdir
-p
./data/
${
DIR
}
/subword
mkdir
-p
./data/
${
DIR
}
/vocab
mkdir
-p
./data/
${
DIR
}
/tok
# Tokenization
##############
sacremoses
-l
en tokenize < ./data/
${
DIR
}
/trn.en
>
./data/
${
DIR
}
/tok/trn.en
sacremoses
-l
fr tokenize < ./data/
${
DIR
}
/trn.fr
>
./data/
${
DIR
}
/tok/trn.fr
sacremoses
-l
en tokenize < ./data/
${
DIR
}
/val.en
>
./data/
${
DIR
}
/tok/val.en
sacremoses
-l
fr tokenize < ./data/
${
DIR
}
/val.fr
>
./data/
${
DIR
}
/tok/val.fr
sacremoses
-l
en tokenize < ./data/
${
DIR
}
/tra.en
>
./data/
${
DIR
}
/tok/tra.en
sacremoses
-l
fr tokenize < ./data/
${
DIR
}
/tra.fr
>
./data/
${
DIR
}
/tok/tra.fr
# Subword segmentation
######################
# For fine-tuning
spm_train
\
--input
=
./data/books/tok/trn.en,./data/europarl/tok/trn.en,./data/globalvoices/tok/trn.en,./data/news/tok/trn.en,./data/ted/tok/trn.en,./data/
${
DIR
}
/tok/trn.en,
\
--model_prefix
=
./data/
${
DIR
}
/subword/unigram_multi_en
\
--vocab_size
=
32000
\
--character_coverage
=
1.0
\
--model_type
=
unigram
spm_train
\
--input
=
./data/books/tok/trn.fr,./data/europarl/tok/trn.fr,./data/globalvoices/tok/trn.fr,./data/news/tok/trn.fr,./data/ted/tok/trn.fr,./data/
${
DIR
}
/tok/trn.fr
\
--model_prefix
=
./data/
${
DIR
}
/subword/unigram_multi_fr
\
--vocab_size
=
32000
\
--character_coverage
=
1.0
\
--model_type
=
unigram
spm_encode
\
--model
=
./data/
${
DIR
}
/subword/unigram_multi_en.model
\
--output_format
=
piece
\
< ./data/
${
DIR
}
/tok/tra.en
\
>
./data/
${
DIR
}
/tok/tra_unigram_multi.en
# For video game only
spm_train
\
--input
=
./data/
${
DIR
}
/tok/trn.en,
\
--model_prefix
=
./data/
${
DIR
}
/subword/unigram_only_en
\
--vocab_size
=
32000
\
--character_coverage
=
1.0
\
--model_type
=
unigram
spm_train
\
--input
=
./data/
${
DIR
}
/tok/trn.fr
\
--model_prefix
=
./data/
${
DIR
}
/subword/unigram_only_fr
\
--vocab_size
=
32000
\
--character_coverage
=
1.0
\
--model_type
=
unigram
spm_encode
\
--model
=
./data/
${
DIR
}
/subword/unigram_only_en.model
\
--output_format
=
piece
\
< ./data/
${
DIR
}
/tok/tra.en
\
>
./data/
${
DIR
}
/tok/tra_unigram_only.en
# Building vocab
################
onmt_build_vocab
--config
configs/
${
DIR
}
_only.yaml
--n_sample
-1
onmt_build_vocab
--config
configs/
${
DIR
}
_tuned.yaml
--n_sample
-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
register
or
sign in
to comment