Run this model with HF Jobs
Run fhamborg/newsframes-gov-bin on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/fhamborg/newsframes-gov-bin. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/fhamborg/newsframes-gov-bin on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use fhamborg/newsframes-gov-bin with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use fhamborg/newsframes-gov-bin with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("fhamborg/newsframes-gov-bin") 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 fhamborg/newsframes-gov-bin with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("fhamborg/newsframes-gov-bin") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files6 unmodified lines789101112131415161718192021222324252627282930313233343536373839404142434445464748496 unmodified linespipeline_tag: text-classification---# /var/folders/qg/vmj6zq4s7hb2pbkp3b8kstvh0000gn/T/tmphouh_l6z/fhamborg/newsframes-gov-binThis is a [SetFit model](https://github.com/huggingface/setfit) that can be used for text classification. The model has been trained using an efficient few-shot learning technique that involves:1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.2. Training a classification head with features from the fine-tuned Sentence Transformer.## UsageTo use this model for inference, first install the SetFit library:```bashpython -m pip install setfit```You can then run inference as follows:```pythonfrom setfit import SetFitModel# Download from Hub and run inferencemodel = SetFitModel.from_pretrained("/var/folders/qg/vmj6zq4s7hb2pbkp3b8kstvh0000gn/T/tmphouh_l6z/fhamborg/newsframes-gov-bin")# Run inferencepreds = model(["i loved the spiderman movie!", "pineapple on pizza is the worst 🤮"])```## BibTeX entry and citation info```bibtex@article{https://doi.org/10.48550/arxiv.2209.11055,doi = {10.48550/ARXIV.2209.11055},url = {https://arxiv.org/abs/2209.11055},author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},title = {Efficient Few-Shot Learning Without Prompts},publisher = {arXiv},year = {2022},copyright = {Creative Commons Attribution 4.0 International}}```6 unmodified lines789101112131415166 unmodified linespipeline_tag: text-classification---# NewsFrames classifierThis is one of a series of classifiers devised for automatically identifying universal framing dimensions. A paper on the underlying training dataset and the framing dimensions in particular is currently being written. This page will be updated once the paper is finished.## AcknowledgementsThis work would not have been possible without the contributions by [Tilman Hornung](t1h0), Kim Heinser, and our team of student research assistants.
README.md+4-37