weizhou03's picture
Push model using huggingface_hub.
44c3049 verified
|
raw
history blame
26.5 kB
metadata
tags:
  - setfit
  - sentence-transformers
  - text-classification
  - generated_from_setfit_trainer
widget:
  - text: Insert a descriptive caption for the image
  - text: Make the photo lighter
  - text: Move the logo to the top layer
  - text: Make the shape smaller
  - text: Flip the icon vertically
metrics:
  - accuracy
pipeline_tag: text-classification
library_name: setfit
inference: true
base_model: nomic-ai/nomic-embed-text-v1.5
model-index:
  - name: SetFit with nomic-ai/nomic-embed-text-v1.5
    results:
      - task:
          type: text-classification
          name: Text Classification
        dataset:
          name: Unknown
          type: unknown
          split: test
        metrics:
          - type: accuracy
            value: 0.5701459034792368
            name: Accuracy

SetFit with nomic-ai/nomic-embed-text-v1.5

This is a SetFit model that can be used for Text Classification. This SetFit model uses nomic-ai/nomic-embed-text-v1.5 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. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

Label Examples
setBorderStyle
  • 'Change the border color to red'
  • 'Change the border to a pattern'
  • 'Add a shadow border'
setChildIndex
  • 'Bring the shape to the front'
  • 'Send the watermark to the back'
  • 'Bring the button to the front'
undo
  • 'Go back to the original position'
  • 'Revert the color change'
  • 'Go back to the original text'
setTextListStyle
  • 'Make the text into bullet points'
  • 'Convert the text to a list format'
  • 'Create a bulleted list from the text'
align
  • 'Align all the text elements to the left'
  • 'Align the images to the right edge'
  • 'Center align the images on the page'
resetImageSettings
  • 'Remove all edits from the photo'
  • 'Reset the image to original'
  • 'Restore the original colors'
rotate
  • 'Turn the logo upside down'
  • 'Rotate the text 45 degrees'
  • 'Turn the button around'
ungroup
  • 'Ungroup the combined items'
  • 'Separate the grouped items'
  • 'Break apart the grouped components'
setBlendMode
  • 'Set the blend mode to multiply'
  • 'Change the blend mode to lighten'
  • 'Set the blend mode to color dodge'
addText
  • 'Add a navigation menu text'
  • 'Insert a descriptive caption for the image'
  • 'Add a date and time for the event'
setParagraphSpacing
  • 'Add more paragraph separation'
  • 'Increase the paragraph gap'
  • 'Make the text sections tighter'
addAsset
  • 'Add a sports-themed background'
  • 'Add a tech-themed icon pack'
  • 'Add a colorful gradient background'
addAssetsUIAction
  • 'I need some decorative elements'
  • 'I need some professional-looking assets'
  • 'Can you recommend some images that would work well here?'
redo
  • 'Bring back the original text'
  • 'Redo the text edit'
  • 'Redo the last modification'
applyAnimationObjectPreset
  • 'Make the image slide from left'
  • 'Add a fade-in animation to the text'
  • 'Add a slide-up animation'
moveRelativeTo
  • 'Move the button to the right'
  • 'Position the image above the text'
  • 'Move the shape to the bottom'
resizePage
  • 'Make the page taller'
  • 'Resize to LinkedIn post dimensions'
  • 'Make the page portrait orientation'
setBlur
  • 'Blur the logo slightly'
  • 'Blur the background elements'
  • 'Add a gaussian blur'
group
  • 'Group the header elements'
  • 'Group the footer content'
  • 'Combine the logo and tagline'
displayHelpQA
  • 'How do I group elements together?'
  • 'How do I add shadows to text?'
  • 'How can I duplicate elements?'
applyPageLevelAnimation
  • 'Make the page slide in from the right'
  • 'Add a flip animation to the whole page'
  • 'Make the page scale in smoothly'
duplicatePage
  • 'Duplicate the page structure'
  • 'Duplicate the current layout'
  • 'Make a second version'
setBackgroundColor
  • 'Set the background to cool blue'
  • 'Change to a dark background'
  • 'Change to a neutral background'
setLetterSpacing
  • 'Increase spacing between characters'
  • 'Tighten the letter spacing'
  • 'Make the text more spaced out'
setWarmth
  • 'Add warm lighting to the image'
  • 'Make the photo more golden'
  • 'Make the image more yellow'
setSaturation
  • 'Make the image more muted'
  • 'Increase the color richness'
  • 'Reduce the color vibrancy'
replaceText
  • 'Replace the title'
  • 'Update the navigation text'
  • 'Replace the menu items'
setLineSpacing
  • 'Increase spacing between lines'
  • 'Make the text more compact'
  • 'Make the lines tighter'
