DISCLAIMER: This project is only tested and implemented on Linux, with no guarantee for other operating systems.
This is a translation platform where you can look up English words and translate English and Chinese bidirectionally.
Dictionary feature is powered by ECDICT by Linwei.
Translation feature is powered by opus-mt-en-zh and opus-mt-zh-en by Language Technology Research Group at the University of Helsinki
- Install
Qt Creator
(Qt Creator 6.0.2 is recommended). - Clone this repository.
-
Download required database
ecdict-sqlite-28.zip
and extractstardict.db
intoServerTranslation
folder. -
Open
ServerTranslation/ServerTranslation.pro
inQt Creator
, if everything goes well, you can build and run this project.
Please be aware that the server listens on port 8082
. Therefore, this port should not be occupied.
-
(For Translation Usage) Install
Pytorch
from the following link: https://pytorch.org/get-started/locally/ -
(For Translation Usage) Install Python library
transformers
andsentencepiece
pip install transformers sentencepiece
- (Optional) Before running this project, running following python code
python3 trans.py en "Hello, World!" # Output should be "你好,世界!"
and
python3 trans.py zh "你好,世界!" # Output should be "Hello, world!"
to download and setup translation model.
- Open
OnlineTranslation/OnlineTranslation.pro
inQt Creator
. - Open
OnlineTranslation/mainwindow.cpp
and change the variableconst QString ip
to server's IP address. - If everything goes well, you can build and run this project.
The user interface is simple and intuitive.