RTLiang / Translation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Online Translation Platform

中文

DISCLAIMER: This project is only tested and implemented on Linux, with no guarantee for other operating systems.

Introduction

This is a translation platform where you can look up English words and translate English and Chinese bidirectionally. Look up a word English to Chinese, Credits: The Project Gutenberg eBook of Pride and Prejudice Chinese to English, Credits: 再别康桥

Credits for Powered Features

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

Setup

  1. Install Qt Creator (Qt Creator 6.0.2 is recommended).
  2. Clone this repository.

Server configuration

  1. Download required database ecdict-sqlite-28.zip and extract stardict.db into ServerTranslation folder.

  2. Open ServerTranslation/ServerTranslation.pro in Qt 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.

  1. (For Translation Usage) Install Pytorch from the following link: https://pytorch.org/get-started/locally/

  2. (For Translation Usage) Install Python library transformers and sentencepiece

pip install transformers sentencepiece
  1. (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.

Client configuration

  1. Open OnlineTranslation/OnlineTranslation.pro in Qt Creator.
  2. Open OnlineTranslation/mainwindow.cpp and change the variable const QString ip to server's IP address.
  3. If everything goes well, you can build and run this project.

Usage

The user interface is simple and intuitive.

About


Languages

Language:C++ 86.0%Language:QMake 7.6%Language:Python 6.4%