Java comment classifier

This is a SetFit model that can be used for Java code comment classification.

The model has been trained using few-shot learning that involves:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned model.

Model Description

Sources

How to use it

First, install the depencies:

pip install setfit scikit-learn

Then, load the model and run inferences:

from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("fabiancpl/nlbse25_java")
# Run inference
preds = model("This function sorts a list of numbers.")

Cite as

@inproceedings{11029440,
  author={Peña, Fabian C. and Herbold, Steffen},
  booktitle={2025 IEEE/ACM International Workshop on Natural Language-Based Software Engineering (NLBSE)}, 
  title={Evaluating the Performance and Efficiency of Sentence-BERT for Code Comment Classification}, 
  year={2025},
  pages={21-24},
  doi={10.1109/NLBSE66842.2025.00010}}
Downloads last month
159
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for fabiancpl/nlbse25_java

Finetuned
(448)
this model

Dataset used to train fabiancpl/nlbse25_java