|
| 1 | +Scripts |
| 2 | +======= |
| 3 | + |
| 4 | +Installing ``finalfusion`` adds some exectuables: |
| 5 | + |
| 6 | + * ``ffp-convert`` for converting embeddings |
| 7 | + * ``ffp-similar`` for similarity queries |
| 8 | + * ``ffp-analogy`` for analogy queries |
| 9 | + * ``ffp-bucket-to-explicit`` to convert bucket subword to explicit subword embeddings |
| 10 | + |
| 11 | +.. Convert: |
| 12 | +
|
| 13 | +Convert |
| 14 | +------- |
| 15 | + |
| 16 | +``ffp-convert`` makes conversion between all supported embedding formats possible: |
| 17 | + |
| 18 | +.. code-block:: bash |
| 19 | +
|
| 20 | + $ ffp-convert --help |
| 21 | + usage: ffp-convert [-h] [-f INPUT_FORMAT] [-t OUTPUT_FORMAT] INPUT OUTPUT |
| 22 | +
|
| 23 | + Convert embeddings. |
| 24 | +
|
| 25 | + positional arguments: |
| 26 | + INPUT Input embeddings |
| 27 | + OUTPUT Output path |
| 28 | +
|
| 29 | + optional arguments: |
| 30 | + -h, --help show this help message and exit |
| 31 | + -f INPUT_FORMAT, --from INPUT_FORMAT |
| 32 | + Valid choices: ['word2vec', 'finalfusion', 'fasttext', |
| 33 | + 'text', 'textdims'] Default: 'word2vec' |
| 34 | + -t OUTPUT_FORMAT, --to OUTPUT_FORMAT |
| 35 | + Valid choices: ['word2vec', 'finalfusion', 'fasttext', |
| 36 | + 'text', 'textdims'] Default: 'finalfusion' |
| 37 | +
|
| 38 | +.. Similar: |
| 39 | +
|
| 40 | +Similar |
| 41 | +------- |
| 42 | + |
| 43 | +``ffp-similar`` supports similarity queries: |
| 44 | + |
| 45 | +.. code-block:: bash |
| 46 | +
|
| 47 | + $ ffp-similar --help |
| 48 | + usage: ffp-similar [-h] [-f INPUT_FORMAT] [-k K] EMBEDDINGS [input] |
| 49 | +
|
| 50 | + Similarity queries. |
| 51 | +
|
| 52 | + positional arguments: |
| 53 | + EMBEDDINGS Input embeddings |
| 54 | + input Optional input file with one word per line. If |
| 55 | + unspecified reads from stdin |
| 56 | +
|
| 57 | +
|
| 58 | + optional arguments: |
| 59 | + -h, --help show this help message and exit |
| 60 | + -f INPUT_FORMAT, --format INPUT_FORMAT |
| 61 | + Valid choices: ['word2vec', 'finalfusion', 'fasttext', |
| 62 | + 'text', 'textdims'] Default: 'finalfusion' |
| 63 | + -k K Number of neighbours. Default: 10 |
| 64 | +
|
| 65 | +.. Analogy: |
| 66 | +
|
| 67 | +Analogy |
| 68 | +------- |
| 69 | + |
| 70 | +``ffp-analogy`` answers analogy queries: |
| 71 | + |
| 72 | +.. code-block:: bash |
| 73 | +
|
| 74 | + $ ffp-analogy --help |
| 75 | + usage: ffp-analogy [-h] [-f INPUT_FORMAT] [-i {a,b,c} [{a,b,c} ...]] [-k K] |
| 76 | + EMBEDDINGS [input] |
| 77 | +
|
| 78 | + Analogy queries. |
| 79 | +
|
| 80 | + positional arguments: |
| 81 | + EMBEDDINGS Input embeddings |
| 82 | + input Optional input file with 3 words per line. If |
| 83 | + unspecified reads from stdin |
| 84 | +
|
| 85 | + optional arguments: |
| 86 | + -h, --help show this help message and exit |
| 87 | + -f INPUT_FORMAT, --format INPUT_FORMAT |
| 88 | + Valid choices: ['word2vec', 'finalfusion', 'fasttext', |
| 89 | + 'text', 'textdims'] Default: 'finalfusion' |
| 90 | + -i {a,b,c} [{a,b,c} ...], --include {a,b,c} [{a,b,c} ...] |
| 91 | + Specify query parts that should be allowed as answers. |
| 92 | + Valid choices: ['a', 'b', 'c'] |
| 93 | + -k K Number of neighbours. Default: 10 |
| 94 | +
|
| 95 | +.. bucket to explicit: |
| 96 | +
|
| 97 | +Bucket to Explicit |
| 98 | +------------------ |
| 99 | +
|
| 100 | +
|
| 101 | +``ffp-bucket-to-explicit`` converts bucket subword embeddings to explicit subword embeddings: |
| 102 | +
|
| 103 | +.. code-block:: bash |
| 104 | +
|
| 105 | + $ ffp-bucket-to-explicit |
| 106 | + usage: ffp-bucket-to-explicit [-h] [-f INPUT_FORMAT] INPUT OUTPUT |
| 107 | +
|
| 108 | + Convert bucket embeddings to explicit lookups. |
| 109 | +
|
| 110 | + positional arguments: |
| 111 | + INPUT Input bucket embeddings |
| 112 | + OUTPUT Output path |
| 113 | +
|
| 114 | + optional arguments: |
| 115 | + -h, --help show this help message and exit |
| 116 | + -f INPUT_FORMAT, --from INPUT_FORMAT |
| 117 | + Valid choices: ['finalfusion', 'fasttext'] Default: |
| 118 | + 'finalfusion' |
0 commit comments