Team Ai
Apppublic

hetvi22/commit_message_quality

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
app.py32 linesDownload Raw Back to root
1import gradio as gr2import pandas as pd3import numpy as np4import sklearn5 6# ---- Commit Message Quality Logic ----7def rule_based_classifier(commit_message: str) -> str:8    """9    Simple rule-based classifier for commit message quality.10    You can later replace this with ML/DL models without changing the UI.11    """12    if not commit_message or len(commit_message.strip()) == 0:13        return "Invalid input"14    if len(commit_message.strip().split()) < 3:15        return "Poor"16    elif commit_message[0].islower():17        return "Poor"18    else:19        return "Good"20 21# ---- Gradio UI ----22with gr.Blocks() as demo:23    gr.Markdown("## 🚀 Commit Message Quality Analyzer")24    inp = gr.Textbox(label="Enter Commit Message", placeholder="Type your commit message here...")25    out = gr.Label(label="Prediction")26    btn = gr.Button("Analyze")27    btn.click(fn=rule_based_classifier, inputs=inp, outputs=out)28 29# ---- Entry Point ----30if __name__ == "__main__":31    demo.launch()32