Team Ai
Modelpublic

nilcars/facebook_react_model

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes6downloads
Model Card

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:

  1. 1.Fine-tuning a Sentence Transformer with contrastive learning.
  2. 2.Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
feature<ul><li>"Provide a testInstance.context property to facilitate context testing <!--\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 Request\r\n\r\nWhat is the current behavior?\r\n`testInstance` provides a `props` property, but does not provide a `context` property allowing for context tests.\r\n\r\nWhat is the expected behavior?\r\n`testInstance.context` should return an object containing the instance's current context\r\n\r\nWhich versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\r\nAt least 16.4.1"</li><li>'Cursor jumps to end of input when onChange doesn\'t call setState [Edit]: I\'m asking for a feature.\r\n\r\nCurrent Behaviour\r\nAn input `onChange` function that returns a value equalling the prior value causes the cursor to jump to the end of the input. This is the same as [this comment from #995](https://github.com/facebook/react/issues/955#issuecomment-327069204) formally raised as a feature request. \r\n\r\nRepro sandbox: https://codesandbox.io/s/n4k3yx47j\r\nThat same code: \r\n```javascript\r\nimport React from "react";\r\nimport { render } from "react-dom";\r\n\r\nclass Input extends React.Component {\r\n state = { value: "TypeANumber" };\r\n\r\n onChange = e => {\r\n let nextValue = e.target.value;\r\n\r\n if (/[0-9]/.test(nextValue)) {\r\n nextValue = this.state.value;\r\n }\r\n this.setState({ value: nextValue });\r\n };\r\n\r\n render() {\r\n return (\r\n <input\r\n type="text"\r\n value={this.state.value}\r\n onChange={this.onChange}\r\n />\r\n );\r\n }\r\n}\r\n\r\nrender(<Input />, document.getElementById("root"));\r\n```\r\n\r\nWhat is the expected behavior?\r\nI\'d like the cursor not to jump in the special case where the returned changed value is a rejected change i.e. the \'noop\' change. \r\n\r\nI understand fully that react cannot predict cursor position if the value is _changed_ in `onChange`, ~however I cannot currently find an npm module that allows free-length regex filters (vs a fixed length mask)~ or a way to implement a filter myself, without the cursor jumping in this case. \r\n\r\n[Edit]: \r\nSince raising I now fully see this as a feature request for handling a special case of a behaviour that indeed is not a bug, differently. It would be a nice to have as it would allow very straightforward implementation of filters. \r\n\r\nRegarding the non-clarity of how to deal with the general case of non-jumping cursors I think a modernized best practice example would be ideal, but that discussion still lives at #955. \r\n\r\nI\'d be totally fine with this issue being closed by assisting instead with the education of handling the general case. Though, this would still be a nice to have for the API, if possible. \r\n'</li><li>'Allow ReactNode as a type for the child of <option/> Do you want to request a feature or report a bug?\r\nFeature\r\n\r\nWhat is the current behavior?\r\nCurrently, the options element only allows types number and string. \r\n\r\nWhat is the expected behavior?\r\nAn option should allow for a ReactNode as a child in addition to a number + string. \r\n\r\nWhich versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?*\r\nAll versions.\r\nAll browser types.\r\nTo the best of my knowledge, no.\r\n\r\np.s. This is my first feature request here, so let me know if I need to adjust the feature request in any way. '</li></ul>
bug<ul><li>' ERROR TypeError: Cannot read property \'createElement\' of undefined, js engine: hermes ### App\r\n\r\nusing flipper dor react devtools\r\n\r\n### Repro steps\r\n\r\nmigrate to current version of RN-0.71.1\r\nusing flipper \r\nenable hermes engine\r\nrun the app\r\n\r\n\r\n\r\n\r\n### How often does this bug happen?\r\n\r\nEvery time\r\n\r\n### DevTools package (automated)\r\n\r\nNo response\r\n\r\n### DevTools version (automated)\r\n\r\nNo response\r\n\r\n### Error message (automated)\r\n\r\nERROR TypeError: Cannot read property \'createElement\' of undefined, js engine: hermes \r\n\r\n### Error call stack (automated)\r\n\r\n``text\r\nERROR TypeError: Cannot read property \'createElement\' of undefined, js engine: hermes \r\n\r\nthis is related to --->> path: node_modules/react-devtools-core/dist/backend.js\r\nfunction initialize() {\r\n canvas = window.document.createElement(\'canvas\');\r\n canvas.style.cssText = "\\\\n xx-background-color: red;\\\\n xx-opacity: 0.5;\\\\n bottom: 0;\\\\n left: 0;\\\\n pointer-events: none;\\\\n position: fixed;\\\\n right: 0;\\\\n top: 0;\\\\n z-index: 1000000000;\\\\n ";\r\n var root = window.document.documentElement;\r\n root.insertBefore(canvas, root.firstChild);\r\n}\r\n`\r\n\r\n\r\n### Error component stack (automated)\r\n\r\n_No response_\r\n\r\n### GitHub query string (automated)\r\n\r\n_No response_'</li><li>'[DevTools Bug] Cannot remove node "0" because no matching node was found in the Store. ### Website or app\n\nReact Native App\n\n### Repro steps\n\n1. Run react native app\r\n2. npx react-devtools\r\n3. adb reverse tcp:8097 tcp:8097\r\n4. reload the app, this error should come as mentioned below\n\n### How often does this bug happen?\n\nEvery time\n\n### DevTools package (automated)\n\nreact-devtools-core\n\n### DevTools version (automated)\n\n4.24.7-7f673317f\n\n### Error message (automated)\n\nCannot remove node "0" because no matching node was found in the Store.\n\n### Error call stack (automated)\n\n`text\nat /Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:333971\r\n at f.emit (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:279464)\r\n at /Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:281005\r\n at /Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:667650\r\n at Array.forEach (<anonymous>)\r\n at A.e.onmessage (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:667634)\r\n at A.t (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:39:2838)\r\n at A.emit (events.js:315:20)\r\n at e.exports.L (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:3:58322)\r\n at e.exports.emit (events.js:315:20)\n`\n\n\n### Error component stack (automated)\n\n_No response_\n\n### GitHub query string (automated)\n\n`text\nhttps://api.github.com/search/issues?q=Cannot remove node because no matching node was found in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react\n`\n'</li><li>'[DevTools Bug] Cannot add node "1" because a node with that id is already in the Store. ### Website or app\r\n\r\nhttps://pasteboard.co/6Ec3lSzDE4Yz.png\r\n\r\n### Repro steps\r\n\r\n1. Open Chrome with 50+ tabs.\r\n2. Run React-based website locally.\r\n3. Open Chrome Dev Tools to investigate [ActiveLink component](https://pasteboard.co/6Ec3lSzDE4Yz.png) hierarchy inside [Navbar component](https://pasteboard.co/ab8kgmDNgn1I.png). \r\n4. ActiveLink component from [Next](https://github.com/vercel/next.js/tree/canary/examples/active-class-name) was used.\r\n5. Get uncaught error [Screenshot](https://pasteboard.co/3ugPX34TF2Xr.png)\r\n\r\n### How often does this bug happen?\r\n\r\nSometimes\r\n\r\n### DevTools package (automated)\r\n\r\nreact-devtools-extensions\r\n\r\n### DevTools version (automated)\r\n\r\n4.21.0-2f8f60ca8\r\n\r\n### Error message (automated)\r\n\r\nCannot add node "1" because a node with that id is already in the Store.\r\n\r\n### Error call stack (automated)\r\n\r\n`text\r\nat chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26134:41\r\n at bridge_Bridge.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:24349:22)\r\n at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:24509:12\r\n at listener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:53230:39)\r\n`\r\n\r\n\r\n### Error component stack (automated)\r\n\r\n_No response_\r\n\r\n### GitHub query string (automated)\r\n\r\n`text\r\nhttps://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react\r\n``\r\n'</li></ul>
question<ul><li>'DevTools component filter does not work with location *Do you want to request a feature or report a bug?\r\nReport a bug.\r\n\r\nWhat is the current behavior?\r\nIn DevTools when a component filter is added with field set to `location` and regex set to `., nothing is filtered out. (BTW, no documentation in this subject is available anywhere.)\r\n\r\n**What is the expected behavior?**\r\nAt least some components be filtered out.\r\nIt would also be awesome if the location` was shown somewhere for the selected component, so that users can know what kind of Regex they should put together.\r\n\r\nWhich versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\r\nReact DevTools 4.2.0 on Firefox 69.0.3.'</li><li>'× Maximum update depth exceeded in controled way *Do you want to request a feature or report a bug?\r\n- maybe bug?\r\n\r\nWhat is the current behavior?*\r\n\r\nMy case is that I want to update state n times by adding different types of fields to the state and then render them. \r\nEvery updating of dom(adding new field) I have to check whether I should do something more by checking the hight of added elements, for example, add a break between elements. \r\nFields are represented by the tree structure of data, so I created the class which helps me with going through the tree of fields and I keep it in the class property.\r\n\r\nI know how many times I have to modify the DOM so It will be a fully controlled way of state update and it will finish after all fields are added to DOM but before I render all fields I am getting the error "Maximum update depth exceeded".\r\n\r\nDo you know How I can handle with such a problem? \r\nI found a solution by adding setTimeout on the way but I am not sure that is the clean solution?(commented code)\r\nIs it ok that I keep in component class property more complex class to manage structure of data?\r\n\r\nI am providing a simple example in codepage which shows the problem and throw the error.\r\n\r\nhttps://codesandbox.io/s/93w2lp37xw\r\n'</li><li>'Bug: Nested setState and unstablebatchedUpdates (are they ignored?) Nested setState and unstablebatchedUpdates (are them ignored?)\r\n\r\nReact version: 16.12\r\n\r\n## Steps To Reproduce\r\nhttps://codesandbox.io/s/batchedupdates-uselayouteffect-evj8s\r\n\r\nopen profile after click, you will see 3 commit.\r\n\r\nit seems that even if we use unstable_batchedUpdates, nested setStates called on\r\ndidUpdate/layouteffect do not get batched.\r\n'</li></ul>

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("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
")

<!--

Downstream Use

List how someone could finetune this model on their own dataset. -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Word count11190.231528
LabelTraining Sample Count
bug200
feature200
question200

Training Hyperparameters

  • —batch_size: (16, 2)
  • —num_epochs: (1, 1)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —num_iterations: 20
  • —bodylearningrate: (2e-05, 1e-05)
  • —headlearningrate: 0.01
  • —loss: CosineSimilarityLoss
  • —distancemetric: cosinedistance
  • —margin: 0.25
  • —endtoend: False
  • —use_amp: False
  • —warmup_proportion: 0.1
  • —seed: 42
  • —evalmaxsteps: -1
  • —loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.000710.2882-
0.0067100.1652-
0.0133200.2361-
0.02300.1886-
0.0267400.1705-
0.0333500.1868-
0.04600.1858-
0.0467700.1324-
0.0533800.1686-
0.06900.2588-
0.06671000.1911-
0.07331100.0388-
0.081200.0945-
0.08671300.1085-
0.09331400.1812-
0.11500.0593-
0.10671600.1169-
0.11331700.0294-
0.121800.0867-
0.12671900.0392-
0.13332000.0454-
0.142100.0316-
0.14672200.0834-
0.15332300.0075-
0.162400.0676-
0.16672500.0507-
0.17332600.0456-
0.182700.0174-
0.18672800.0093-
0.19332900.0029-
0.23000.0029-
0.20673100.0008-
0.21333200.0201-
0.223300.0072-
0.22673400.0055-
0.23333500.0041-
0.243600.0057-
0.24673700.0015-
0.25333800.0071-
0.263900.0017-
0.26674000.0283-
0.27334100.0093-
0.284200.001-
0.28674300.0026-
0.29334400.0011-
0.34500.0007-
0.30674600.0006-
0.31334700.0007-
0.324800.0009-
0.32674900.0002-
0.33335000.0015-
0.345100.0005-
0.34675200.0002-
0.35335300.0003-
0.365400.0023-
0.36675500.0003-
0.37335600.0003-
0.385700.0002-
0.38675800.0002-
0.39335900.0002-
0.46000.0002-
0.40676100.0004-
0.41336200.0004-
0.426300.0004-
0.42676400.0003-
0.43336500.0002-
0.446600.0011-
0.44676700.0003-
0.45336800.0002-
0.466900.0001-
0.46677000.0002-
0.47337100.0002-
0.487200.0002-
0.48677300.0002-
0.49337400.0001-
0.57500.0002-
0.50677600.0003-
0.51337700.0001-
0.527800.0001-
0.52677900.0001-
0.53338000.0002-
0.548100.0002-
0.54678200.0001-
0.55338300.0002-
0.568400.0001-
0.56678500.0001-
0.57338600.0001-
0.588700.0001-
0.58678800.0001-
0.59338900.0001-
0.69000.0003-
0.60679100.0002-
0.61339200.0001-
0.629300.0001-
0.62679400.0-
0.63339500.0001-
0.649600.0001-
0.64679700.0001-
0.65339800.0001-
0.669900.0001-
0.666710000.0-
0.673310100.0001-
0.6810200.0001-
0.686710300.0001-
0.693310400.0001-
0.710500.0001-
0.706710600.0001-
0.713310700.0001-
0.7210800.0001-
0.726710900.0-
0.733311000.0001-
0.7411100.0-
0.746711200.0001-
0.753311300.0002-
0.7611400.0-
0.766711500.0001-
0.773311600.0-
0.7811700.0001-
0.786711800.0001-
0.793311900.0001-
0.812000.0001-
0.806712100.0001-
0.813312200.0001-
0.8212300.0003-
0.826712400.0-
0.833312500.0-
0.8412600.0001-
0.846712700.0-
0.853312800.0002-
0.8612900.0001-
0.866713000.0002-
0.873313100.0001-
0.8813200.0001-
0.886713300.0-
0.893313400.0001-
0.913500.0001-
0.906713600.0001-
0.913313700.0-
0.9213800.0001-
0.926713900.0001-
0.933314000.0-
0.9414100.0001-
0.946714200.0001-
0.953314300.0001-
0.9614400.0001-
0.966714500.0001-
0.973314600.0001-
0.9814700.0001-
0.986714800.0-
0.993314900.0001-
1.015000.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

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

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->