Bing Adds Intelligent Code Search
Written by Kay Ewbank   
Monday, 23 July 2018

There's a new search option in Bing called Code Sample Answer that you can use to find code that matches what you ask for in a question. You describe the code you're looking for, and it is extracted from an article and placed in the requested programming language.

The example given is a question of 'convert case using a function in R', with results then been extracted and a link to the corresponding article. The developers say this isn't limited to programming languages from Microsoft:

"We wanted our solution to support a broad range of programming languages. For Bing to be able to satisfy this requirement and find a corresponding code snippet answering a user’s query, it had to be able to parse and understand those instructions, the syntax and form of the many different programming languages."

In addition, the Bing developers know that a good solution would be able to cope with questions phrased using natural language:

"Bing needs to be able to map the intent of the query (expressed in natural language) to the intent of a code sample (expressed in a programming language) in order to find the most relevant code sample for the query."

The Microsoft team made use of Bing’s Natural Language Processing (NLP) technology and "language agnostic code understanding capabilities" to come up with a solution that did allow natural language queries to be used to ask questions pertaining to many programming languages.

bingsearch

When a query is issued on Bing.com, it is first classified based on its intent as code or non-code type of query. The search algorithm places high confidence of coding intent to avoid showing code-based answers when people are actually asking non-code questions - Chai or Mocha could be about what drink is preferable, whereas "Chai or Mocha assert” is more obviously about JavaScript testing frameworks.

"In ambiguous cases such as this one, web results will continue to honor all likely intents and the Code Answer may be suppressed. It is only when Bing intelligently detects the coding intent with high confidence that that Code Sample Answer will trigger:"

To avoid incorrect identification of coding queries, the natural language processing pipelines for developers make use of patterns found in training data from developer queries collected over the years containing commonly used terms and text structure typical for coding queries.

The engine then looks at specific syntax, and any API, tool or language names used in the query to work out the language. The system then extracts the best matched code samples from popular, authoritative and well moderated sites like Stackoverflow, Github, W3Schools, MSDN, Tutorialpoints, etc. The solution is chosen by taking into account not only the API and programming language match, but how the solution has been voted in terms of up and down votes, and the completeness of the solution.

It is, of course, possible to get equally good results from a more standard search. It will be interesting to see whether this addition will make developers choose Bing for searching over other search options.

 

binglogo

 

 

More Information

Sample Bing Search for convert case using a function in R

Bing Blog On Code Search

Related Articles

Bing As A Platform

Search Engines

Google Now Helps You Search For || And More

RankBrain - AI Comes To Google Search 

Hummingbird - A New Google Search Algorithm       

Google Search Goes Semantic - The Knowledge Graph       

Google Needs a New Search Algorithm

Google's War On Links - Prohibition All Over Again

Focus on Google Search

How does Google search?  

Google Explains How AI Photo Search Works       

The Myth of Search 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Insights From AI Index 2024 Report
17/04/2024

Published this week, the latest Stanford HAI AI Index report tracks worldwide trends in AI. A mix of its new research and findings from many other sources, it provides a wide ranging look at how  [ ... ]



Microsoft Introduces .NET Smart Components
01/04/2024

Microsoft has provided a set of .NET Smart Components, described as a set of genuinely useful AI-powered UI components that you can quickly and easily add to .NET apps. The components are prebuilt end [ ... ]


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 23 July 2018 )