Abstract:
Existing programming solution recommendation methods either directly ignore the full text of the question or fail to find a suitable way to exert its value, resulting in inaccurate recommendation results. In this paper, we propose MGSMR, a programming task-oriented solution recommendation method based on multi-granularity semantic matching. For a given programming task, MGSMR used the semantic matching model to find relevant question-and-answer discussions as candidate solutions based on two different granularities of the question title and the full text of the question. It further re-ranked the candidate solutions based on the multi-granularity matching method. It combined candidate solutions with external knowledge such as API documentation and third-party libraries to generate recommendation solutions. The evaluation shows that this method outperforms baselines in terms of multiple IR indicators of two datasets by 18%~26% and 2%~4%, and solution generation can help participants solve programming tasks 23% faster and 22% more accurately.