ROSF: Leveraging Information Retrieval and Supervised Learning for Recommending Code Snippets
Not on the map. Why?
Abstract (arXiv)
When implementing unfamiliar programming tasks, developers commonly search code examples and learn usage patterns of APIs from the code examples or reuse them by copy-pasting and modifying. For providing high-quality code examples, previous studies present several methods to recommend code snippets mainly based on information retrieval. In this paper, to provide better recommendation results, we propose ROSF, Recommending cOde Snippets with multi-aspect Features, a novel method combining both information retrieval and supervised learning. In our method, we recommend Top-Kcode snippets for a givenfree-form query based on two stages, i.e., coarse-grained searching and fine-grained re-ranking. First, we generate a code snippet candidate set by searching a code snippet corpus using an information retrieval method. Second, we predict probability values of the code snippets for different relevance scores in the candidate set by the learned prediction model from a training set, re-rank these candidate code snippets according to the probability values, and recommend the final results to developers. We conduct several experiments to evaluate our method in a large-scale corpus containing 921,713 real-world code snippets. The results show that ROSF is an effective method for code snippets recommendation and outperforms the-state-of-the-art methods by 20%-41% in Precision and 13%-33% in NDCG
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 4 Mar 2017.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 3; 2023: 0; 2024: 1.
4 papers.
- 2022Automatic Comment Generation via Multi-Pass Deliberationcited by 3
- 2024Refining Joint Text and Source Code Embeddings for Retrieval Task with Parameter-Efficient Fine-Tuningcited by 1
- 2022Code Sophistication: From Code Recommendation to Logic Recommendationcited by 0
- 2022CSSAM:Code Search via Attention Matching of Code Semantics and Structurescited by 0
- 2024Refining Joint Text and Source Code Embeddings for Retrieval Task with Parameter-Efficient Fine-Tuning7 May 2024
- 2022Automatic Comment Generation via Multi-Pass Deliberation14 Sep 2022
- 2022CSSAM:Code Search via Attention Matching of Code Semantics and Structures8 Aug 2022
- 2022Code Sophistication: From Code Recommendation to Logic Recommendation19 Jan 2022