famunir / setfit

This model performs sentence classfication. We are adding more option so that training process can be customized.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SetFit

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

Use

from setfit 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/pmbaumgartner/setfit

References

Original Blog Post (Archived)

Reference Notebook: Open In Colab

About

This model performs sentence classfication. We are adding more option so that training process can be customized.


Languages

Language:Python 100.0%