sentence-transformers pytorch mpnet setfit text-classification arxiv:2209.11055 license:apache-2.0 region:us
---
license: apache-2.0
tags:
- setfit
- sentence-transformers
- text-classification
pipeline_tag: text-classification
---

# jasoncpit/PMV_fewshots

This is a [SetFit model](https://github.com/huggingface/setfit) that can be used for text classification. The model has been trained using Brand Wiki Page 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 differentiable head with features from the fine-tuned Sentence Transformer.
3. Predicting market position categories, such as value, budget, mass, accessible premium, premium and luxury.
4. We used sentence-transformers/paraphrase-mpnet-base-v2 as our base model

TO DO 

1. hyperparameters search
2. Gather more data e.g., websites URL
3. Adapt MarkupLM for HTML classfication
4. Improve accuracy -> current accuracy is around 52%
5. Further metrics e.g., recall, F1 
6. Compare the few shot model to a fully finetuned model. 

## Usage

To use this model for inference, first install the SetFit library:

```bash
python -m pip install setfit
```

You can then run inference as follows:

```python
from setfit import SetFitModel

# Download from Hub and run inference
model = SetFitModel.from_pretrained("jasoncpit/PMV_fewshots")
# Run inference
preds = model(["Burberry Group plc is a British luxury fashion house established in 1856 by Thomas Burberry and headquartered in London, England.[5] It currently designs and distributes ready to wear, including trench coats (for which it is most famous), leather accessories, and footwear.",
"Aldi (stylised as ALDI)[6] is the common company brand name of two German multinational family-owned discount supermarket chains operating over 12,000 stores in 19 countries.[7][8] The chain was founded by brothers Karl and Theo Albrecht in 1946, when they took over their mother's store in Essen. The business was split into two separate groups in 1960, that later became Aldi Nord, headquartered in Essen, and Aldi Süd, headquartered in Mülheim.[9][10]"])
```

## 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}
}
```
