CoolFace
Modelpublic

fabiancpl/nlbse25_java

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes18downloads
README.md75 linesDownload Raw Back to root
1---2tags:3- setfit4- sentence-transformers5- text-classification6- generated_from_setfit_trainer7widget: []8metrics:9- accuracy10- f111- precision12- recall13pipeline_tag: text-classification14library_name: setfit15inference: true16license: mit17datasets:18- NLBSE/nlbse25-code-comment-classification19language:20- en21base_model:22- sentence-transformers/all-MiniLM-L6-v223---24 25# Java comment classifier26 27This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Java code comment classification.28 29The model has been trained using few-shot learning that involves:30 311. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.322. Training a classification head with features from the fine-tuned model.33 34## Model Description35 36- **Model Type:** SetFit37- **Classification head:** [RandomForestClassifier](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html)38 39## Sources40 41- **Repository:** [GitHub](https://github.com/fabiancpl/sbert-comment-classification/)42- **Paper:** [Evaluating the Performance and Efficiency of Sentence-BERT for Code Comment Classification](https://ieeexplore.ieee.org/document/11029440)43- **Dataset:** [HF Dataset](https://huggingface.co/datasets/NLBSE/nlbse25-code-comment-classification)44 45## How to use it46 47First, install the depencies:48 49```bash50pip install setfit scikit-learn51```52 53Then, load the model and run inferences:54 55```python56from setfit import SetFitModel57 58# Download from the 🤗 Hub59model = SetFitModel.from_pretrained("fabiancpl/nlbse25_java")60# Run inference61preds = model("This function sorts a list of numbers.")62```63 64## Cite as65 66```bibtex67@inproceedings{11029440,68  author={Peña, Fabian C. and Herbold, Steffen},69  booktitle={2025 IEEE/ACM International Workshop on Natural Language-Based Software Engineering (NLBSE)}, 70  title={Evaluating the Performance and Efficiency of Sentence-BERT for Code Comment Classification}, 71  year={2025},72  pages={21-24},73  doi={10.1109/NLBSE66842.2025.00010}}74```75