Skip to content
Pooya NikbakhtSenior Software Engineer

Data science

A sentiment analysis: predicting communicative intention in code review questions

Classification models that predict the intention behind a code review question, such as asking for a clarification, suggesting an improvement, or asking why something was built a certain way, using the question's words plus key-question, sentiment, and length features.
  • Machine learning
  • NLP
  • Python
  • scikit-learn
  • XGBoost

Background

This project builds on "Communicative Intention in Code Review Questions" by Ebert et al. In code review, developers ask questions to request clarifications, suggest improvements, or ask for explanations about implementation choices. Ebert et al. ran an exploratory case study, manually classifying 499 questions extracted from 399 Android code reviews.

Goal

Build classification models that predict the communicative intention of new code review comments and questions. Besides the words of each question, the study derives three features from the raw questions and looks at how each one affects model accuracy:

  • Key question: the key question inside each raw comment, which carries its intention.
  • Question sentiment: the sentiment of each question.
  • Question length: the length of each question.

Tools

  • Python.
  • scikit-learn and XGBoost to build the classification models and predict the test data, and scikit-learn to evaluate them by accuracy, precision, and recall.
  • NumPy and pandas for data manipulation and analysis.
  • NLTK for sentiment analysis.
  • A Jupyter Notebook, so the code and results can be read together.

More research and earlier projects

See all

Research paper

SCoR: an online Stack Overflow code recommender

A desktop application that takes a developer's question, collects Stack Overflow results in real time, then ranks and clusters the code snippets in the answers so the useful ones are quick to find.

Have a project in mind?

Send a short note on what you're building. I'll reply with questions and a rough plan.