Instructions to use mahaswec/setfit_ostrom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use mahaswec/setfit_ostrom with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("mahaswec/setfit_ostrom") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - setfit
How to use mahaswec/setfit_ostrom with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("mahaswec/setfit_ostrom") - Notebooks
- Google Colab
- Kaggle
mahaswec/setfit_ostrom
This is a SetFit model that can be used for text classification. The model has been trained using an efficient few-shot learning technique that involves:
- Fine-tuning a Sentence Transformer with contrastive learning.
- Training a classification head with features from the fine-tuned Sentence Transformer.
Model is meant to classify Ostrom rule types for institutional analysis. Read more at https://papers.ssrn.com/sol3/Delivery.cfm?abstractid=5845434
###Performance
Usage
To use this model for inference, first install the SetFit library:
python -m pip install setfit
You can then run inference as follows:
from setfit import SetFitModel
# Download from Hub and run inference
model = SetFitModel.from_pretrained("mahaswec/setfit_ostrom")
# Run inference
preds = model(["i loved the spiderman movie!", "pineapple on pizza is the worst 🤮"])
BibTeX entry and citation info
@article{Yin2025-rt,
title = "Governing the digital commons at scale: Detecting Ostrom rule types
in {OSS}",
author = "Yin, Likang and Atkisson, Curtis and Chakraborti, Mahasweta and
Ruiz, Santiago Virguez and Bushouse, Brenda and Schweik, Charlie
and Frey, Seth and Filkov, Vladimir",
year = 2025
}
- Downloads last month
- 7
