{"id":5,"date":"2018-09-18T00:00:00","date_gmt":"2018-09-18T07:00:00","guid":{"rendered":"https:\/\/github.test\/2018-09-18-towards-natural-language-semantic-code-search\/"},"modified":"2019-03-07T11:43:50","modified_gmt":"2019-03-07T19:43:50","slug":"towards-natural-language-semantic-code-search","status":"publish","type":"post","link":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/","title":{"rendered":"Towards Natural Language Semantic Code Search"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg\" alt=\"Hubot\" \/><\/p>\n<h5 id=\"this-blog-post-complements-a-live-demonstration-on-our-recently-announced-site-experiments-github-com\"><a class=\"heading-link\" href=\"#this-blog-post-complements-a-live-demonstration-on-our-recently-announced-site-experiments-github-com\">This blog post complements a live demonstration on our <a href=\"https:\/\/blog.github.com\/2018-09-18-introducing-experiments-an-ongoing-research-effort-from-github\/\">recently announced<\/a> site: <a href=\"https:\/\/experiments.github.com\/\">experiments.github.com<\/a><span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h5>\n<h2 id=\"motivation\"><a class=\"heading-link\" href=\"#motivation\">Motivation<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>Searching code on GitHub is currently limited to keyword search. This assumes either the user knows the syntax, or can anticipate what keywords might be in comments surrounding the code they are looking for. Our machine learning scientists have been researching ways to enable the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Semantic_search\">semantic search<\/a> of code.<\/p>\n<p>To fully grasp the concept of semantic search, consider the below search query, <em>&#8220;ping REST api and return results&#8221;<\/em>:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/hubot_codesearch.gif\" alt=\"Vector-space diagram\" \/><\/p>\n<p>Note that the demonstrated semantic search returns reasonable results even though there are no keywords in common between the search query and the text (the code &amp; comments found do not contain the words &#8220;Ping&#8221;, &#8220;REST&#8221; or &#8220;api&#8221;)! The implications of augmenting keyword search with semantic search are profound. For example, such a capability would expedite the process of on-boarding new software engineers onto projects and bolster the discoverability of code in general.<\/p>\n<p>In this post, we want to share how we are leveraging deep learning to make progress towards this goal. <em>We also share an open source example with code and data that you can use to reproduce these results!<\/em><\/p>\n<h2 id=\"introduction\"><a class=\"heading-link\" href=\"#introduction\">Introduction<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>One of the key areas of machine learning research underway at GitHub is representation learning of entities, such as repos, code, issues, profiles and users. We have made significant progress towards enabling semantic search by learning representations of code that share a common vector space as text. For example, consider the below diagram:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/shared_vecs.png\" alt=\"Vector-space diagram\" \/><\/p>\n<p>In the above example, Text 2 (blue) is a reasonable description of the code, whereas Text 1 (red) is not related to the code at all. Our goal is to learn representations where (text, code) pairs that describe the same concept are close neighbors, whereas unrelated (text, code) pairs are further apart. By representing text and code in the same vector space, we can vectorize a user\u2019s search query and lookup the nearest neighbor that represents code. Below is a four-part description of the approach we are currently using to accomplish this task:<\/p>\n<h3 id=\"1-learning-representations-of-code\"><a class=\"heading-link\" href=\"#1-learning-representations-of-code\">1. Learning Representations of Code<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>In order to learn a representation of code, we train a <a href=\"https:\/\/towardsdatascience.com\/how-to-create-data-products-that-are-magical-using-sequence-to-sequence-models-703f86a231f8\">sequence-to-sequence model<\/a> that learns to summarize code. A way to accomplish this for Python is to supply (code, docstring) pairs where the docstring is the target variable the model is trying to predict. One active area of research for us is incorporating domain specific optimizations like <a href=\"https:\/\/arxiv.org\/pdf\/1802.00921.pdf\">tree-based LSTMs<\/a>, <a href=\"https:\/\/github.com\/Microsoft\/gated-graph-neural-network-samples\">gated-graph networks<\/a> and syntax-aware tokenization. Below is a screenshot that showcases the code summarizer model at work. In this example, there are two python functions supplied as input, and in both cases the model produces a reasonable summary of the code as output:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/code_summarizer.png\" alt=\"code summarizer\" \/><\/p>\n<p>It should be noted that in the above examples, the model produces the summary by using the entire code blob, not merely the function name.<\/p>\n<p>Building a code summarizer is a very exciting project on its own, however, we can utilize the encoder from this model as a general purpose feature extractor for code. After extracting the encoder from this model, we can <a href=\"https:\/\/flyyufelix.github.io\/2016\/10\/03\/fine-tuning-in-keras-part1.html\">fine-tune<\/a> it for the task of mapping code to the vector space of natural language.<\/p>\n<p>We can evaluate this model objectively using the <a href=\"https:\/\/en.wikipedia.org\/wiki\/BLEU\">BLEU score<\/a>. Currently we have been able to achieve a BLEU score of 13.5 on a holdout set of python code, using the <a href=\"https:\/\/github.com\/pytorch\/fairseq\">fairseq-py library<\/a> for sequence to sequence models.<\/p>\n<h3 id=\"2-learning-representations-of-text-phrases\"><a class=\"heading-link\" href=\"#2-learning-representations-of-text-phrases\">2. Learning Representations of Text Phrases<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>In addition to learning a representation for code, we needed to find a suitable representation for short phrases (like sentences found in Python docstrings). Initially, we experimented with the <a href=\"https:\/\/arxiv.org\/abs\/1803.11175\">Universal Sentence Encoder<\/a>, a pre-trained encoder for text that is <a href=\"https:\/\/www.tensorflow.org\/hub\/modules\/google\/universal-sentence-encoder\/1\">available on TensorFlow Hub<\/a>. While the embeddings from worked reasonably well, we found that it was advantageous to learn embeddings that were specific to the vocabulary and semantics of software development. One area of ongoing research involves evaluating different domain-specific corpuses for training our own model, ranging from GitHub issues to third party datasets.<\/p>\n<p>To learn this representation of phrases, we trained a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Language_model\">neural language model<\/a> by leveraging the <a href=\"https:\/\/github.com\/fastai\/fastai\">fast.ai<\/a> library. This library gave us easy access to state of the art architectures such as <a href=\"https:\/\/arxiv.org\/pdf\/1708.02182.pdf\">AWD LSTMs<\/a>, and to techniques such as <a href=\"https:\/\/arxiv.org\/abs\/1506.01186\">cyclical learning rates<\/a> with random restarts. We extracted representations of phrases from this model by summarizing the hidden states using the concat pooling approach found in <a href=\"https:\/\/arxiv.org\/pdf\/1801.06146.pdf\">this paper<\/a>.<\/p>\n<p>One of the most challenging aspects of this exercise was to evaluate the quality of these embeddings. We are currently building a variety of downstream supervised tasks similar to those <a href=\"https:\/\/github.com\/facebookresearch\/SentEval\">outlined here<\/a> that will aid us in evaluating the quality of these embeddings objectively. In the meantime, we sanity check our embeddings by manually examining the similarity between similar phrases. The below screenshot illustrates examples where we search the vectorized docstrings for similarity against user-supplied phrases:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/vec_sim.png\" alt=\"vec sim\" \/><\/p>\n<h3 id=\"3-mapping-code-representations-to-the-same-vector-space-as-text\"><a class=\"heading-link\" href=\"#3-mapping-code-representations-to-the-same-vector-space-as-text\">3. Mapping Code Representations To The Same Vector-Space as Text<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>Next, we map the code representations we learned from the code summarization model (part 1) to the vector space of text. We accomplish this by fine-tuning the encoder of this model. The inputs to this model are still code blobs, however the target variable the model is now the vectorized version of docstrings. These docstrings are vectorized using the approach discussed in the previous section.<\/p>\n<p>Concretely, we perform multi-dimensional regression with <a href=\"https:\/\/keras.io\/losses\/\">cosine proximity loss<\/a> to bring the hidden state of the encoder into the same vector-space as text.<\/p>\n<p>We are actively researching alternate approaches that directly learn a joint vector space of code and natural language, borrowing from some ideas outlined <a href=\"https:\/\/arxiv.org\/abs\/1705.00652\">here<\/a>.<\/p>\n<h3 id=\"4-creating-a-semantic-search-system\"><a class=\"heading-link\" href=\"#4-creating-a-semantic-search-system\">4. Creating a Semantic Search System<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>Finally, after successfully creating a model that can vectorize code into the same vector-space as text, we can create a semantic search mechanism. In its most simple form, we can store the vectorized version of all code in a database, and perform nearest neighbor lookups to a vectorized search query.<\/p>\n<p>Another active area of our research is determining the best way to augment existing keyword search with semantic results and how to incorporate additional information such as context and relevance.<br \/>\nFurthermore, we are actively exploring ways to evaluate the quality of search results that will allow us to iterate quickly on this problem. We leave these topics for discussion in a future blog post.<\/p>\n<h2 id=\"summary\"><a class=\"heading-link\" href=\"#summary\">Summary<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>The below diagram summarizes all the steps in our current semantic-search workflow:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/overview.png\" alt=\"code summarizer\" \/><\/p>\n<p>We are exploring ways to improve almost every component of this approach, including data preparation, model architecture, evaluation procedures, and overall system design. What is described in this blog post is only a minimal example that scratches the surface.<\/p>\n<h2 id=\"open-source-examples\"><a class=\"heading-link\" href=\"#open-source-examples\">Open Source Examples<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>Our <a href=\"https:\/\/towardsdatascience.com\/semantic-code-search-3cd6d244a39c\">open-source end-to-end tutorial<\/a> contains a detailed walkthrough of the approach outlined in this blog, along with code and data you can use to reproduce the results.<\/p>\n<p>This open source example (with some modifications) is also used as a tutorial for the <a href=\"https:\/\/www.kubeflow.org\/\">kubeflow<\/a> project, which is implemented <a href=\"https:\/\/github.com\/kubeflow\/examples\/tree\/master\/code_search\">here<\/a>.<\/p>\n<h3 id=\"limitations-and-intended-use-cases\"><a class=\"heading-link\" href=\"#limitations-and-intended-use-cases\">Limitations and Intended Use Case(s)<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>We believe that semantic code search will be most useful for targeted searches of code within specific entities such as repos, organizations or users as opposed to general purpose &#8220;how to&#8221; queries. The <a href=\"https:\/\/experiments.github.com\/semantic-code-search\">live demonstration<\/a> of semantic code search hosted on our <a href=\"https:\/\/blog.github.com\/2018-09-18-introducing-experiments-an-ongoing-research-effort-from-github\/\">recently announced Experiments site<\/a> does not allow users to perform targeted searches of repos. Instead, this demonstration is designed to share a taste of what might be possible and searches only a limited, static set of python code.<\/p>\n<p>Furthermore, like all machine learning techniques, the efficacy of this approach is limited by the training data used. For example, the data used to train these models are (code, docstring) pairs. Therefore, search queries that closely resemble a docstring have the greatest chance of success. On the other hand, queries that do not resemble a docstring or contain concepts for which there is little data may not yield sensible results. Therefore, it is not difficult to challenge our <a href=\"https:\/\/experiments.github.com\/semantic-code-search\">live demonstration<\/a> and discover the limitations of this approach. Nevertheless, our initial results indicate that this is an extremely fruitful area of research that we are excited to share with you.<\/p>\n<p>There are many more use cases for semantic code search. For example, we could extend the ideas presented here to allow users to search for code using the language of their choice (French, Mandarin, Arabic, etc.) across many different programming languages simultaneously.<\/p>\n<h2 id=\"get-in-touch\"><a class=\"heading-link\" href=\"#get-in-touch\">Get In Touch<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>This is an exciting time for the machine learning research team at GitHub and we are looking to expand. If our work interests you, please <a href=\"https:\/\/github.com\/about\/careers\">get in touch<\/a>!<\/p>\n<h2 id=\"contributors\"><a class=\"heading-link\" href=\"#contributors\">Contributors<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<div class=\"author-bio clearfix\"><a class=\"bio-author-image\" href=\"https:\/\/github.com\/hamelsmu\"><img decoding=\"async\" loading=\"lazy\" class=\"avatar\" src=\"https:\/\/avatars0.githubusercontent.com\/hamelsmu?v=3&amp;s=120\" srcset=\"https:\/\/avatars0.githubusercontent.com\/hamelsmu?v=3&amp;s=120 1x, https:\/\/avatars0.githubusercontent.com\/hamelsmu?v=3&amp;s=240 2x, https:\/\/avatars0.githubusercontent.com\/hamelsmu?v=3&amp;s=360 3x, https:\/\/avatars0.githubusercontent.com\/hamelsmu?v=3&amp;s=480 4x\" alt=\"hamelsmu\" width=\"120\" height=\"120\" data-proofer-ignore=\"true\" \/><\/a><\/p>\n<div class=\"bio-author-who\"><a class=\"bio-author-name\" href=\"https:\/\/github.com\/hamelsmu\">hamelsmu<\/a><\/div>\n<\/div>\n<div>\n<hr \/>\n<\/div>\n<div><\/div>\n<div class=\"author-bio clearfix\"><a class=\"bio-author-image\" href=\"https:\/\/github.com\/hohsiangwu\"><img decoding=\"async\" loading=\"lazy\" class=\"avatar\" src=\"https:\/\/avatars3.githubusercontent.com\/hohsiangwu?v=3&amp;s=120\" srcset=\"https:\/\/avatars3.githubusercontent.com\/hohsiangwu?v=3&amp;s=120 1x, https:\/\/avatars3.githubusercontent.com\/hohsiangwu?v=3&amp;s=240 2x, https:\/\/avatars3.githubusercontent.com\/hohsiangwu?v=3&amp;s=360 3x, https:\/\/avatars3.githubusercontent.com\/hohsiangwu?v=3&amp;s=480 4x\" alt=\"hohsiangwu\" width=\"120\" height=\"120\" data-proofer-ignore=\"true\" \/><\/a><\/p>\n<div class=\"bio-author-who\"><a class=\"bio-author-name\" href=\"https:\/\/github.com\/hohsiangwu\">hohsiangwu<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p> Our machine learning scientists have been researching ways to enable the semantic search of code.<\/p>\n","protected":false},"author":1672,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_gh_post_show_toc":"","_gh_post_is_no_robots":"","_gh_post_is_featured":"","_gh_post_is_excluded":"","_gh_post_is_unlisted":"","_gh_post_related_link_1":"","_gh_post_related_link_2":"","_gh_post_related_link_3":"","_gh_post_sq_img":"","_gh_post_sq_img_id":"","_gh_post_cta_title":"","_gh_post_cta_text":"","_gh_post_cta_link":"","_gh_post_cta_button":"","_gh_post_recirc_hide":"","_gh_post_recirc_col_1":"","_gh_post_recirc_col_2":"","_gh_post_recirc_col_3":"","_gh_post_recirc_col_4":"","_featured_video":"","_gh_post_additional_query_params":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false,"_links_to":"","_links_to_target":""},"categories":[3293,3297],"tags":[],"coauthors":[],"class_list":["post-5","post","type-post","status-publish","format-standard","hentry","category-ai-and-ml","category-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.6 (Yoast SEO v28.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Towards Natural Language Semantic Code Search - The GitHub Blog<\/title>\n<meta name=\"description\" content=\"Our machine learning scientists have been researching ways to enable the semantic search of code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Towards Natural Language Semantic Code Search\" \/>\n<meta property=\"og:description\" content=\"Our machine learning scientists have been researching ways to enable the semantic search of code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/\" \/>\n<meta property=\"og:site_name\" content=\"The GitHub Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-18T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-07T19:43:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg\" \/>\n<meta name=\"author\" content=\"GitHub Engineering\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GitHubEng\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GitHub Engineering\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/\"},\"author\":{\"name\":\"GitHub Engineering\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/7106593b0a597999b867335e3ac6c612\"},\"headline\":\"Towards Natural Language Semantic Code Search\",\"datePublished\":\"2018-09-18T07:00:00+00:00\",\"dateModified\":\"2019-03-07T19:43:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/\"},\"wordCount\":1422,\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/main.jpg\",\"articleSection\":[\"AI &amp; ML\",\"Machine learning\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/\",\"url\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/\",\"name\":\"Towards Natural Language Semantic Code Search - The GitHub Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/main.jpg\",\"datePublished\":\"2018-09-18T07:00:00+00:00\",\"dateModified\":\"2019-03-07T19:43:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/7106593b0a597999b867335e3ac6c612\"},\"description\":\"Our machine learning scientists have been researching ways to enable the semantic search of code.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#primaryimage\",\"url\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/main.jpg?fit=896%2C896\",\"contentUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/main.jpg?fit=896%2C896\",\"width\":896,\"height\":896,\"caption\":\"Hubot\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/towards-natural-language-semantic-code-search\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/github.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI &amp; ML\",\"item\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Machine learning\",\"item\":\"https:\\\/\\\/github.blog\\\/ai-and-ml\\\/machine-learning\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Towards Natural Language Semantic Code Search\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/github.blog\\\/#website\",\"url\":\"https:\\\/\\\/github.blog\\\/\",\"name\":\"The GitHub Blog\",\"description\":\"Updates, ideas, and inspiration from GitHub to help developers build and design software.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/github.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/7106593b0a597999b867335e3ac6c612\",\"name\":\"GitHub Engineering\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8198f503b6c42d5ed60295916cf3360e7777f783bd1506dca4fe358e2fbc56e6?s=96&d=mm&r=g8784813b8f415147efa53dc248e90b84\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8198f503b6c42d5ed60295916cf3360e7777f783bd1506dca4fe358e2fbc56e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8198f503b6c42d5ed60295916cf3360e7777f783bd1506dca4fe358e2fbc56e6?s=96&d=mm&r=g\",\"caption\":\"GitHub Engineering\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/@GitHubEng\"],\"url\":\"https:\\\/\\\/github.blog\\\/author\\\/githubengineering\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Towards Natural Language Semantic Code Search - The GitHub Blog","description":"Our machine learning scientists have been researching ways to enable the semantic search of code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/","og_locale":"en_US","og_type":"article","og_title":"Towards Natural Language Semantic Code Search","og_description":"Our machine learning scientists have been researching ways to enable the semantic search of code.","og_url":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/","og_site_name":"The GitHub Blog","article_published_time":"2018-09-18T07:00:00+00:00","article_modified_time":"2019-03-07T19:43:50+00:00","og_image":[{"url":"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg","type":"","width":"","height":""}],"author":"GitHub Engineering","twitter_card":"summary_large_image","twitter_creator":"@GitHubEng","twitter_misc":{"Written by":"GitHub Engineering","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#article","isPartOf":{"@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/"},"author":{"name":"GitHub Engineering","@id":"https:\/\/github.blog\/#\/schema\/person\/7106593b0a597999b867335e3ac6c612"},"headline":"Towards Natural Language Semantic Code Search","datePublished":"2018-09-18T07:00:00+00:00","dateModified":"2019-03-07T19:43:50+00:00","mainEntityOfPage":{"@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/"},"wordCount":1422,"image":{"@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg","articleSection":["AI &amp; ML","Machine learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/","url":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/","name":"Towards Natural Language Semantic Code Search - The GitHub Blog","isPartOf":{"@id":"https:\/\/github.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#primaryimage"},"image":{"@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg","datePublished":"2018-09-18T07:00:00+00:00","dateModified":"2019-03-07T19:43:50+00:00","author":{"@id":"https:\/\/github.blog\/#\/schema\/person\/7106593b0a597999b867335e3ac6c612"},"description":"Our machine learning scientists have been researching ways to enable the semantic search of code.","breadcrumb":{"@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#primaryimage","url":"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg?fit=896%2C896","contentUrl":"https:\/\/github.blog\/wp-content\/uploads\/2018\/09\/main.jpg?fit=896%2C896","width":896,"height":896,"caption":"Hubot"},{"@type":"BreadcrumbList","@id":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/towards-natural-language-semantic-code-search\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/github.blog\/"},{"@type":"ListItem","position":2,"name":"AI &amp; ML","item":"https:\/\/github.blog\/ai-and-ml\/"},{"@type":"ListItem","position":3,"name":"Machine learning","item":"https:\/\/github.blog\/ai-and-ml\/machine-learning\/"},{"@type":"ListItem","position":4,"name":"Towards Natural Language Semantic Code Search"}]},{"@type":"WebSite","@id":"https:\/\/github.blog\/#website","url":"https:\/\/github.blog\/","name":"The GitHub Blog","description":"Updates, ideas, and inspiration from GitHub to help developers build and design software.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/github.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/github.blog\/#\/schema\/person\/7106593b0a597999b867335e3ac6c612","name":"GitHub Engineering","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8198f503b6c42d5ed60295916cf3360e7777f783bd1506dca4fe358e2fbc56e6?s=96&d=mm&r=g8784813b8f415147efa53dc248e90b84","url":"https:\/\/secure.gravatar.com\/avatar\/8198f503b6c42d5ed60295916cf3360e7777f783bd1506dca4fe358e2fbc56e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8198f503b6c42d5ed60295916cf3360e7777f783bd1506dca4fe358e2fbc56e6?s=96&d=mm&r=g","caption":"GitHub Engineering"},"sameAs":["https:\/\/x.com\/@GitHubEng"],"url":"https:\/\/github.blog\/author\/githubengineering\/"}]}},"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pamS32-5","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/users\/1672"}],"replies":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":4,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":48126,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/5\/revisions\/48126"}],"wp:attachment":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/tags?post=5"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/coauthors?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}