aboutsummaryrefslogtreecommitdiffstats
path: root/demo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'demo.sh')
-rwxr-xr-xdemo.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/demo.sh b/demo.sh
index acb7c2f..990a106 100755
--- a/demo.sh
+++ b/demo.sh
@@ -24,14 +24,17 @@
24 24
25ROOT="$(pwd)" 25ROOT="$(pwd)"
26SCRIPTS="${ROOT}/scripts" 26SCRIPTS="${ROOT}/scripts"
27
27WNET="${ROOT}/wordnets" 28WNET="${ROOT}/wordnets"
28EMBS="${ROOT}/embeddings" 29TAB_DIR="${WNET}/tab_files"
29DICT="${ROOT}/dictionaries" 30READY="${WNET}/ready"
30 31
32DICT="${ROOT}/dictionaries"
31TRAIN_DIR="${DICT}/train" 33TRAIN_DIR="${DICT}/train"
32TEST_DIR="${DICT}/test" 34TEST_DIR="${DICT}/test"
33TAB_DIR="${WNET}/tab_files" 35
34READY="${WNET}/ready" 36EMBS="${ROOT}/embeddings"
37MAP_TO="${ROOT}/bilingual_embeddings"
35 38
36# create wordnets directory and download a single wordnet 39# create wordnets directory and download a single wordnet
37mkdir -p "${WNET}" 40mkdir -p "${WNET}"
@@ -84,3 +87,14 @@ python "${ROOT}/vecmap/map_embeddings.py" --supervised \
84 "${EMBS}/bg.vec" \ 87 "${EMBS}/bg.vec" \
85 "${MAP_TO}/en_to_bg.vec" \ 88 "${MAP_TO}/en_to_bg.vec" \
86 "${MAP_TO}/bg_to_en.vec" > /dev/null 2>&1 89 "${MAP_TO}/bg_to_en.vec" > /dev/null 2>&1
90
91mkdir -p "${MAP_TO}" # create bilingual embeddings directory
92source_lang="en"
93target_lang="bg"
94
95python "${ROOT}/vecmap/map_embeddings.py" --supervised \
96 "${TRAIN_DIC_DIR}/${source_lang}_${target_lang}.train" \
97 "${EMBS}/${source_lang}.vec" \
98 "${EMBS}/${target_lang}.vec" \
99 "${MAP_TO}/${source_lang}_to_${target_lang}.vec" \
100 "${MAP_TO}/${target_lang}_to_${source_lang}.vec" > /dev/null 2>&1