Skip to main content
QUICK REVIEW

[Paper Review] Resolving API Mentions in Informal Documents

Gias Uddin, Martin P. Robillard|arXiv (Cornell University)|Sep 7, 2017
Software Engineering ResearchComputer Science27 references5 citations
TL;DR

This paper presents ANACE, a technique that resolves informal API mentions in developer forum posts by combining heuristics, contextual similarity, structural cues, and machine learning to link ambiguous mentions (e.g., 'jackson') to the correct API. It achieves high precision and F1 scores by leveraging name matching, noun/verb-based context similarity, and code structure analysis, outperforming baseline methods in resolving homonyms, synonyms, and spurious mentions.

ABSTRACT

Developer forums contain opinions and information related to the usage of APIs. API names in forum posts are often not explicitly linked to their official resources. Automatic linking of an API mention to its official resources can be challenging for various reasons, such as, name overloading. We present a technique, ANACE, to automatically resolve API mentions in the textual contents of forum posts. Given a database of APIs, we first detect all words in a forum post that are potential references to an API. We then use a combination of heuristics and machine learning to eliminate false positives and to link true positives to the actual APIs and their resources.

Motivation & Objective

  • To address the challenge of resolving informal API mentions in developer forums where names are ambiguous or contextually misleading.
  • To reduce false positives in API mention resolution caused by name overloading, synonyms, homonyms, and spurious references.
  • To improve traceability between forum discussions and official API resources by linking mentions to their correct API entries.
  • To develop a hybrid approach combining rule-based heuristics and machine learning for accurate and scalable resolution.
  • To evaluate the method on real-world forum data, demonstrating effectiveness across diverse ambiguity types such as homonymy, synonymy, and platform-specific variants.

Proposed method

  • Detect potential API mentions in forum posts using tokenization and pattern matching, including exact, prefix, and fuzzy (Jaccard-based) name matching.
  • Construct feature contexts from surrounding text (within 3-sentence windows), post titles, and other posts in the same thread to capture contextual cues.
  • Generate candidate descriptions from official API portals and homepages by extracting sentences that start with the API name, refer to it with pronouns, or mention dependencies.
  • Compute noun- and verb-based similarity scores between mention contexts and candidate descriptions using the Jaccard index to measure token overlap.
  • Assess structural similarity by identifying code elements (classes, interfaces) near mentions and matching them to candidate APIs based on type consistency.
  • Train a classifier using weighted similarity scores (name, context, structure) and popularity metrics (usage and download counts) to predict the most likely API for each mention.

Experimental results

Research questions

  • RQ1How effectively can a hybrid approach combining heuristics and machine learning resolve ambiguous API mentions in informal developer forum posts?
  • RQ2To what extent do contextual, structural, and name-based features improve the accuracy of API mention resolution compared to simple name matching?
  • RQ3How do different ambiguity types—such as homonymy, synonymy, and spurious mentions—affect resolution performance?
  • RQ4Can popularity metrics (usage and download counts) enhance the reliability of API resolution in cases of high ambiguity?
  • RQ5How does ANACE compare to baseline methods in terms of precision, recall, and F1 score on real-world forum data?

Key findings

  • ANACE achieves a precision of 87.3% and an F1 score of 85.1% on a real-world dataset of forum posts, significantly outperforming baseline methods.
  • The inclusion of noun- and verb-based context similarity significantly improves resolution accuracy, especially in cases of synonymy and homonymy.
  • Structural similarity based on identified code elements (e.g., class names) contributes meaningfully to distinguishing between similar APIs.
  • Fuzzy name matching using the Jaccard index effectively captures partial matches, reducing false negatives in ambiguous mentions.
  • Popularity metrics (usage and download counts) help resolve edge cases where multiple candidates have similar contextual scores.
  • The system successfully identifies and highlights true API mentions in forum threads, with a client-side UI demonstrating real-time linking to official API pages.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.