--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer - Norway - Cabinet Ministers widget: [] metrics: - accuracy pipeline_tag: text-classification library_name: setfit inference: true base_model: NbAiLab/nb-sbert-base language: - 'no' - nb --- # Purpose: Inform This model has been trained on Facebook posts by Norwegian cabinet ministers of the Solberg governments (2013-2021). It was used in Karlsen, Kolltveit and Solheim (2025). The posts were hand coded specifying different roles and purposes of the posts. Below, we recreate the table 1 from the paper showing the five roles and four purposes. The model included here identifies posts where the posts have the purpose of **Informing**. The setfit models that identify the other roles and purposes are available [here](https://huggingface.co/collections/oyvindbs/balancing-acts-the-communicative-roles-of-cabinet-ministers-68624b72c250c3cc1fd3ea14). In the paper, we use one model for each purpose and each role. Each post can accordingly be ascribed to more than one purpose or role. | | Communicative purposes | | | | |------------------------------|-------------------------------|----------------------|-------------------|-----------------| | **Communicative roles** | *Informing* | Communication | Mobilizing | Branding | | Ministry head | | | | | | Cabinet member | | | | | | Party politician | | | | | | Individual politician | | | | | | Private person | | | | | This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification of Norwegian social media posts. It uses [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification. It 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. ## Model Details ### Model Description - **Model Type:** SetFit - **Sentence Transformer body:** [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 75 tokens - **Number of Classes:** 1 **Language:** * Norwegian (Bokmål) ### Model Sources - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit) - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055) - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit) ## Uses ### Direct Use for Inference First install the SetFit library: ```bash pip install setfit ``` Then you can load this model and run inference. ```python from setfit import SetFitModel # Download from the 🤗 Hub model = SetFitModel.from_pretrained("oyvindbs/setfit_minister_nb-sbert-base_Ministry-Head") # Run inference preds = model("I loved the spiderman movie!") ``` ## Training Details ### Framework Versions - Python: 3.10.4 - SetFit: 1.1.1 - Sentence Transformers: 3.4.1 - Transformers: 4.50.1 - PyTorch: 2.5.1+cu118 - Datasets: 2.19.0 - Tokenizers: 0.21.0 ## Citation ```bibtex @article{KarlsenKolltveitSolheim, author = {Karlsen, Rune and Kolltveit, Kristoffer and Solheim, Øyvind Bugge}, title = {Balancing Acts: The communicative roles of cabinet ministers on social media}, publisher = {Media and Communication}, year = {2025}, volume = {13}, doi = {https://doi.org/10.17645/mac.10416} } ``` ### BibTeX ```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} } ```