Skip to content

This is the sklearn implementation of SetFiit

Notifications You must be signed in to change notification settings

Buckeyes2019/setfit_sklearn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SetFit_Sklearn

A scikit-learn API version of a SetFit classifier. Model originally developed by Moshe Wasserblat.

Use

from setfit_sklearn import SetFitClassifier
docs = ["yay", "boo", "yes", "no", "yeah"]
labels = [1, 0, 1, 0, 1]

# takes a sentence-transformers model
clf = SetFitClassifier("paraphrase-MiniLM-L3-v2")
# fine-tunes embeddings + trains logistic regression head
clf.fit(docs, labels) 

clf.predict(["affirmitive", "negative"])
array([1, 0])

Installation

pip install git+https://github.com/Buckeyes2019/setfit_sklearn

References

Original Blog Post (Archived)

Reference Notebook: Open In Colab

About

This is the sklearn implementation of SetFiit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%