Team Ai
Modelpublic

zachz/code-review-sentiment

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
Model Card

Code Review Sentiment Classifier

A lightweight sklearn-based classifier for code review comments. Classifies review feedback as positive, neutral, or negative.

Model Details

  • —Type: TF-IDF + Logistic Regression pipeline
  • —Task: 3-class text classification
  • —Framework: scikit-learn
  • —Labels: negative (0), neutral (1), positive (2)

Usage

python
import pickle

with open("model.pkl", "rb") as f:
    model = pickle.load(f)

review = "Great implementation, clean code!"
label = model.predict([review])[0]  # 0=negative, 1=neutral, 2=positive
proba = model.predict_proba([review])[0]

Training Data

30 code review comments (10 per class) covering:

  • —Positive: Praise, LGTM, good patterns
  • —Neutral: Suggestions, minor nits, questions
  • —Negative: Bugs, security issues, performance problems

Limitations

  • —Small training set
  • —English only
  • —Focused on software engineering domain

License

MIT