--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer base_model: sentence-transformers/all-mpnet-base-v2 datasets: - hojzas/proj9-lab1 metrics: - accuracy widget: - text: ' try:\n async with aiohttp.ClientSession(headers = fake_headers) as session:\n async with session.get(url) as response:\n outcome = response.status\n except Exception as e:\n outcome = e.__class__.__name__\n return (outcome, url)' - text: ' async with aiohttp.ClientSession() as current_session:\n pairs = [fetch_url(current_session, url) for url in url_list]\n res_pairs = await asyncio.gather(*pairs)\n return res_pairs' - text: tasks = [asyncio.create_task(fetch_single_url(url)) for url in urls]\n results = asyncio.gather(*tasks)\n return results - text: ' coros = [get_url(url) for url in urls]\n results = asyncio.get_event_loop().run_until_complete(asyncio.gather(*coros))\n return results' - text: ' tasks = [download_url(url) for url in urls]\n results = asyncio.gather(*tasks)\n return results' pipeline_tag: text-classification inference: true --- # SetFit with sentence-transformers/all-mpnet-base-v2 This is a [SetFit](https://github.com/huggingface/setfit) model trained on the [hojzas/proj9-lab1](https://huggingface.co/datasets/hojzas/proj9-lab1) dataset that can be used for Text Classification. This SetFit model uses [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2) 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. 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. ## Model Details ### Model Description - **Model Type:** SetFit - **Sentence Transformer body:** [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 384 tokens - **Number of Classes:** 2 classes - **Training Dataset:** [hojzas/proj9-lab1](https://huggingface.co/datasets/hojzas/proj9-lab1) ### 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) ### Model Labels | Label | Examples | |:------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 0 |