A General Path-Based Representation for Predicting Program Properties

Predicting program properties such as names or expression types has a wide range of applications. It can ease the task of programming and increase programmer productivity. A major challenge when learning from programs is $\textit{how to represent programs in a way that facilitates effective learning...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Alon, Uri, Zilberstein, Meital, Levy, Omer, Yahav, Eran
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page
container_issue
container_start_page
container_title
container_volume
creator Alon, Uri
Zilberstein, Meital
Levy, Omer
Yahav, Eran
description Predicting program properties such as names or expression types has a wide range of applications. It can ease the task of programming and increase programmer productivity. A major challenge when learning from programs is $\textit{how to represent programs in a way that facilitates effective learning}$. We present a $\textit{general path-based representation}$ for learning from programs. Our representation is purely syntactic and extracted automatically. The main idea is to represent a program using paths in its abstract syntax tree (AST). This allows a learning model to leverage the structured nature of code rather than treating it as a flat sequence of tokens. We show that this representation is general and can: (i) cover different prediction tasks, (ii) drive different learning algorithms (for both generative and discriminative models), and (iii) work across different programming languages. We evaluate our approach on the tasks of predicting variable names, method names, and full types. We use our representation to drive both CRF-based and word2vec-based learning, for programs of four languages: JavaScript, Java, Python and C\#. Our evaluation shows that our approach obtains better results than task-specific handcrafted representations across different tasks and programming languages.
doi_str_mv 10.48550/arxiv.1803.09544
format Article
fullrecord <record><control><sourceid>arxiv_GOX</sourceid><recordid>TN_cdi_arxiv_primary_1803_09544</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>1803_09544</sourcerecordid><originalsourceid>FETCH-LOGICAL-a674-87bc687b618b346ab560b2d0d8eaee3f3635ad73ff0851bab3835c7542ed0e183</originalsourceid><addsrcrecordid>eNotj0FOwzAQRb1hgQoHYIUvkGB3bMcsS1UKUqVWqPtoHI-LpTaJJhaC29MWNv_91ZOeEA9a1cZbq56Qv_NXrb2CWj1bY27FaiHX1BPjUe6wfFYvOFGUHzQyTdQXLHnoZRpY7phi7kruD-c7HBhPF47EJdN0J24SHie6_-dM7F9X--Vbtdmu35eLTYWuMZVvQufO47QPYBwG61SYRxU9IREkcGAxNpCS8lYHDODBdo01c4qKtIeZePzTXjvakfMJ-ae99LTXHvgFhflFoA</addsrcrecordid><sourcetype>Open Access Repository</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype></control><display><type>article</type><title>A General Path-Based Representation for Predicting Program Properties</title><source>arXiv.org</source><creator>Alon, Uri ; Zilberstein, Meital ; Levy, Omer ; Yahav, Eran</creator><creatorcontrib>Alon, Uri ; Zilberstein, Meital ; Levy, Omer ; Yahav, Eran</creatorcontrib><description>Predicting program properties such as names or expression types has a wide range of applications. It can ease the task of programming and increase programmer productivity. A major challenge when learning from programs is $\textit{how to represent programs in a way that facilitates effective learning}$. We present a $\textit{general path-based representation}$ for learning from programs. Our representation is purely syntactic and extracted automatically. The main idea is to represent a program using paths in its abstract syntax tree (AST). This allows a learning model to leverage the structured nature of code rather than treating it as a flat sequence of tokens. We show that this representation is general and can: (i) cover different prediction tasks, (ii) drive different learning algorithms (for both generative and discriminative models), and (iii) work across different programming languages. We evaluate our approach on the tasks of predicting variable names, method names, and full types. We use our representation to drive both CRF-based and word2vec-based learning, for programs of four languages: JavaScript, Java, Python and C\#. Our evaluation shows that our approach obtains better results than task-specific handcrafted representations across different tasks and programming languages.</description><identifier>DOI: 10.48550/arxiv.1803.09544</identifier><language>eng</language><subject>Computer Science - Learning ; Computer Science - Programming Languages</subject><creationdate>2018-03</creationdate><rights>http://arxiv.org/licenses/nonexclusive-distrib/1.0</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>228,230,780,885</link.rule.ids><linktorsrc>$$Uhttps://arxiv.org/abs/1803.09544$$EView_record_in_Cornell_University$$FView_record_in_$$GCornell_University$$Hfree_for_read</linktorsrc><backlink>$$Uhttps://doi.org/10.48550/arXiv.1803.09544$$DView paper in arXiv$$Hfree_for_read</backlink></links><search><creatorcontrib>Alon, Uri</creatorcontrib><creatorcontrib>Zilberstein, Meital</creatorcontrib><creatorcontrib>Levy, Omer</creatorcontrib><creatorcontrib>Yahav, Eran</creatorcontrib><title>A General Path-Based Representation for Predicting Program Properties</title><description>Predicting program properties such as names or expression types has a wide range of applications. It can ease the task of programming and increase programmer productivity. A major challenge when learning from programs is $\textit{how to represent programs in a way that facilitates effective learning}$. We present a $\textit{general path-based representation}$ for learning from programs. Our representation is purely syntactic and extracted automatically. The main idea is to represent a program using paths in its abstract syntax tree (AST). This allows a learning model to leverage the structured nature of code rather than treating it as a flat sequence of tokens. We show that this representation is general and can: (i) cover different prediction tasks, (ii) drive different learning algorithms (for both generative and discriminative models), and (iii) work across different programming languages. We evaluate our approach on the tasks of predicting variable names, method names, and full types. We use our representation to drive both CRF-based and word2vec-based learning, for programs of four languages: JavaScript, Java, Python and C\#. Our evaluation shows that our approach obtains better results than task-specific handcrafted representations across different tasks and programming languages.</description><subject>Computer Science - Learning</subject><subject>Computer Science - Programming Languages</subject><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2018</creationdate><recordtype>article</recordtype><sourceid>GOX</sourceid><recordid>eNotj0FOwzAQRb1hgQoHYIUvkGB3bMcsS1UKUqVWqPtoHI-LpTaJJhaC29MWNv_91ZOeEA9a1cZbq56Qv_NXrb2CWj1bY27FaiHX1BPjUe6wfFYvOFGUHzQyTdQXLHnoZRpY7phi7kruD-c7HBhPF47EJdN0J24SHie6_-dM7F9X--Vbtdmu35eLTYWuMZVvQufO47QPYBwG61SYRxU9IREkcGAxNpCS8lYHDODBdo01c4qKtIeZePzTXjvakfMJ-ae99LTXHvgFhflFoA</recordid><startdate>20180326</startdate><enddate>20180326</enddate><creator>Alon, Uri</creator><creator>Zilberstein, Meital</creator><creator>Levy, Omer</creator><creator>Yahav, Eran</creator><scope>AKY</scope><scope>GOX</scope></search><sort><creationdate>20180326</creationdate><title>A General Path-Based Representation for Predicting Program Properties</title><author>Alon, Uri ; Zilberstein, Meital ; Levy, Omer ; Yahav, Eran</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-a674-87bc687b618b346ab560b2d0d8eaee3f3635ad73ff0851bab3835c7542ed0e183</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2018</creationdate><topic>Computer Science - Learning</topic><topic>Computer Science - Programming Languages</topic><toplevel>online_resources</toplevel><creatorcontrib>Alon, Uri</creatorcontrib><creatorcontrib>Zilberstein, Meital</creatorcontrib><creatorcontrib>Levy, Omer</creatorcontrib><creatorcontrib>Yahav, Eran</creatorcontrib><collection>arXiv Computer Science</collection><collection>arXiv.org</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext_linktorsrc</fulltext></delivery><addata><au>Alon, Uri</au><au>Zilberstein, Meital</au><au>Levy, Omer</au><au>Yahav, Eran</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>A General Path-Based Representation for Predicting Program Properties</atitle><date>2018-03-26</date><risdate>2018</risdate><abstract>Predicting program properties such as names or expression types has a wide range of applications. It can ease the task of programming and increase programmer productivity. A major challenge when learning from programs is $\textit{how to represent programs in a way that facilitates effective learning}$. We present a $\textit{general path-based representation}$ for learning from programs. Our representation is purely syntactic and extracted automatically. The main idea is to represent a program using paths in its abstract syntax tree (AST). This allows a learning model to leverage the structured nature of code rather than treating it as a flat sequence of tokens. We show that this representation is general and can: (i) cover different prediction tasks, (ii) drive different learning algorithms (for both generative and discriminative models), and (iii) work across different programming languages. We evaluate our approach on the tasks of predicting variable names, method names, and full types. We use our representation to drive both CRF-based and word2vec-based learning, for programs of four languages: JavaScript, Java, Python and C\#. Our evaluation shows that our approach obtains better results than task-specific handcrafted representations across different tasks and programming languages.</abstract><doi>10.48550/arxiv.1803.09544</doi><oa>free_for_read</oa></addata></record>
fulltext fulltext_linktorsrc
identifier DOI: 10.48550/arxiv.1803.09544
ispartof
issn
language eng
recordid cdi_arxiv_primary_1803_09544
source arXiv.org
subjects Computer Science - Learning
Computer Science - Programming Languages
title A General Path-Based Representation for Predicting Program Properties
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-01T13%3A32%3A01IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-arxiv_GOX&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=A%20General%20Path-Based%20Representation%20for%20Predicting%20Program%20Properties&rft.au=Alon,%20Uri&rft.date=2018-03-26&rft_id=info:doi/10.48550/arxiv.1803.09544&rft_dat=%3Carxiv_GOX%3E1803_09544%3C/arxiv_GOX%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true