# Unsupervised Code-Code Translation based on TransCoder

**URL:** <https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405>\
**Category:** Flax/JAX Projects\
**Created:** [June 26, 2021, 5:11am UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405 "2021-06-26T05:11:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![reshinthadith](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/reshinthadith/32/1987_2.png) [@reshinthadith](https://discuss.huggingface.co/u/reshinthadith)\
**Post date:** [June 26, 2021, 5:11am UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/1 "2021-06-26T05:11:10Z")

</div>

The Goal of this project is to train an Unsupervised Code-Code Translation Model. There are a lot of different approaches which modeled Supervised with parallel corpora. There is this particular paper([[2006.03511] Unsupervised Translation of Programming Languages](https://arxiv.org/abs/2006.03511)), which tried to build a Code-Code Translation with no parallel corpora, between languages. This would be a great addition to the Hub too. Let me know if you’re interested.  
Code - [GitHub - facebookresearch/TransCoder: Public release of the TransCoder research project https://arxiv.org/pdf/2006.03511.pdf](https://github.com/facebookresearch/TransCoder)

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/a/abdc2f1d4d9037e325e943c540cd358c1b8df380.png)

---

<div class="post-metadata">

**Author:** ![taisazero](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/taisazero/32/1901_2.png) [@taisazero](https://discuss.huggingface.co/u/taisazero)\
**Post date:** [June 28, 2021, 3:47am UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/2 "2021-06-28T03:47:17Z")

</div>

I’m interested – would the pretraining script on Facebook’s GitHub be enough for reference for us to implement? Is it doable in 7 days?

EDIT: Although I am interested - I may not be able to join/contribute much don’t want to over-commit

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [June 29, 2021, 2:27pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/3 "2021-06-29T14:27:07Z")

</div>

Cool idea! @reshinthadith which model architecture would you like to use? Maybe simply FlaxRoBERTa?

---

<div class="post-metadata">

**Author:** ![reshinthadith](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/reshinthadith/32/1987_2.png) [@reshinthadith](https://discuss.huggingface.co/u/reshinthadith)\
**Post date:** [June 29, 2021, 3:34pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/4 "2021-06-29T15:34:53Z")

</div>

Hello, Patrick. This is Reshinth. The original paper, trained the same on 3 languages(Java, C++ and Python) and their monolingual corpora. So they’ll have 3 Encoders and 3 Decoders. To make it feasible and reduce the complexity, shall we reduce the entire problem to 1 way Translation b/w just two languages. Say (Python to C++) ? This would require us to have 1 Encoder and 1 Decoder. Let me know what you think.  
So, the end objective is to have a Seq2Seq Model which can translate from py2cpp, trained with no parallel corpora.  
And yes we can use FlaxRoBERTa for the Encoder and the Decoder.

---

<div class="post-metadata">

**Author:** ![bharat-raghunathan](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bharat-raghunathan/32/4726_2.png) [@bharat-raghunathan](https://discuss.huggingface.co/u/bharat-raghunathan)\
**Post date:** [June 29, 2021, 5:55pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/5 "2021-06-29T17:55:15Z")

</div>

I’m interested! Particularly in doing Python to C++ or vice-versa as I have experience in both languages! Could I join if spots are still available? I also have some knowledge of Github APIs which may help to fetch some of the code corpora, and let’s hope we can leverage Facebook’s pretraining scripts or slightly tweak it for our needs

---

<div class="post-metadata">

**Author:** ![ncoop57](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ncoop57/32/3107_2.png) [@ncoop57](https://discuss.huggingface.co/u/ncoop57)\
**Post date:** [June 30, 2021, 2:13pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/6 "2021-06-30T14:13:50Z")

</div>

I’m super interested in this too!!! I’d be down to help out. I think we could even add some natural language too it to do unsupervised code documentation 🤓

---

<div class="post-metadata">

**Author:** ![reshinthadith](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/reshinthadith/32/1987_2.png) [@reshinthadith](https://discuss.huggingface.co/u/reshinthadith)\
**Post date:** [June 30, 2021, 2:25pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/7 "2021-06-30T14:25:32Z")

</div>

Hello, Bharat. The feasibility with respect to the existing repo is somewhat negligent. It’s written in pure pytorch. We’ll see onto how far we can use it.

---

<div class="post-metadata">

**Author:** ![reshinthadith](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/reshinthadith/32/1987_2.png) [@reshinthadith](https://discuss.huggingface.co/u/reshinthadith)\
**Post date:** [June 30, 2021, 2:38pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/8 "2021-06-30T14:38:25Z")

</div>

We sure, can try this. This is interesting.

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [July 1, 2021, 10:23am UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/9 "2021-07-01T10:23:15Z")

</div>

Awesome - finalized the project and added you all!

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [July 1, 2021, 10:24am UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/10 "2021-07-01T10:24:18Z")

</div>

@reshinthadith - I see if you need an encoder-decoder architecture, I think FlaxT5 would be a good choice 🙂

---

<div class="post-metadata">

**Author:** ![Omnime](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/omnime/32/674_2.png) [@Omnime](https://discuss.huggingface.co/u/Omnime)\
**Post date:** [July 5, 2021, 7:13pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/11 "2021-07-05T19:13:42Z")

</div>

Hello, people. Reach out for discussion at #minimal-unsupervised-transcoder. The code is available at [GitHub - reshinthadithyan/hf\_jax\_transcoder\_mini: A Minimal version of Transcoder built with Jax](https://github.com/reshinthadithyan/hf_jax_transcoder_mini). Feel free to contribute, Thanks.  
- Reshinth

---

<div class="post-metadata">

**Author:** ![ggm](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@ggm](https://discuss.huggingface.co/u/ggm)\
**Post date:** [June 28, 2023, 2:17pm UTC](https://discuss.huggingface.co/t/unsupervised-code-code-translation-based-on-transcoder/7405/12 "2023-06-28T14:17:36Z")

</div>

Hello everyone, can I get model card name of the TransCoder Model in Hugging Face, just for fine-tuning?

Thank you
