diff options
-rw-r--r-- | README.md | 40 | ||||
-rw-r--r-- | WMD.py | 2 |
2 files changed, 41 insertions, 1 deletions
@@ -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 | |||
126 | Aligns definitions using WMD or SNK metrics and matching or retrieval paradigms. | ||
127 | |||
128 | ``` | ||
129 | usage: 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 | |||
133 | align dictionaries using wmd and wasserstein distance | ||
134 | |||
135 | positional 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 | |||
146 | optional 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 | |||
154 | Example; | ||
155 | |||
156 | ```bash | ||
157 | python 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 | |||
160 | Will run on English and Bulgarian definitions, using WMD and SNK for matching and retrieval, for a total of 4 times. | ||
@@ -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( |