|
14 | 14 | .. code-block:: console
|
15 | 15 |
|
16 | 16 | $ allennlp elmo --help
|
17 |
| - usage: allennlp elmo [-h] (--all | --top | --average) |
18 |
| - [--vocab-path VOCAB_PATH] [--options-file OPTIONS_FILE] |
19 |
| - [--weight-file WEIGHT_FILE] [--batch-size BATCH_SIZE] |
20 |
| - [--cuda-device CUDA_DEVICE] [--forget-sentences] |
21 |
| - [--use-sentence-keys] [--include-package INCLUDE_PACKAGE] |
22 |
| - input_file output_file |
23 |
| -
|
24 |
| - Create word vectors using ELMo. |
25 |
| -
|
26 |
| - positional arguments: |
27 |
| - input_file The path to the input file. |
28 |
| - output_file The path to the output file. |
29 |
| -
|
30 |
| - optional arguments: |
31 |
| - -h, --help show this help message and exit |
32 |
| - --all Output all three ELMo vectors. |
33 |
| - --top Output the top ELMo vector. |
34 |
| - --average Output the average of the ELMo vectors. |
35 |
| - --vocab-path VOCAB_PATH |
36 |
| - A path to a vocabulary file to generate. |
37 |
| - --options-file OPTIONS_FILE |
38 |
| - The path to the ELMo options file. |
39 |
| - --weight-file WEIGHT_FILE |
40 |
| - The path to the ELMo weight file. |
41 |
| - --batch-size BATCH_SIZE |
42 |
| - The batch size to use. |
43 |
| - --cuda-device CUDA_DEVICE |
44 |
| - The cuda_device to run on. |
45 |
| - --forget-sentences If this flag is specified, and --use-sentence-keys is |
46 |
| - not, remove the string serialized JSON dictionary that |
47 |
| - associates sentences with their line number (its HDF5 |
48 |
| - key) that is normally placed in the |
49 |
| - "sentence_to_index" HDF5 key. |
50 |
| - --use-sentence-keys Normally a sentence's line number is used as the HDF5 |
51 |
| - key for its embedding. If this flag is specified, the |
52 |
| - sentence itself will be used as the key. |
53 |
| - --include-package INCLUDE_PACKAGE |
54 |
| - additional packages to include |
| 17 | + usage: allennlp elmo [-h] (--all | --top | --average) |
| 18 | + [--vocab-path VOCAB_PATH] [--options-file OPTIONS_FILE] |
| 19 | + [--weight-file WEIGHT_FILE] [--batch-size BATCH_SIZE] |
| 20 | + [--file-friendly-logging] [--cuda-device CUDA_DEVICE] |
| 21 | + [--forget-sentences] [--use-sentence-keys] |
| 22 | + [--include-package INCLUDE_PACKAGE] |
| 23 | + input_file output_file |
| 24 | +
|
| 25 | + Create word vectors using ELMo. |
| 26 | +
|
| 27 | + positional arguments: |
| 28 | + input_file The path to the input file. |
| 29 | + output_file The path to the output file. |
| 30 | +
|
| 31 | + optional arguments: |
| 32 | + -h, --help show this help message and exit |
| 33 | + --all Output all three ELMo vectors. |
| 34 | + --top Output the top ELMo vector. |
| 35 | + --average Output the average of the ELMo vectors. |
| 36 | + --vocab-path VOCAB_PATH |
| 37 | + A path to a vocabulary file to generate. |
| 38 | + --options-file OPTIONS_FILE |
| 39 | + The path to the ELMo options file. (default = https:// |
| 40 | + allennlp.s3.amazonaws.com/models/elmo/2x4096_512_2048c |
| 41 | + nn_2xhighway/elmo_2x4096_512_2048cnn_2xhighway_options |
| 42 | + .json) |
| 43 | + --weight-file WEIGHT_FILE |
| 44 | + The path to the ELMo weight file. (default = https://a |
| 45 | + llennlp.s3.amazonaws.com/models/elmo/2x4096_512_2048cn |
| 46 | + n_2xhighway/elmo_2x4096_512_2048cnn_2xhighway_weights. |
| 47 | + hdf5) |
| 48 | + --batch-size BATCH_SIZE |
| 49 | + The batch size to use. (default = 64) |
| 50 | + --file-friendly-logging |
| 51 | + outputs tqdm status on separate lines and slows tqdm |
| 52 | + refresh rate. |
| 53 | + --cuda-device CUDA_DEVICE |
| 54 | + The cuda_device to run on. (default = -1) |
| 55 | + --forget-sentences If this flag is specified, and --use-sentence-keys is |
| 56 | + not, remove the string serialized JSON dictionary that |
| 57 | + associates sentences with their line number (its HDF5 |
| 58 | + key) that is normally placed in the |
| 59 | + "sentence_to_index" HDF5 key. |
| 60 | + --use-sentence-keys Normally a sentence's line number is used as the HDF5 |
| 61 | + key for its embedding. If this flag is specified, the |
| 62 | + sentence itself will be used as the key. |
| 63 | + --include-package INCLUDE_PACKAGE |
| 64 | + additional packages to include |
55 | 65 | """
|
56 | 66 |
|
57 | 67 | import argparse
|
|
0 commit comments