CoolFace
Modelpublic

Collab-uniba/cfs-binary-setfit

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

SetFit

This is a SetFit model that can be used for Text Classification. 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 Type: SetFit <!-- - Sentence Transformer: Unknown -->
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 384 tokens
  • Number of Classes: 2 classes <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Model Labels

LabelExamples
non-bug<ul><li>"Define file subtype value behavior/expectations\nIs your feature request related to a problem? Please describe.\r\nNot clear if the CFEFSInitHeader SubType needs to be one of the FS enums or if it can be user defined by apps. Note there is no longer a shell file created by ES:\r\nhttps://github.com/nasa/cFE/blob/e80aae94e0f56b868657daba965c590766a4dc57/modules/coreapi/fsw/inc/cfefsexterntypedefs.h#L101-L108\r\n\r\nDescribe the solution you'd like\r\nNeed to determine if FS should define all file subtypes, or treat it as an extendable field (or whatever). That will affect if the SHELL subtype gets removed or renamed (since there is still an app that would create it). Note right now apps don't even use CFE_FS_InitHeader, but they do currently set unique values.\r\n\r\nDescribe alternatives you've considered\r\nNone\r\n\r\nAdditional context\r\nCode review\r\n\r\nRequester Info\r\nJacob Hageman - NASA/GSFC\r\n"</li><li>'Disambiguate command vs message requirements \nIs your feature request related to a problem? Please describe.\r\n"Command" terminology has been used for both ground commands (that increment command counters) and inter-app commands (that typically do not increment command counters). So it\'s unclear in the requirement which sort of use case is intended.\r\n\r\nDescribe the solution you\'d like\r\n"Command" is ground command with additional associated behavior (increments command counters), "Message" is typical sb message that does not increment command counter.\r\n\r\nDescribe alternatives you\'ve considered\r\nNone\r\n\r\nAdditional context\r\nDiscovered during requirements scrub, helps clarify what impacts command counter.\r\n\r\nRequester Info\r\nJacob Hageman - NASA/GSFC\r\n'</li><li>"Improve table handling\nIs your feature request related to a problem? Please describe.\r\nDoesn't actually allow table management within the task loop\r\n\r\nDescribe the solution you'd like\r\nActually follow the table management pattern, allowing updates (should be a decent example)\r\n\r\nDescribe alternatives you've considered\r\nN/A\r\n\r\nAdditional context\r\nN/A\r\n\r\nRequester Info\r\nJacob Hageman - NASA/GSFC"</li></ul>
bug<ul><li>'CFEPLATFORMESPERFMAXIDS not fully deprecated\n**Describe the bug**\r\nCFEPLATFORMESPERFMAXIDS was superseded by CFEMISSIONESPERFMAXIDS as noted in this comment: https://github.com/nasa/cFE/search?q=CFEPLATFORMESPERFMAXIDS. However, sample cpu1platformcfg.h still contains the definition for CFEPLATFORMESPERFMAXIDS is still referenced in esUT.c and comments in cfeesevents.h and sampleperfids.h\r\n\r\n**To Reproduce**\r\nN/A\r\n\r\n**Expected behavior**\r\nEither CFEPLATFORMESPERFMAXIDS should be totally deprecated and all references should be replaced by CFEMISSIONESPERFMAXIDS or (if deemed necessary) support for platform-specific max values should be re-added in the perf-log implementation.\r\n\r\n**Code snips**\r\ncfe/cmake/sampledefs/cpu1platformcfg.h:1978\r\ncfe/fsw/cfe-core/src/inc/cfeesevents.h:1046\r\ncfe/fsw/cfe-core/unit-test/esUT.c:3664\r\n\r\n**System observed on:**\r\nN/A\r\n\r\n**Additional context**\r\nN/A\r\n\r\n**Reporter Info**\r\nPJ Chapates Gateway Vehicle System Manager FSW Production, JSC\r\n'</li><li>'CF Purge Queue Command Opcode Not Defined\n**This issue was imported from the GSFC issue tracking system**\r\n\r\nImported from: [GSFCCFS-1765] CF Purge Queue Command Opcode Not Defined\r\nOriginally submitted by: Maldonado, Sergio E. (GSFC-580.0)[Arctic Slope Technical Services, Inc.] on Fri Oct 29 11:03:57 2021\r\n\r\nOriginal Description:\r\nThe command opcode for Purge Queue is not present in the CF\\CMDS enumeration in cf\\msg.h. It should be present with a value of 21. The command dispatch table in cf\\cmd.c does have an entry for the command, as well as the implementation. Without the opcode defined, the command cannot be verified at the functional level. '</li><li>"File age check logic is wrong\nChecklist (Please check before submitting)\r\n\r\n [x] I reviewed the [Contributing Guide](https://github.com/nasa/DS/blob/main/CONTRIBUTING.md).\r\n [x] I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.\r\n\r\nDescribe the bug\r\nProduces ~17 files in 10 minutes when requesting 1 file per minute\r\n\r\nTo Reproduce\r\n1. Enable a 1 file per minute config\r\n2. Watch ~17 files get produced\r\n\r\nExpected behavior\r\n1 file per minute when configured to do so\r\n\r\nCode snips\r\nThe problem is how file age is accumulated. W/ the default config, 4 seconds are added every HK message, and another second is added every 1 second SB timeout. So within the typical 4 second scheduled HK request the file age gets incremented by 7 seconds (4 from HK processing and 3 from SB timeouts).\r\n\r\nhttps://github.com/nasa/DS/blob/ce988535edffd6b36cc1083e10988c2d0a4a38db/fsw/src/dsapp.c#L124\r\nhttps://github.com/nasa/DS/blob/ce988535edffd6b36cc1083e10988c2d0a4a38db/fsw/src/dsapp.c#L520\r\n\r\nReally the time accumulation logic is broken since it's going to vary based on receiving any other command that would cause SB not to timeout.\r\n\r\nLikely needs a functional test update to catch this issue.\r\n\r\nSystem observed on:\r\nIndependent of system\r\n\r\nAdditional context\r\nNone\r\n\r\nReporter Info\r\nJacob Hageman - NASA/GSFC"</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("Consistent CFE_PSP_Main implementation
RTEMS PSP hardcodes \"/cf/cfe_es_startup.scr\", but mcp750 and pc-linux both use the CFE_PLATFORM_ES_NONVOL_STARTUP_FILE.

Inconsistent implementations.

From #102  (solved here):
cfe_psp_start.c for mcp750 VxWorks has StartupFilePath as an input parameter to CFE_PSP_Main, but calls CFE_ES_Main with CFE_PLATFORM_ES_NONVOL_STARTUP_FILE.

Confusing implementation... looks like at least the pc-linux PSP only uses CFE_PLATFORM_ES_NONVOL_STARTUP_FILE (but a different prototype).")

<!--

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 count1110.57962778
LabelTraining Sample Count
bug662
non-bug1517

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
  • l2_weight: 0.01
  • seed: 42
  • evalmaxsteps: -1
  • loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.000210.4726-
0.0092500.2725-
0.01841000.2269-
0.02751500.2061-
0.03672000.2113-
0.04592500.1806-
0.05513000.1833-
0.06423500.1578-
0.07344000.1478-
0.08264500.1376-
0.09185000.1135-
0.10105500.1145-
0.11016000.1099-
0.11936500.0859-
0.12857000.0837-
0.13777500.0826-
0.14688000.0809-
0.15608500.0559-
0.16529000.0539-
0.17449500.0444-
0.183610000.0376-
0.192710500.0387-
0.201911000.035-
0.211111500.0317-
0.220312000.029-
0.229412500.0277-
0.238613000.0108-
0.247813500.0226-
0.257014000.0105-
0.266214500.02-
0.275315000.016-
0.284515500.0181-
0.293716000.0184-
0.302916500.0113-
0.312017000.014-
0.321217500.0101-
0.330418000.0106-
0.339618500.0101-
0.348819000.0117-
0.357919500.0115-
0.367120000.0113-
0.376320500.005-
0.385521000.0062-
0.394621500.0141-
0.403822000.0096-
0.413022500.0117-
0.422223000.0051-
0.431423500.0054-
0.440524000.0049-
0.449724500.0054-
0.458925000.0027-
0.468125500.0009-
0.477226000.0021-
0.486426500.005-
0.495627000.0026-
0.504827500.0025-
0.514028000.0014-
0.523128500.0005-
0.532329000.0012-
0.541529500.0027-
0.550730000.0002-
0.559830500.0012-
0.569031000.0015-
0.578231500.0001-
0.587432000.0-
0.596532500.0001-
0.605733000.0011-
0.614933500.0012-
0.624134000.0043-
0.633334500.0027-
0.642435000.0007-
0.651635500.0033-
0.660836000.0005-
0.670036500.0011-
0.679137000.0023-
0.688337500.0009-
0.697538000.0012-
0.706738500.0021-
0.715939000.0003-
0.725039500.0001-
0.734240000.0001-
0.743440500.0001-
0.752641000.0023-
0.761741500.0025-
0.770942000.0001-
0.780142500.0-
0.789343000.0-
0.798543500.001-
0.807644000.0013-
0.816844500.0002-
0.826045000.0026-
0.835245500.0002-
0.844346000.0002-
0.853546500.0-
0.862747000.0001-
0.871947500.0012-
0.881148000.001-
0.890248500.0001-
0.899449000.001-
0.908649500.0002-
0.917850000.0002-
0.926950500.001-
0.936151000.0001-
0.945351500.0021-
0.954552000.0001-
0.963752500.0001-
0.972853000.0-
0.982053500.0001-
0.991254000.0002-

Framework Versions

  • Python: 3.11.6
  • SetFit: 1.1.0
  • Sentence Transformers: 3.0.1
  • Transformers: 4.44.2
  • PyTorch: 2.4.1+cu121
  • Datasets: 2.21.0
  • Tokenizers: 0.19.1

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