# TransCoder Package
This is a library implementation of the infamous Transcoder model [Unsupervised Translation of Programming Languages](https://arxiv.org/pdf/2006.03511.pdf)
![Model](https://dl.fbaipublicfiles.com/transcoder/TransCoder_Schema.jpg)
## Usage
### Installation
Create a virtual environment and activate it:
```bash
virtualenv venv --python=python3.8
source venv/bin/activate
```
Install library
```bash
pip install transcode
```
If your `libclang.so` is not in `/usr/lib/llvm-10/lib/`, replace the path to `libclang.so` to the correct path in `clang.cindex.Config.set_library_path('path_to_libclang')` in `code_tokenizer.py`
## Translate
Just provide the target and source langauges and the code, and we handle the rest :wink:
```bash
translate --src_lang python --tgt_lang java < input_code.cpp
```
## Train or Evaluate
To train or evaluate the model, please refer to the [original repository](https://github.com/facebookresearch/TransCoder).
Raw data
{
"_id": null,
"home_page": "",
"name": "transcode",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "transcoder,XLM,natural language,facebook,META,pytorch",
"author": "",
"author_email": "Ahmed Heakl <ahmed.heakl@ejust.edu.eg>",
"download_url": "https://files.pythonhosted.org/packages/12/d6/03c0973f04d9412016ea3d24e30174f708c8516d2df93cc3b81d5e3e077b/transcode-1.2.0.tar.gz",
"platform": null,
"description": "# TransCoder Package\nThis is a library implementation of the infamous Transcoder model [Unsupervised Translation of Programming Languages](https://arxiv.org/pdf/2006.03511.pdf)\n![Model](https://dl.fbaipublicfiles.com/transcoder/TransCoder_Schema.jpg)\n\n## Usage\n### Installation\nCreate a virtual environment and activate it:\n```bash\nvirtualenv venv --python=python3.8\nsource venv/bin/activate\n```\nInstall library\n```bash\npip install transcode\n```\n\nIf your `libclang.so` is not in `/usr/lib/llvm-10/lib/`, replace the path to `libclang.so` to the correct path in `clang.cindex.Config.set_library_path('path_to_libclang')` in `code_tokenizer.py` \n\n\n## Translate\nJust provide the target and source langauges and the code, and we handle the rest :wink:\n```bash\ntranslate --src_lang python --tgt_lang java < input_code.cpp\n```\n\n## Train or Evaluate\nTo train or evaluate the model, please refer to the [original repository](https://github.com/facebookresearch/TransCoder).\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Packing transcoder model",
"version": "1.2.0",
"project_urls": {
"repository": "https://github.com/ahmedheakl/transcoder-package"
},
"split_keywords": [
"transcoder",
"xlm",
"natural language",
"facebook",
"meta",
"pytorch"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2d74ed0a800caadaa11fa926694943c4ed9ac48deb4a7c2eb55b2cfbc17de976",
"md5": "8a351f2e886eb54b3675d506703000da",
"sha256": "026d314fef42e169355b3fc6ced095aa701420dc39d17127953e472ac6bc92f6"
},
"downloads": -1,
"filename": "transcode-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a351f2e886eb54b3675d506703000da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 94749,
"upload_time": "2023-09-02T15:25:01",
"upload_time_iso_8601": "2023-09-02T15:25:01.184660Z",
"url": "https://files.pythonhosted.org/packages/2d/74/ed0a800caadaa11fa926694943c4ed9ac48deb4a7c2eb55b2cfbc17de976/transcode-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "12d603c0973f04d9412016ea3d24e30174f708c8516d2df93cc3b81d5e3e077b",
"md5": "e96d9b0e1e085f7a4f633171a3e2ccab",
"sha256": "50d3bfb4ad7e9dda85f5a042a7837f2283ad521363f361868e0b18984848e334"
},
"downloads": -1,
"filename": "transcode-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "e96d9b0e1e085f7a4f633171a3e2ccab",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 81094,
"upload_time": "2023-09-02T15:25:02",
"upload_time_iso_8601": "2023-09-02T15:25:02.997407Z",
"url": "https://files.pythonhosted.org/packages/12/d6/03c0973f04d9412016ea3d24e30174f708c8516d2df93cc3b81d5e3e077b/transcode-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-02 15:25:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ahmedheakl",
"github_project": "transcoder-package",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "transcode"
}