Skip to content

qin1122/Transformer-Machine-Translation

Repository files navigation

Transformer-Machine-Translation

👀 Demos Video

TODO

🔧 Dependencies and Installation

Installation

  1. Clone repo
git clone https://github.com/qin1122/Transformer-Machine-Translation.git
cd Transformer-Machine-Translation
  1. Install dependent packages (use conda)
conda create --name transformer
conda activate transformer
conda install python
pip install -r requirements.txt

🗂️ Datasets

I use a dataset consisting of 21,621 pairs of English and Chinese short sentences. Original dataset can be downloaded here.

I applied a better tokenizing method for Chinese sentences, which led to a higher BLEU score. The new dataset and the preprocessed original dataset can be downloaded here

⚙️ Train

Create a new yaml config file or use my config files (e.g. './configs/train_1.yaml'), put the yaml file in './configs'.

Then run:

python main.py --config 'configs/config.yaml'

You can monitor the training process in real time on Weights & Biases (wandb).

To use wandb, you have to login in terminal first, use the command below to login:

wandb login

⚡️ Quick Test

Create a new yaml config file or use my config files (e.g. './configs/test_origin.yaml'), put the yaml file in './configs'.

Then run:

python test.py --config 'configs/config.yaml'

🏰 Model Zoo

We conducted a total of 19 experiments, and the best model parameters can be downloaded here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published