Exploring Code Style Transfer with Neural Networks

09/13/2022
by   Karl Munson, et al.
0

Style is a significant component of natural language text, reflecting a change in the tone of text while keeping the underlying information the same. Even though programming languages have strict syntax rules, they also have style. Code can be written with the same functionality but using different language features. However, programming style is difficult to quantify, and thus as part of this work, we define style attributes, specifically for Python. To build a definition of style, we utilized hierarchical clustering to capture a style definition without needing to specify transformations. In addition to defining style, we explore the capability of a pre-trained code language model to capture information about code style. To do this, we fine-tuned pre-trained code-language models and evaluated their performance in code style transfer tasks.

READ FULL TEXT
research
09/18/2021

Text Detoxification using Large Pre-trained Neural Models

We present two novel unsupervised methods for eliminating toxicity in te...
research
06/22/2020

Exploring Software Naturalness throughNeural Language Models

The Software Naturalness hypothesis argues that programming languages ca...
research
07/21/2017

Learning Program Component Order

Successful programs are written to be maintained. One aspect to this is ...
research
05/23/2022

Prompt-and-Rerank: A Method for Zero-Shot and Few-Shot Arbitrary Textual Style Transfer with Small Language Models

We propose a method for arbitrary textual style transfer (TST)–the task ...
research
04/01/2019

STYLE-ANALYZER: fixing code style inconsistencies with interpretable unsupervised algorithms

Source code reviews are manual, time-consuming, and expensive. Human inv...
research
06/05/2023

Identifying the style by a qualified reader on a short fragment of generated poetry

Style is an important concept in today's challenges in natural language ...
research
06/01/2021

Improving Formality Style Transfer with Context-Aware Rule Injection

Models pre-trained on large-scale regular text corpora often do not work...

Please sign up or login with your details

Forgot password? Click here to reset