setSharpness
  • 'Sharpen the image details'
  • 'Sharpen the image edges'
  • 'Increase the detail sharpness'
delete
  • 'Remove the background shape'
  • 'Delete the broken image'
  • 'Remove the unnecessary decoration'
setContrast
  • 'Make the colors more vibrant'
  • 'Make the image more intense'
  • 'Make the image more striking'
setTextLayout
  • 'Create text that follows a circle'
  • 'Create circular text around the logo'
  • 'Make the text follow a custom curve'
generateImageFromText
  • 'Make an image of a vintage car'
  • 'Generate a picture of a tropical beach'
  • 'Make an image of a magical forest'
flip
  • 'Flip the text vertically'
  • 'Flip the icon vertically'
  • 'Mirror the logo vertically'
generateTemplates
  • 'Create a wedding invitation with floral decorations'
  • 'Generate a poster for a birthday party'
  • 'Create a minimalistic menu for a restaurant'
setHighlight
  • 'Enhance the highlight details'
  • 'Make the highlights more prominent'
  • 'Brighten the reflective areas'
removeBackground
  • 'Remove the background from the illustration'
  • 'Remove the background from the item'
  • 'Remove the background from the animal'
fixTypography
  • 'Fix the letter spacing'
  • 'Improve the overall typography'
  • 'Fix the typographic errors'
setBrightness
  • 'Brighten the highlights'
  • 'Make the image more luminous'
  • 'Increase the brightness contrast'
changeContentInImage
  • "Add glasses to the person's face"
  • 'Remove the logo from the shirt'
  • 'Add a scarf to the person'
setImageAsBackground
  • 'Make the photo cover the background'
  • 'Set the photo as page background'
  • 'Set the picture as full background'
resize
  • 'Reduce the shape size'
  • 'Make the image larger'
  • 'Make the shape smaller'
setFontSize
  • 'Make the heading larger'
  • 'Make the label smaller'
  • 'Make the quote larger'
showUploadUI
  • 'Show me the upload options'
  • 'I need to import a file'
  • 'I want to import an image'
replaceAsset
  • 'Change the decorative element'
  • 'Change the shape to a different style'
  • 'Replace the element with an alternative'
distributeAroundObject
  • 'Distribute the text around the focal point'
  • 'Distribute the elements around the focal point'
  • 'Place the decorations around the title'
select
  • 'Pick the main text block'
  • 'Select the logo element'
  • 'Select the footer content'
setOpacity
  • 'Make the shape more opaque'
  • 'Reduce the opacity of the shape'
  • 'Make the background more opaque'
setDropShadow
  • 'Add a long shadow effect'
  • 'Add a gradient shadow'
  • 'Create a realistic shadow'
proposeAssets
  • 'Suggest some shape designs'
  • 'Show me pattern options'
  • 'Find me some background images'
setShadow
  • 'Increase the shadow intensity'
  • 'Make the shadows deeper'
  • 'Make the shadows more prominent'
setCropShape
  • 'Crop the image to a circle'
  • 'Make the image rectangular'
  • 'Crop to a custom shape'
setTextAlignment
  • 'Justify the description'
  • 'Center the tagline'
  • 'Left align the subtitle'
setFontStyle
  • 'Make the text italic and bold'
  • 'Make the text bold and underlined'
  • 'Add bold to the title'
duplicateSceneNode
  • 'Copy the button and resize it'
  • 'Duplicate the text and change the color'
  • 'Copy the text and modify it'
setFontType
  • 'Change the font to Arial'
  • 'Use a script font for the title'
  • 'Use a minimalist font'
setTextDecorationEffect
  • 'Create a text container'
  • 'Add a glow effect behind the text'
  • 'Add a highlight background to the text'
scatter
  • 'Randomly place the icons on the page'
  • 'Distribute the bubbles randomly'
  • 'Scatter the stars around the title'
removeContentFromImage
  • 'Delete the unwanted person'
  • 'Delete the car from the image'
  • 'Remove the distracting element'
setFillColor
  • 'Fill the element with lime'
  • 'Change the text color to pink'
  • 'Change the color to teal'
setTextShadow
  • 'Create a text shadow'
  • 'Add a dramatic shadow effect'
  • 'Add a glow effect to the text'
previewFilterEffects
  • 'Add a dramatic contrast effect'
  • 'Make the image pop with color'
  • 'Apply a cool blue filter'
duplicateSceneNodeToPage
  • 'Copy the content to the final page'
  • 'Duplicate the decoration to page 8'
  • 'Copy the icon to the next slide'

Evaluation

Metrics

