zach commited on
Commit
ac81450
·
0 Parent(s):

Add trained model and model card

Browse files
Files changed (3) hide show
  1. README.md +52 -0
  2. config.json +11 -0
  3. model.pkl +0 -0
README.md ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ library_name: sklearn
5
+ tags:
6
+ - text-classification
7
+ - sentiment-analysis
8
+ - code-review
9
+ - sklearn
10
+ pipeline_tag: text-classification
11
+ ---
12
+
13
+ # Code Review Sentiment Classifier
14
+
15
+ A lightweight sklearn-based classifier for code review comments. Classifies review feedback as positive, neutral, or negative.
16
+
17
+ ## Model Details
18
+
19
+ - **Type:** TF-IDF + Logistic Regression pipeline
20
+ - **Task:** 3-class text classification
21
+ - **Framework:** scikit-learn
22
+ - **Labels:** negative (0), neutral (1), positive (2)
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ import pickle
28
+
29
+ with open("model.pkl", "rb") as f:
30
+ model = pickle.load(f)
31
+
32
+ review = "Great implementation, clean code!"
33
+ label = model.predict([review])[0] # 0=negative, 1=neutral, 2=positive
34
+ proba = model.predict_proba([review])[0]
35
+ ```
36
+
37
+ ## Training Data
38
+
39
+ 30 code review comments (10 per class) covering:
40
+ - **Positive:** Praise, LGTM, good patterns
41
+ - **Neutral:** Suggestions, minor nits, questions
42
+ - **Negative:** Bugs, security issues, performance problems
43
+
44
+ ## Limitations
45
+
46
+ - Small training set
47
+ - English only
48
+ - Focused on software engineering domain
49
+
50
+ ## License
51
+
52
+ MIT
config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "sklearn-pipeline",
3
+ "task": "text-classification",
4
+ "labels": {
5
+ "0": "negative",
6
+ "1": "neutral",
7
+ "2": "positive"
8
+ },
9
+ "features": "tfidf",
10
+ "accuracy": 0.3666666666666667
11
+ }
model.pkl ADDED
Binary file (21.8 kB). View file