metadata
base_model: sentence-transformers/all-mpnet-base-v2
library_name: setfit
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: "Bug: Radio button onChange not called in current React Canary <!--\r\n Please provide a clear and concise description of what the bug is. Include\r\n screenshots if needed. Please test using the latest version of the relevant\r\n React packages to make sure your issue has not already been fixed.\r\n-->\r\n\r\nReact version: 18.3.0-canary-a1f97589f-20230526\r\n\r\n\r\n## Steps To Reproduce\r\n\r\n1. Create radio buttons that toggle `disabled` in `onChange`\r\n2. After selecting each radio button, `onChange` is no longer called\r\n\r\n<!--\r\n Your bug will get fixed much faster if we can run your code and it doesn't\r\n have dependencies other than React. Issues without reproduction steps or\r\n code examples may be immediately closed as not actionable.\r\n-->\r\n\r\nLink to code example:\r\n\r\nThe following CodeSandbox demonstrates the issue with the current react canary version. The issue is not present when react & react-dom versions are changed to stable 18.2.0\r\n\r\nhttps://codesandbox.io/s/react-canary-radio-buttons-deiqb3?file=/src/App.js\r\n\r\n<!--\r\n Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a\r\n repository on GitHub, or provide a minimal code example that reproduces the\r\n problem. You may provide a screenshot of the application if you think it is\r\n relevant to your bug report. Here are some tips for providing a minimal\r\n example: https://stackoverflow.com/help/mcve.\r\n-->\r\n\r\n## The current behavior\r\n`<input type=\"radio\" />`'s `onChange` prop is not called on subsequent clicks of the input\r\n\r\n## The expected behavior\r\n`<input type=\"radio\" />`'s `onChange` prop should be called on subsequent clicks of the input\r\n"
- text: "Allow opting out of invokeGuardedCallbackDev At the moment, when in development mode, React uses a special workflow for callbacks, to avoid using `try...catch`.\r\n\r\nIt works well. So well that several testing frameworks also get their uncaught exception handling triggered.\r\n\r\n**Example with mocha:**\r\n```js\r\nimport React from 'react';\r\nimport { render } from '@testing-library/react';\r\n\r\nfunction MyComponent({ doThrow }) {\r\n if (doThrow) { throw new Error('I'm bad'); }\r\n return <div></div>;\r\n}\r\n\r\nit('should throw', function () {\r\n expect(() => {\r\n render(<MyComponent doThrow/>);\r\n }).to.throw();\r\n});\r\n```\r\n**Behavior:**\r\n- When running the test with the production build of react/react-dom, the test passes (with the usual warning of act being unsupported in prod build).\r\n- When running the test with the development build of react-/react-dom, the test fails with `Error: Uncaught Error: I'm bad`.\r\n\r\nThe root cause is `invokeGuardedCallbackDev` runs the callback in an event to avoid using a `try...catch` block… and trips Mocha.js uncaught exception detector.\r\n\r\n*Note: I am aware of error boundaries, I removed it from the example because the behavior is identical with it.*\r\n\r\n*Note: I used testing-library for clarity, but using `act` and `RenderDOM` manually yields the same result.*\r\n\r\n**Expected behavior:**\r\n- Either make it work out of the box, or have the possibility to opt out of `invokeGuardedCallbackDev` and force the use of the regular `try...catch` implementation in development too.\r\n"
- text: "Setting rendering mode to <Surface> component of react-art <!--\r\n Note: if the issue is about documentation or the website, please file it at:\r\n https://github.com/reactjs/reactjs.org/issues/new\r\n-->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\nfeature\r\n\r\n**What is the current behavior?**\r\n`<Surface>` of canvas mode and `<Surface>` of svg mode cannot be used in a document at the same time.\r\n\r\n**What is the expected behavior?**\r\nTwo more `<Surface>` components with each other modes can be used in a document at the same time.\r\n\r\n\r\nCurrently developers can set only one rending mode globally in react-art, using `setCurrent()` of `art/modes/current` module. So there is no way to use `<Surface>` of canvas mode and `<Surface>` of svg mode in a document together. On the other hand, `art.js` internally used in `react-art` provides a way to use each other modes together as directly importing their corresponding modules. (e.g. svg.js for svg mode, canvas.js for canvas mode in `art.js` lib). \r\n\r\nI would like to suggest a way to set own rendering mode per instance of `<Surface>` Component by new property `mode`. This feature makes `<Surface>` with canvas mode and `<Surface>` with svg mode to be used together in a document like the following.\r\n\r\n```javascript\r\nconst {\r\n Surface,\r\n Group,\r\n Shape\r\n} = require('react-art');\r\n\r\nclass TestComponent extends React.Component {\r\n render() {\r\n return (\r\n <React.Fragment>\r\n <Surface mode=\"svg\" width={100} height={100}>\r\n <Group>\r\n <Shape width={10} height={10} />\r\n </Group>\r\n </Surface>\r\n <Surface mode=\"canvas\" width={100} height={100}>\r\n <Group>\r\n <Shape width={10} height={10} />\r\n </Group>\r\n </Surface>\r\n </React.Fragment>\r\n );\r\n }\r\n};\r\n```\r\n\r\nIf `mode` property is not set, `<Surface>` works as canvas mode for compatibility.\r\n\r\nI have made a PR for this feature to show how to work and use it ([#13249](https://github.com/facebook/react/pull/13249)).\r\nAnd you can check this feature through `art` fixture of my PR.\r\n\r\nFeel free to discuss about this feature.\r\n\r\n\r\n\r\n"
- text: "[DevTools Bug]: Firefox and Edge show error in console about unrecognized installation on v4.20.0 ### Website or app\r\n\r\nreactjs.org\r\n\r\n### Repro steps\r\n\r\n1. Install React DevTools v4.20.0 in Firefox\r\n2. Load reactjs.org in Firefox\r\n3. Open Firefox DevTools\r\n4. Observe error in console\r\n\r\n![image](https://user-images.githubusercontent.com/1271509/137547605-e6ad3045-c20a-4828-9895-af46b8bb4db1.png)\r\n\r\n\r\n### How often does this bug happen?\r\n\r\nEvery time\r\n"
- text: "componentWillUpdate discussion <!--\r\n Note: if the issue is about documentation or the website, please file it at:\r\n https://github.com/reactjs/reactjs.org/issues/new\r\n-->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\nFeature : componentWillUpdate Discussion\r\n\r\n**What is the current behavior?**\r\n\r\nThe current behavior calls the function before re-rendering the render target however there is no indication for when the re-render method should be called\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:**\r\n\r\n**What is the expected behavior?**\r\n\r\nThe expected behavior should call the function before re-rendering the render target if there is no returned conditional statement and if there is, true should trigger the re-render and false should not\r\n\r\n**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**\r\n\r\n16.4.0\r\n\r\nI have a few questions before I try to solve this problem and it gets rejected. I'm assuming that the team has decided to move in the direction of removing \"Will-Updates\" from React all together and have labeled them \"Unsafe\". I've seen a lot of issues with those functionalities before as well. I was curious if providing a conditional statement inside those functions would satisfy the unexpected renders. \"shouldComponentUpdate\" does trigger when to call these functions however in those functions that \"will\" run before the render can always be controlled with a conditional statement of it's own. I'm getting comfortable with the code base however I'm curious if the team is removing that functionality all together and using the \"static\" function \"getDerivedStateFromProps\" instead. Has a React lover it is a little confusing and may break a lot of legacy code when updating versions. I believe that may solve the problem of unexpected renders after a \"will\" change lifecycle event.\r\n\r\nI was curious if that was the case, and removing \"will\" lifecycles is the next steps for React then how will the \"did\" lifecycles work instead?\r\n\r\nI love React and I'm just curious about the future for React as a whole. I'd love to tackle any bugs or feature requests when I have time. I will be writing clean code and create tests for new features or bugs as well."
inference: true
SetFit with sentence-transformers/all-mpnet-base-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/all-mpnet-base-v2 as the Sentence Transformer embedding model. A LogisticRegression instance is used for 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 Details
Model Description
- Model Type: SetFit
- Sentence Transformer body: sentence-transformers/all-mpnet-base-v2
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 384 tokens
- Number of Classes: 3 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Model Labels
Label | Examples |
---|---|
feature |
|
bug |
|
question |
|
Uses
Direct Use for Inference
First install the SetFit library:
pip install setfit
Then you can load this model and run inference.
from setfit import SetFitModel
# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("setfit_model_id")
# Run inference
preds = model("[DevTools Bug]: Firefox and Edge show error in console about unrecognized installation on v4.20.0 ### Website or app
reactjs.org
### Repro steps
1. Install React DevTools v4.20.0 in Firefox
2. Load reactjs.org in Firefox
3. Open Firefox DevTools
4. Observe error in console
![image](https://user-images.githubusercontent.com/1271509/137547605-e6ad3045-c20a-4828-9895-af46b8bb4db1.png)
### How often does this bug happen?
Every time
")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 11 | 190.23 | 1528 |
Label | Training Sample Count |
---|---|
bug | 200 |
feature | 200 |
question | 200 |
Training Hyperparameters
- batch_size: (16, 2)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 20
- body_learning_rate: (2e-05, 1e-05)
- head_learning_rate: 0.01
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: False
- use_amp: False
- warmup_proportion: 0.1
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0007 | 1 | 0.2882 | - |
0.0067 | 10 | 0.1652 | - |
0.0133 | 20 | 0.2361 | - |
0.02 | 30 | 0.1886 | - |
0.0267 | 40 | 0.1705 | - |
0.0333 | 50 | 0.1868 | - |
0.04 | 60 | 0.1858 | - |
0.0467 | 70 | 0.1324 | - |
0.0533 | 80 | 0.1686 | - |
0.06 | 90 | 0.2588 | - |
0.0667 | 100 | 0.1911 | - |
0.0733 | 110 | 0.0388 | - |
0.08 | 120 | 0.0945 | - |
0.0867 | 130 | 0.1085 | - |
0.0933 | 140 | 0.1812 | - |
0.1 | 150 | 0.0593 | - |
0.1067 | 160 | 0.1169 | - |
0.1133 | 170 | 0.0294 | - |
0.12 | 180 | 0.0867 | - |
0.1267 | 190 | 0.0392 | - |
0.1333 | 200 | 0.0454 | - |
0.14 | 210 | 0.0316 | - |
0.1467 | 220 | 0.0834 | - |
0.1533 | 230 | 0.0075 | - |
0.16 | 240 | 0.0676 | - |
0.1667 | 250 | 0.0507 | - |
0.1733 | 260 | 0.0456 | - |
0.18 | 270 | 0.0174 | - |
0.1867 | 280 | 0.0093 | - |
0.1933 | 290 | 0.0029 | - |
0.2 | 300 | 0.0029 | - |
0.2067 | 310 | 0.0008 | - |
0.2133 | 320 | 0.0201 | - |
0.22 | 330 | 0.0072 | - |
0.2267 | 340 | 0.0055 | - |
0.2333 | 350 | 0.0041 | - |
0.24 | 360 | 0.0057 | - |
0.2467 | 370 | 0.0015 | - |
0.2533 | 380 | 0.0071 | - |
0.26 | 390 | 0.0017 | - |
0.2667 | 400 | 0.0283 | - |
0.2733 | 410 | 0.0093 | - |
0.28 | 420 | 0.001 | - |
0.2867 | 430 | 0.0026 | - |
0.2933 | 440 | 0.0011 | - |
0.3 | 450 | 0.0007 | - |
0.3067 | 460 | 0.0006 | - |
0.3133 | 470 | 0.0007 | - |
0.32 | 480 | 0.0009 | - |
0.3267 | 490 | 0.0002 | - |
0.3333 | 500 | 0.0015 | - |
0.34 | 510 | 0.0005 | - |
0.3467 | 520 | 0.0002 | - |
0.3533 | 530 | 0.0003 | - |
0.36 | 540 | 0.0023 | - |
0.3667 | 550 | 0.0003 | - |
0.3733 | 560 | 0.0003 | - |
0.38 | 570 | 0.0002 | - |
0.3867 | 580 | 0.0002 | - |
0.3933 | 590 | 0.0002 | - |
0.4 | 600 | 0.0002 | - |
0.4067 | 610 | 0.0004 | - |
0.4133 | 620 | 0.0004 | - |
0.42 | 630 | 0.0004 | - |
0.4267 | 640 | 0.0003 | - |
0.4333 | 650 | 0.0002 | - |
0.44 | 660 | 0.0011 | - |
0.4467 | 670 | 0.0003 | - |
0.4533 | 680 | 0.0002 | - |
0.46 | 690 | 0.0001 | - |
0.4667 | 700 | 0.0002 | - |
0.4733 | 710 | 0.0002 | - |
0.48 | 720 | 0.0002 | - |
0.4867 | 730 | 0.0002 | - |
0.4933 | 740 | 0.0001 | - |
0.5 | 750 | 0.0002 | - |
0.5067 | 760 | 0.0003 | - |
0.5133 | 770 | 0.0001 | - |
0.52 | 780 | 0.0001 | - |
0.5267 | 790 | 0.0001 | - |
0.5333 | 800 | 0.0002 | - |
0.54 | 810 | 0.0002 | - |
0.5467 | 820 | 0.0001 | - |
0.5533 | 830 | 0.0002 | - |
0.56 | 840 | 0.0001 | - |
0.5667 | 850 | 0.0001 | - |
0.5733 | 860 | 0.0001 | - |
0.58 | 870 | 0.0001 | - |
0.5867 | 880 | 0.0001 | - |
0.5933 | 890 | 0.0001 | - |
0.6 | 900 | 0.0003 | - |
0.6067 | 910 | 0.0002 | - |
0.6133 | 920 | 0.0001 | - |
0.62 | 930 | 0.0001 | - |
0.6267 | 940 | 0.0 | - |
0.6333 | 950 | 0.0001 | - |
0.64 | 960 | 0.0001 | - |
0.6467 | 970 | 0.0001 | - |
0.6533 | 980 | 0.0001 | - |
0.66 | 990 | 0.0001 | - |
0.6667 | 1000 | 0.0 | - |
0.6733 | 1010 | 0.0001 | - |
0.68 | 1020 | 0.0001 | - |
0.6867 | 1030 | 0.0001 | - |
0.6933 | 1040 | 0.0001 | - |
0.7 | 1050 | 0.0001 | - |
0.7067 | 1060 | 0.0001 | - |
0.7133 | 1070 | 0.0001 | - |
0.72 | 1080 | 0.0001 | - |
0.7267 | 1090 | 0.0 | - |
0.7333 | 1100 | 0.0001 | - |
0.74 | 1110 | 0.0 | - |
0.7467 | 1120 | 0.0001 | - |
0.7533 | 1130 | 0.0002 | - |
0.76 | 1140 | 0.0 | - |
0.7667 | 1150 | 0.0001 | - |
0.7733 | 1160 | 0.0 | - |
0.78 | 1170 | 0.0001 | - |
0.7867 | 1180 | 0.0001 | - |
0.7933 | 1190 | 0.0001 | - |
0.8 | 1200 | 0.0001 | - |
0.8067 | 1210 | 0.0001 | - |
0.8133 | 1220 | 0.0001 | - |
0.82 | 1230 | 0.0003 | - |
0.8267 | 1240 | 0.0 | - |
0.8333 | 1250 | 0.0 | - |
0.84 | 1260 | 0.0001 | - |
0.8467 | 1270 | 0.0 | - |
0.8533 | 1280 | 0.0002 | - |
0.86 | 1290 | 0.0001 | - |
0.8667 | 1300 | 0.0002 | - |
0.8733 | 1310 | 0.0001 | - |
0.88 | 1320 | 0.0001 | - |
0.8867 | 1330 | 0.0 | - |
0.8933 | 1340 | 0.0001 | - |
0.9 | 1350 | 0.0001 | - |
0.9067 | 1360 | 0.0001 | - |
0.9133 | 1370 | 0.0 | - |
0.92 | 1380 | 0.0001 | - |
0.9267 | 1390 | 0.0001 | - |
0.9333 | 1400 | 0.0 | - |
0.94 | 1410 | 0.0001 | - |
0.9467 | 1420 | 0.0001 | - |
0.9533 | 1430 | 0.0001 | - |
0.96 | 1440 | 0.0001 | - |
0.9667 | 1450 | 0.0001 | - |
0.9733 | 1460 | 0.0001 | - |
0.98 | 1470 | 0.0001 | - |
0.9867 | 1480 | 0.0 | - |
0.9933 | 1490 | 0.0001 | - |
1.0 | 1500 | 0.0001 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 3.0.1
- Transformers: 4.39.0
- PyTorch: 2.3.0+cu121
- Datasets: 2.20.0
- Tokenizers: 0.15.2
Citation
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}
}