Label Accuracy
all 0.5701

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("Make the photo lighter")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 3 5.2063 11
Label Training Sample Count
addAsset 8
addAssetsUIAction 8
addText 8
align 8
applyAnimationObjectPreset 8
applyPageLevelAnimation 8
changeContentInImage 8
delete 8
displayHelpQA 8
distributeAroundObject 8
duplicatePage 8
duplicateSceneNode 8
duplicateSceneNodeToPage 8
fixTypography 8
flip 8
generateImageFromText 8
generateTemplates 8
group 8
moveRelativeTo 8
previewFilterEffects 8
proposeAssets 8
redo 8
removeBackground 8
removeContentFromImage 8
replaceAsset 8
replaceText 8
resetImageSettings 8
resize 8
resizePage 8
rotate 8
scatter 8
select 8
setBackgroundColor 8
setBlendMode 8
setBlur 8
setBorderStyle 8
setBrightness 8
setChildIndex 8
setContrast 8
setCropShape 8
setDropShadow 8
setFillColor 8
setFontSize 8
setFontStyle 8
setFontType 8
setHighlight 8
setImageAsBackground 8
setLetterSpacing 8
setLineSpacing 8
setOpacity 8
setParagraphSpacing 8
setSaturation 8
setShadow 8
setSharpness 8
setTextAlignment 8
setTextDecorationEffect 8
setTextLayout 8
setTextListStyle 8
setTextShadow 8
setWarmth 8
showUploadUI 8
undo 8
ungroup 8

Training Hyperparameters

  • batch_size: (64, 64)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • 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
  • l2_weight: 0.01
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

Epoch Step Training Loss Validation Loss
0.0003 1 0.1733 -
0.0128 50 0.1425 -
0.0256 100 0.0954 -
0.0384 150 0.0483 -
0.0512 200 0.0297 -
0.0640 250 0.0189 -
0.0768 300 0.0122 -
0.0896 350 0.0099 -
0.1024 400 0.0085 -
0.1152 450 0.0067 -
0.1280 500 0.0059 -
0.1408 550 0.0076 -
0.1536 600 0.0061 -
0.1664 650 0.0049 -
0.1792 700 0.003 -
0.1920 750 0.0023 -
0.2048 800 0.002 -
0.2176 850 0.0037 -
0.2304 900 0.0007 -
0.2432 950 0.0015 -
0.2560 1000 0.0017 -
0.2688 1050 0.0014 -
0.2816 1100 0.0003 -
0.2944 1150 0.0006 -
0.3072 1200 0.001 -
0.3200 1250 0.0007 -
0.3328 1300 0.0002 -
0.3456 1350 0.0012 -
0.3584 1400 0.0006 -
0.3712 1450 0.0003 -
0.3840 1500 0.0005 -
0.3968 1550 0.0002 -
0.4096 1600 0.0004 -
0.4224 1650 0.0009 -
0.4352 1700 0.0007 -
0.4480 1750 0.0003 -
0.4608 1800 0.0001 -
0.4736 1850 0.0006 -
0.4864 1900 0.0004 -
0.4992 1950 0.0004 -
0.5120 2000 0.0001 -
0.5248 2050 0.0004 -
0.5376 2100 0.0003 -
0.5504 2150 0.0012 -
0.5632 2200 0.0006 -
0.5760 2250 0.0001 -
0.5888 2300 0.0003 -
0.6016 2350 0.0007 -
0.6144 2400 0.0003 -
0.6272 2450 0.0004 -
0.6400 2500 0.0006 -
0.6528 2550 0.0001 -
0.6656 2600 0.0003 -
0.6784 2650 0.0006 -
0.6912 2700 0.001 -
0.7040 2750 0.0004 -
0.7168 2800 0.0008 -
0.7296 2850 0.0003 -
0.7424 2900 0.0007 -
0.7552 2950 0.0007 -
0.7680 3000 0.0007 -
0.7808 3050 0.0003 -
0.7937 3100 0.0003 -
0.8065 3150 0.0003 -
0.8193 3200 0.0007 -
0.8321 3250 0.0001 -
0.8449 3300 0.0006 -
0.8577 3350 0.0007 -
0.8705 3400 0.0003 -
0.8833 3450 0.0009 -
0.8961 3500 0.0003 -
0.9089 3550 0.0004 -
0.9217 3600 0.0004 -
0.9345 3650 0.0001 -
0.9473 3700 0.0001 -
0.9601 3750 0.0007 -
0.9729 3800 0.0006 -
0.9857 3850 0.0005 -
0.9985 3900 0.0003 -

Framework Versions

  • Python: 3.12.11
  • SetFit: 1.1.3
  • Sentence Transformers: 5.1.0
  • Transformers: 4.54.1
  • PyTorch: 2.7.1
  • Datasets: 4.0.0
  • Tokenizers: 0.21.4

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