PyMT5: Multi-mode Translation of Natural Language and Python Code with Transformers

By Colin B. Clement, Dawn Drain, Jonathan Timcheck, Alexey Svyatkovskiy, Neel Sundaresan. 2020

168 citations recorded by the source corpus.

Simultaneously modeling source code and natural language has many exciting applications in automated software development and understanding. Pursuant to achieving such technology, we introduce PyMT5, the Python method text-to-text transfer transformer, which is trained to translate between all pairs of Python method feature combinations: a single model that can both predict whole methods from natural language documentation strings (docstrings) and summarize code into docstrings of any common style. We present an analysis and modeling effort of a large-scale parallel corpus of 26 million Python methods and 7.7 million method-docstring pairs, demonstrating that for docstring and method generation, PyMT5 outperforms similarly-sized auto-regressive language models (GPT2) which were English pre-trained or randomly initialized. On the CodeSearchNet test set, our best model predicts 92.1% syntactically correct method bodies, achieved a BLEU score of 8.59 for method generation and 16.3 for docstring generation (summarization), and achieved a ROUGE-L F-score of 24.8 for method generation and 36.7 for docstring generation.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Natural Language Processing, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Mohit Bansal
  2. Jianfeng Gao
  3. Quoc V. Le
  4. Sergey Levine
  5. Luke S. Zettlemoyer
  6. Percy Liang
  7. Graham Neubig
  8. Yoshua Bengio

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Dacheng Tao
  3. Trevor Darrell
  4. Ming-Hsuan Yang
  5. Jitendra Malik
  6. Xiaogang Wang
  7. Andrew Zisserman
  8. Andrea Vedaldi

In Natural Language Processing

  1. Mohit Bansal
  2. Jianfeng Gao
  3. Quoc V. Le
  4. Graham Neubig
  5. Kyunghyun Cho
  6. Richard Socher
  7. Caiming Xiong
  8. Luke S. Zettlemoyer

In Code Generation & Program Synthesis

  1. Charles Sutton
  2. Wasi Uddin Ahmad
  3. Baishakhi Ray
  4. Pushmeet Kohli
  5. Xinyun Chen
  6. Michele Tufano
  7. Saikat Chakraborty
  8. Augustus Odena

Citations in the corpus