<jupyter_start><jupyter_text>FB Research TranscoderLinks *  [Paper](https://arxiv.org/pdf/2006.03511.pdf)*  [Repository](https://github.com/facebookresearch/TransCoder)  Installing and Integrating Neccessary Packages and Directories<jupyter_code>import os
!pip install six
!pip install sacrebleu=="1.2.11"
!pip install submitit
!pip install clang
# !sudo pip install clang
! cd /usr/lib/x86_64-linux-gnu/
! sudo ln -s libclang-6.0.so.1 libclang.so
# ! cp libclang-6.0.so.1 libclang.so
!git clone https://github.com/glample/fastBPE
os.chdir("fastBPE")
!python setup.py install
os.chdir("..")
! git clone https://github.com/NVIDIA/apex
os.chdir("apex")
!pip install -v --no-cache-dir ./
os.chdir("..")
!git clone https://github.com/facebookresearch/TransCoder.git
!wget https://dl.fbaipublicfiles.com/transcoder/model_2.pth<jupyter_output>--2020-08-20 16:02:52--  https://dl.fbaipublicfiles.com/transcoder/model_2.pth
Resolving dl.fbaipublicfiles.com (dl.fbaipublicfiles.com)... 172.16.31.10, 192.168.3.11, 192.168.3.11, ...
Connecting to dl.fbaipublicfiles.com (dl.fbaipublicfiles.com)|172.16.31.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 622089114 (593M) [application/octet-stream]
Saving to: ‘model_2.pth’

model_2.pth         100%[===================>] 593.27M  62.0MB/s    in 9.8s    

2020-08-20 16:03:02 (60.3 MB/s) - ‘model_2.pth’ saved [622089114/622089114]<jupyter_text>Python -> Java<jupyter_code>!python TransCoder/translate.py --src_lang python --tgt_lang java \\
--BPE_path TransCoder/data/BPE_with_comments_codes --model_path model_2.pth < fibo.py<jupyter_output>Loading codes from /content/TransCoder/data/BPE_with_comments_codes ...
Read 50000 codes from the codes file.
====================
public static int Fibo ( int n ) {
  if ( n < 0 ) System . out . println ( "Incorrect Input" ) ;
  else if ( n == 1 ) return 0 ;
  else if ( n == 2 ) return 1 ;
  else return Fibo ( n - 1 ) + Fibo ( n - 2 ) ;
}
{'fraction_non_alphanumeric': 0.16914402870322912, 'fraction_numerical': 0.08047155304971809, 'mean_word_length': 4.017994858611825, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '485694', 'license': 'MIT', 'n_tokens_mistral': 866, 'n_tokens_neox': 750, 'n_words': 156, 'path': 'FB_Transcoder.ipynb', 'repo_name': 'Codepth-Technologies/FB-Transcoder', 'size': '1952'}