Skip to content

Commit f2dc5db

Browse files
author
Yusuke Oda
committed
fix documents
1 parent 6f41db2 commit f2dc5db

File tree

3 files changed

+71
-43
lines changed

3 files changed

+71
-43
lines changed

doc/decoding.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ Generating translations using the trained model
22
===============================================
33

44
If we obtained the `best_dev_log_ppl.model.params` file in the output directory
5-
by [training process](https://github.com/odashi/nmtkit/tree/master/doc/training_ja.md),
5+
by [training process](https://github.com/odashi/nmtkit/tree/master/doc/training.md),
66
we can generate output sentences using `decode` command:
77

8-
src/bin/decode \
8+
$ path/to/decode \
99
--model model \
10-
< submodules/small_parallel_enja/test.en \
10+
< /path/to/nmtkit/submodules/small_parallel_enja/test.en \
1111
> result.ja
1212

1313
Note that the input data of the `decode` should be tokenized in advance.
1414

1515
If you want to generate HTML file with more detailed information during the
1616
decoding process, use `--format html` option:
1717

18-
src/bin/decode \
18+
$ /path/to/decode \
1919
--model model \
2020
--format html \
21-
< submodules/small_parallel_enja/test.en \
21+
< /path/to/nmtkit/submodules/small_parallel_enja/test.en \
2222
> result.ja.html
2323

2424
Here is the

doc/install.md

+62-34
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ NMTKit needs following libraries:
99

1010
* **GNU C++** ... v4.9 or later (or other compatible compilers)
1111
* **Boost C++ Library** ... v1.50 or later
12-
* **Eigen** ... The newest development version
13-
* **DyNet** ... v1.0-rc1.
12+
* **[Eigen](http://eigen.tuxfamily.org/)** ... The newest development version
13+
* **[DyNet](https://github.com/clab/dynet)** ... v1.0-rc1 or later
14+
* **[MTEval](https://github.com/odashi/mteval)** ... v1.0.0 or later
1415
* **CUDA** ... v7.5 or later
1516

1617

1718
And the installation process may require following tools:
1819

1920
* **Git**
2021
* **Mercurial**
21-
* **autotools (autoconf, automake), libtool**
22-
* **CMake**.
22+
* **CMake** ... v3.1 or later
2323

2424

2525
Install Eigen
@@ -29,67 +29,95 @@ First we get the development version of Eigen using Mercurial.
2929
This process could be done by only putting obtained files into an appropriate
3030
location because Eigen consists of only header files:
3131

32-
hg clone https://bitbucket.org/eigen/eigen/ /path/to/eigen
32+
$ hg clone https://bitbucket.org/eigen/eigen/ /path/to/eigen
3333

3434

3535
Install DyNet
3636
-------------
3737

3838
Next we get and build DyNet:
3939

40-
git clone https://github.com/clab/dynet.git /path/to/dynet
41-
cd /path/to/dynet
42-
mkdir build
43-
cd build
40+
$ git clone https://github.com/clab/dynet.git /path/to/dynet
41+
$ cd /path/to/dynet
42+
$ mkdir build
43+
$ cd build
4444

4545
Case of using CPUs to calculate neural network:
4646

47-
cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen
48-
make -j <threads>
47+
$ cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen
48+
$ make -j <threads>
4949

5050
Case of using CUDA:
5151

52-
cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DBACKEND=cuda
53-
make -j <threads>
52+
$ cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DBACKEND=cuda
53+
$ make -j <threads>
5454

5555

56-
Configuring library paths
57-
-------------------------
56+
Install MTEval
57+
--------------
5858

59-
All shared libraries of CUDA and DyNet should be visible from the NMTKit
60-
binaries.
61-
Add a configuration in your shell-rc file like:
59+
MTEval can be installed by similar way to DyNet:
6260

63-
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/cuda/lib64
64-
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/dynet/build/dynet
61+
$ git clone https://github.com/odashi/mteval.git /path/to/mteval
62+
$ cd /path/to/mteval
63+
$ mkdir build
64+
$ cd build
65+
$ cmake ..
66+
$ make -j <threads>
6567

6668

6769
Install NMTKit
6870
--------------
6971

70-
git clone https://github.com/odashi/nmtkit.git /path/to/nmtkit
71-
cd /path/to/nmtkit
72-
git submodule init
73-
git submodule update
74-
autoreconf -i
72+
Prepare build tree for NMTKit:
7573

76-
Case of using CPUs to calculate neural network:
74+
$ git clone https://github.com/odashi/nmtkit.git /path/to/nmtkit
75+
$ cd /path/to/nmtkit
76+
$ git submodule init
77+
$ git submodule update
78+
$ mkdir build
79+
$ cd build
7780

78-
./configure --with-eigen=/path/to/eigen --with-dynet=/path/to/dynet
79-
make
81+
And configure makefiles with all library locations:
8082

81-
Case of using CUDA:
83+
$ cmake .. \
84+
-DUSE_GPU=ON \ # need if you use CUDA
85+
-DCUDA_ROOT=/path/to/cuda \ # ditto
86+
-DEIGEN3_INCLUDE_DIR=/path/to/eigen \
87+
-DDYNET_INCLUDE_DIR=/path/to/dynet \
88+
-DDYNET_LIBRARY_DIR=/path/to/dynet/build/dynet \
89+
-DMTEVAL_INCLUDE_DIR=/path/to/mteval \
90+
-DMTEVAL_LIBRARY_DIR=/path/to/mteval/build/mteval \
91+
92+
And then:
8293

83-
./configure --with-eigen=/path/to/eigen --with-dynet=/path/to/dynet --with-cuda=/path/to/cuda
84-
make
94+
$ make -j <threads>
95+
96+
97+
Configuring library paths (optional)
98+
------------------------------------
99+
100+
All linked libraries should be visible from the NMTKit frontend binaries.
101+
To give library locations explicitly, for example, add configurations in your
102+
shell-rc file like:
103+
104+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/cuda/lib64
105+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/boost/lib
106+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/dynet/build/dynet
107+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/mteval/build/mteval
108+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/nmtkit/build/nmtkit
85109

86110

87111
Validation
88112
----------
89113

90-
make check
114+
$ make test
91115

92116
Sample files could be used to validate the behavior of binaries:
93117

94-
src/bin/train --config sample_data/tiny_config.ini --model model
95-
src/bin/decode --model model < sample_data/tiny.in
118+
$ /path/to/nmtkit/build/bin/train \
119+
--config /path/to/nmtkit/sample_data/tiny_config.ini \
120+
--model model
121+
$ /path/to/nmtkit/build/bin/decode \
122+
--model model \
123+
< /path/to/nmtkit/sample_data/tiny.in

doc/training.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ the location of the output directory.
6363

6464
To launch the trainer with the sample corpus, type following lines:
6565

66-
src/bin/train \
67-
--config sample_data/sample_config.ini \
66+
$ /path/to/train \
67+
--config /path/to/nmtkit/sample_data/sample_config.ini \
6868
--model model
6969

7070
`train` command modifies only files in the output directory specified by the
@@ -92,7 +92,7 @@ The prefix of the `*.params` files means:
9292
We also could output similar contents as `training.log` to stderr by specifying
9393
`--log-to-stderr` option:
9494

95-
src/bin/train \
96-
--config sample_data/sample_config.ini \
95+
$ /path/to/train \
96+
--config /path/to/nmtkit/sample_data/sample_config.ini \
9797
--model model \
9898
--log-to-stderr

0 commit comments

Comments
 (0)