Dot Lexicon
This service starts a local webserver used for neural machine translation.
π Features
Dot Lexicon | |
---|---|
No tracking or telemetry data is collected from you | |
Always free | |
Fast on low-compute machines | |
Accurate and keeps your prompt meaningful | |
Open-source and open for contributions |
For inference, all models are ran on the CPU. Every model utilized in this service are 8-bit quantized, which results in decreased latency and storage costs.
π¦οΈ Setup
Note: after setup.py is executed, 5GB will be used.
Docker will take ~16GB in total.
# Clone the repository:
git clone https://github.com/dothq/lexicon.git
cd lexicon/
# Build Dockerfile
sudo docker build -t translate .
Run the container with sudo docker run -d -p 3000:3000 translate
The default authorization key is universal
Continue without docker:
Install required dependencies:
# Install requirements
pip3 install -r requirements.txt
cd lexicon/
# Download all the available models:
python3 setup.py
# Launch the server
python3 application.py
Your API is then available for use via POST to /translate
(port 3000) using JSON:
Header: Authorization: Bearer TOKEN
(default key universal
)
{
"from": "en",
"to": "es",
"input": "This is a test translation using Dot Lexicon!"
}
Response will be in JSON.
π§ Contributing
We accept all positive contributions that affects this repository and service as a whole; we accept trained .argosmodels files via pull request.
Our models:
(These will automatically be installed on setup via latest.json
)
Language | Source -> Target | Target -> Source |
---|---|---|
nl -> en | en -> nl | |
en -> cy | cy -> en |
β€οΈ Acknowledgements
Argos Translate, which is built on OpenNMT, is widely used in this repository for translation.
π Licenses
Dot Lexicon is licensed under the MIT license.