aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYigit Sever2019-09-26 19:37:38 +0300
committerYigit Sever2019-09-26 19:37:38 +0300
commitd63839410faaeeb5522edd0c2109ae465cd5cdc5 (patch)
tree61c7e68213aa88745a7ff9d15e4518cdc5774872
parent9e62cf0f8d7d6016df505234aa6e062c5da54443 (diff)
downloadEvaluating-Dictionary-Alignment-d63839410faaeeb5522edd0c2109ae465cd5cdc5.tar.gz
Evaluating-Dictionary-Alignment-d63839410faaeeb5522edd0c2109ae465cd5cdc5.tar.bz2
Evaluating-Dictionary-Alignment-d63839410faaeeb5522edd0c2109ae465cd5cdc5.zip
Include WMD usage
-rw-r--r--README.md40
-rw-r--r--WMD.py2
2 files changed, 41 insertions, 1 deletions
diff --git a/README.md b/README.md
index 40909f5..f7d4fce 100644
--- a/README.md
+++ b/README.md
@@ -118,3 +118,43 @@ Bear in mind that this will require around 50 GB free space. The mapped embeddin
118```bash 118```bash
119./demo.sh 119./demo.sh
120``` 120```
121
122## Usage
123
124### WMD.py - Word Mover's Distance and Sinkhorn Distance
125
126Aligns definitions using WMD or SNK metrics and matching or retrieval paradigms.
127
128```
129usage: WMD.py [-h] [-b] [-n INSTANCES]
130 source_lang target_lang source_vector target_vector source_defs
131 target_defs {all,wmd,snk} {all,retrieval,matching}
132
133align dictionaries using wmd and wasserstein distance
134
135positional arguments:
136 source_lang source language short name
137 target_lang target language short name
138 source_vector path of the source vector
139 target_vector path of the target vector
140 source_defs path of the source definitions
141 target_defs path of the target definitions
142 {all,wmd,snk} which methods to run
143 {all,retrieval,matching}
144 which paradigms to align with
145
146optional arguments:
147 -h, --help show this help message and exit
148 -b, --batch running in batch (store results in csv) or running a
149 single instance (output the results)
150 -n INSTANCES, --instances INSTANCES
151 number of instances in each language to retrieve
152```
153
154Example;
155
156```bash
157python WMD.py en bg bilingual_embeddings/en_to_bg.vec bilingual_embeddings/bg_to_en.vec wordnets/ready/en_to_bg.def wordnets/ready/bg_to_en.def all all
158```
159
160Will run on English and Bulgarian definitions, using WMD and SNK for matching and retrieval, for a total of 4 times.
diff --git a/WMD.py b/WMD.py
index b08398b..edb704e 100644
--- a/WMD.py
+++ b/WMD.py
@@ -145,7 +145,7 @@ if __name__ == "__main__":
145 "-b", 145 "-b",
146 "--batch", 146 "--batch",
147 action="store_true", 147 action="store_true",
148 help="running in batch (store results in csv) or" 148 help="running in batch (store results in csv) or "
149 + "running a single instance (output the results)", 149 + "running a single instance (output the results)",
150 ) 150 )
151 parser.add_argument( 151 parser.add_argument(