{"id":13689832,"url":"https://github.com/browsermt/bergamot-translator","last_synced_at":"2025-05-02T06:31:22.226Z","repository":{"id":36999045,"uuid":"305366423","full_name":"browsermt/bergamot-translator","owner":"browsermt","description":"Cross platform C++ library focusing on optimized machine translation on the consumer-grade device. ","archived":false,"fork":false,"pushed_at":"2024-05-12T08:51:04.000Z","size":2893,"stargazers_count":375,"open_issues_count":56,"forks_count":42,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-06T04:05:07.370Z","etag":null,"topics":["cpp","cross-platform","emscripten","machine-translation","neural-machine-translation","neural-networks","python","wasm","webassembly"],"latest_commit_sha":null,"homepage":"http://browser.mt","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browsermt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-19T11:49:36.000Z","updated_at":"2025-04-05T19:21:46.000Z","dependencies_parsed_at":"2023-12-20T10:22:38.642Z","dependency_job_id":"2f32c0d1-1d08-43e1-9501-1cda2a17f3e4","html_url":"https://github.com/browsermt/bergamot-translator","commit_stats":{"total_commits":396,"total_committers":18,"mean_commits":22.0,"dds":0.7373737373737373,"last_synced_commit":"82c276a15c23a40bc7e21e8a1e0a289a6ce57017"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browsermt%2Fbergamot-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browsermt%2Fbergamot-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browsermt%2Fbergamot-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browsermt%2Fbergamot-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browsermt","download_url":"https://codeload.github.com/browsermt/bergamot-translator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251998408,"owners_count":21677980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cross-platform","emscripten","machine-translation","neural-machine-translation","neural-networks","python","wasm","webassembly"],"created_at":"2024-08-02T16:00:28.161Z","updated_at":"2025-05-02T06:31:21.858Z","avatar_url":"https://github.com/browsermt.png","language":"C++","funding_links":[],"categories":["Frameworks 🖼"],"sub_categories":[],"readme":"# Bergamot Translator\n\n[![CircleCI badge](https://img.shields.io/circleci/project/github/browsermt/bergamot-translator/main.svg?label=CircleCI)](https://circleci.com/gh/browsermt/bergamot-translator/)\n\nBergamot translator provides a unified API for ([Marian NMT](https://marian-nmt.github.io/) framework based) neural machine translation functionality in accordance with the [Bergamot](https://browser.mt/) project that focuses on improving client-side machine translation in a web browser.\n\n## Build Instructions\n\n### Build Natively\nCreate a folder where you want to build all the artifacts (`build-native` in this case) and compile\n\n```bash\nmkdir build-native\ncd build-native\ncmake ../\nmake -j2\n```\n\n### Build WASM\n#### Prerequisite\n\nBuilding on wasm requires Emscripten toolchain. It can be downloaded and installed using following instructions:\n\n* Get the latest sdk: `git clone https://github.com/emscripten-core/emsdk.git`\n* Enter the cloned directory: `cd emsdk`\n* Install the sdk: `./emsdk install 3.1.8`\n* Activate the sdk: `./emsdk activate 3.1.8`\n* Activate path variables: `source ./emsdk_env.sh`\n\n#### \u003ca name=\"Compile\"\u003e\u003c/a\u003e Compile\n\nTo build a version that translates with higher speeds on Firefox Nightly browser, follow these instructions:\n\n   1. Create a folder where you want to build all the artifacts (`build-wasm` in this case) and compile\n       ```bash\n       mkdir build-wasm\n       cd build-wasm\n       emcmake cmake -DCOMPILE_WASM=on ../\n       emmake make -j2\n       ```\n\n       The wasm artifacts (.js and .wasm files) will be available in the build directory (\"build-wasm\" in this case).\n\n   2. Patch generated artifacts to import GEMM library from a separate wasm module\n       ```bash\n       bash ../wasm/patch-artifacts-import-gemm-module.sh\n       ```\n\nTo build a version that runs on all browsers (including Firefox Nightly) but translates slowly, follow these instructions:\n\n  1. Create a folder where you want to build all the artifacts (`build-wasm` in this case) and compile\n      ```bash\n      mkdir build-wasm\n      cd build-wasm\n      emcmake cmake -DCOMPILE_WASM=on ../\n      emmake make -j2\n      ```\n\n  2. Patch generated artifacts to import GEMM library from a separate wasm module\n       ```bash\n       bash ../wasm/patch-artifacts-import-gemm-module.sh\n       ```\n\n#### Recompiling\nAs long as you don't update any submodule, just follow [Compile](#Compile) steps.\\\nIf you update a submodule, execute following command in repository root folder before executing\n[Compile](#Compile) steps.\n```bash\ngit submodule update --init --recursive\n```\n\n\n## How to use\n\n### Using Native version\n\nThe builds generate library that can be integrated to any project. All the public header files are specified in `src` folder.\\\nA short example of how to use the APIs is provided in `app/bergamot.cpp` file.\n\n### Using WASM version\n\nPlease follow the `README` inside the `wasm` folder of this repository that demonstrates how to use the translator in JavaScript.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowsermt%2Fbergamot-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowsermt%2Fbergamot-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowsermt%2Fbergamot-translator/lists"}