|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.
"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.
or email your comment to: email@example.com
|Last Updated ( Monday, 23 July 2018 )|