command_line_tools.rst 1.6 KB
Newer Older
Myle Ott's avatar
Myle Ott committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.. _Command-line Tools:

Command-line Tools
==================

Fairseq provides several command-line tools for training and evaluating models:

- :ref:`preprocess.py`: Data pre-processing: build vocabularies and binarize training data
- :ref:`train.py`: Train a new model on one or multiple GPUs
- :ref:`generate.py`: Translate pre-processed data with a trained model
- :ref:`interactive.py`: Translate raw text with a trained model
- :ref:`score.py`: BLEU scoring of generated translations against reference translations
- :ref:`eval_lm.py`: Language model evaluation


.. _preprocess.py:

preprocess.py
~~~~~~~~~~~~~
.. automodule:: preprocess

    .. argparse::
        :module: preprocess
        :func: get_parser
        :prog: preprocess.py


.. _train.py:

train.py
~~~~~~~~
.. automodule:: train

    .. argparse::
        :module: fairseq.options
        :func: get_training_parser
        :prog: train.py


.. _generate.py:

generate.py
~~~~~~~~~~~
.. automodule:: generate

    .. argparse::
        :module: fairseq.options
        :func: get_generation_parser
        :prog: generate.py


.. _interactive.py:

interactive.py
~~~~~~~~~~~~~~
.. automodule:: interactive

    .. argparse::
        :module: fairseq.options
        :func: get_interactive_generation_parser
        :prog: interactive.py


.. _score.py:

score.py
~~~~~~~~
.. automodule:: score

    .. argparse::
        :module: score
        :func: get_parser
        :prog: score.py


.. _eval_lm.py:

eval_lm.py
~~~~~~~~~~
.. automodule:: eval_lm

    .. argparse::
        :module: fairseq.options
        :func: get_eval_lm_parser
        :prog: eval_lm.py