weizhou03's picture
Push model using huggingface_hub.
e848f79 verified
|
raw
history blame
21.5 kB
metadata
tags:
  - setfit
  - sentence-transformers
  - text-classification
  - generated_from_setfit_trainer
widget:
  - text: Add a navigation menu text
  - text: Change to square format
  - text: Change the button text
  - text: Make the object stand alone
  - text: Mirror the logo 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.5353535353535354
            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
0
  • 'Add a corporate presentation background'
  • 'Insert a modern icon set for the design'
  • 'Add a mountain landscape background to the page'
1
  • 'Find me some shape options for this design'
  • 'I need some professional-looking assets'
  • 'Can you recommend some images that would work well here?'
2
  • 'Add a date and time for the event'
  • 'Insert a disclaimer text'
  • 'Add a navigation menu text'
3
  • 'Distribute the icons evenly'
  • 'Align all the text elements to the left'
  • 'Align the footer elements'
4
  • 'Make the button pulse'
  • 'Add a flip animation'
  • 'Make the text glow'
5
  • 'Make everything fade in gradually'
  • 'Make the page bounce in from the top'
  • 'Add a spiral animation to the page'
6
  • 'Change the building color'
  • 'Remove the unwanted text overlay'
  • 'Add a party hat to the dog'
7
  • 'Remove the draft image'
  • 'Delete the backup copy'
  • 'Remove the unwanted image'
8
  • 'What image editing tools do you have?'
  • 'How do I create a template?'
  • 'How can I align elements properly?'
9
  • 'Distribute the buttons around the center image'
  • 'Place the elements in a circular arrangement'
  • 'Arrange the images in a circular layout'
10
  • 'Duplicate the design'
  • 'Make a second version'
  • 'Create a new version'
11
  • 'Duplicate the icon and move it'
  • 'Duplicate the text and align it differently'
  • 'Copy the image and apply a filter'
12
  • 'Duplicate the logo to page 3'
  • 'Copy the text to the last page'
  • 'Copy the navigation to the next page'
13
  • 'Fix the typographic errors'
  • 'Improve the text flow'
  • 'Fix the font consistency'
14
  • 'Mirror the icon horizontally'
  • 'Mirror the logo vertically'
  • 'Flip the image horizontally'
15
  • 'Create a photo of a futuristic city'
  • 'Generate a picture of a tropical beach'
  • 'Generate a picture of a cat playing with yarn'
16
  • 'Create a card for a birthday party'
  • 'Create a flyer for a happy birthday party'
  • 'Generate an Instagram post for a birthday'
17
  • 'Group the navigation elements'
  • 'Combine the shape and text'
  • 'Combine the image and overlay'
18
  • 'Move the shape to the bottom'
  • 'Position the icon at (0, 0)'
  • 'Move the shape to coordinates (100, 100)'
19
  • 'Add a sepia tone effect'
  • 'Apply a modern filter'
  • 'Make the image black and white'
20
  • 'Suggest some shape designs'
  • 'Show me pattern options'
  • 'Find me border designs'
21
  • 'Restore the previous opacity'
  • 'Redo the text edit'
  • 'Restore the previous color'
22
  • 'Make the image have no background'
  • 'Remove the background from the animal'
  • 'Remove the background from the item'
23
  • 'Delete the unwanted text'
  • 'Remove the person from the background'
  • 'Remove the graffiti'
24
  • 'Replace the illustration'
  • 'Change the background image'
  • 'Change the product photo'
25
  • 'Change the button text'
  • 'Update the navigation text'
  • 'Update the description'
26
  • 'Remove all modifications'
  • 'Restore the original colors'
  • 'Remove all effects from the image'
27
  • 'Scale the text up'
  • 'Make the shape smaller'
  • 'Reduce the shape size'
28
  • 'Change to square format'
  • 'Change to poster size'
  • 'Make the page smaller'
29
  • 'Rotate the text 45 degrees'
  • 'Rotate the text 15 degrees'
  • 'Turn the image counterclockwise'
30
  • 'Distribute the shapes randomly'
  • 'Distribute the leaves randomly on the page'
  • 'Scatter the confetti around the design'
31
  • 'Select the sidebar elements'
  • 'Select the background image'
  • 'Select the footer content'
32
  • 'Change to a dark background'
  • 'Make the background transparent'
  • 'Change to a neutral background'
33
  • 'Set the blend mode to soft light'
  • 'Set the blend mode to darken'
  • 'Set the blend mode to normal'
34
  • 'Add a depth of field blur'
  • 'Add a directional blur'
  • 'Add a soft blur effect'
35
  • 'Change the border style to solid'
  • 'Change the border to dotted'
  • 'Add a double border to the image'
36
  • 'Brighten the shadows'
  • 'Make the image brighter'
  • 'Brighten the highlights'
37
  • 'Bring the title to the front'
  • 'Bring the shape to the front'
  • 'Move the logo to the top layer'
38
  • 'Make the image more intense'
  • 'Enhance the contrast ratio'
  • 'Increase the tonal range'
39
  • 'Make the image round'
  • 'Make the image rectangular'
  • 'Crop to a heart shape'
40
  • 'Add a sharp drop shadow'
  • 'Add a gradient shadow'
  • 'Add a hard shadow edge'
41
  • 'Fill the shape with orange'
  • 'Fill the element with brown'
  • 'Change the shape color to blue'
42
  • 'Make the text more readable'
  • 'Increase the heading size'
  • 'Make the description smaller'
43
  • 'Make the text bold and italic'
  • 'Add strikethrough to the text'
  • 'Add bold to the title'
44
  • 'Use a contemporary font'
  • 'Use a professional font'
  • 'Use a serif font for the heading'
45
  • 'Make the bright areas brighter'
  • 'Make the highlights more prominent'
  • 'Enhance the bright spots'
46
  • 'Set the image as background layer'
  • 'Set the picture as background fill'
  • 'Make the photo cover the background'
47
  • 'Reduce the character spacing'
  • 'Add letter spacing to the logo'
  • 'Increase spacing between characters'
48
  • 'Make the lines tighter'
  • 'Spread out the text lines'
  • 'Increase the paragraph spacing'
49
  • 'Reduce the opacity of the overlay'
  • 'Increase the transparency of the image'
  • 'Make the shape more opaque'
50
  • 'Make the paragraphs closer together'
  • 'Increase the text block spacing'
  • 'Reduce the paragraph spacing'
51
  • 'Make the colors more intense'
  • 'Increase the color depth'
  • 'Make the image more colorful'
52
  • 'Darken the shadows in the image'
  • 'Increase the shadow intensity'
  • 'Enhance the shadow depth'
53
  • 'Enhance the image clarity'
  • 'Increase the image sharpness'
  • 'Sharpen the image details'
54
  • 'Center the button text'
  • 'Justify the paragraph text'
  • 'Center the title text'
55
  • 'Create a border around the text'
  • 'Add a glow effect behind the text'
  • 'Add a colored background to the text'
56
  • 'Create text in a radial pattern'
  • 'Create text that follows a circle'
  • 'Create text that follows a shape'
57
  • 'Convert to a bulleted list'
  • 'Make the text into bullet points'
  • 'Make the text into a list with bullets'
58
  • 'Create a soft shadow behind the text'
  • 'Add a dramatic shadow effect'
  • 'Create a shadow for the text'
59
  • 'Add warm undertones to the photo'
  • 'Add warm color grading'
  • 'Make the photo more golden hour'
60
  • 'I need to add my own image'
  • 'Open the image upload tool'
  • 'Show me how to upload files'
61
  • 'Revert the color change'
  • 'Undo the last modification'
  • 'Undo the text edit'
62
  • 'Separate the grouped components'
  • 'Ungroup the combined elements'
  • 'Break up the grouped objects'

Evaluation

Metrics

Label Accuracy
all 0.5354

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("Change the button text")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 3 5.1778 10
Label Training Sample Count
0 5
1 5
2 5
3 5
4 5
5 5
6 5
7 5
8 5
9 5
10 5
11 5
12 5
13 5
14 5
15 5
16 5
17 5
18 5
19 5
20 5
21 5
22 5
23 5
24 5
25 5
26 5
27 5
28 5
29 5
30 5
31 5
32 5
33 5
34 5
35 5
36 5
37 5
38 5
39 5
40 5
41 5
42 5
43 5
44 5
45 5
46 5
47 5
48 5
49 5
50 5
51 5
52 5
53 5
54 5
55 5
56 5
57 5
58 5
59 5
60 5
61 5
62 5

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.0007 1 0.1545 -
0.0328 50 0.1187 -
0.0655 100 0.0521 -
0.0983 150 0.0208 -
0.1311 200 0.0123 -
0.1638 250 0.0096 -
0.1966 300 0.0056 -
0.2294 350 0.0036 -
0.2621 400 0.0027 -
0.2949 450 0.0017 -
0.3277 500 0.0007 -
0.3604 550 0.0009 -
0.3932 600 0.0009 -
0.4260 650 0.0003 -
0.4587 700 0.0003 -
0.4915 750 0.0004 -
0.5242 800 0.0004 -
0.5570 850 0.0002 -
0.5898 900 0.0001 -
0.6225 950 0.0001 -
0.6553 1000 0.0001 -
0.6881 1050 0.0001 -
0.7208 1100 0.0001 -
0.7536 1150 0.0001 -
0.7864 1200 0.0001 -
0.8191 1250 0.0001 -
0.8519 1300 0.0001 -
0.8847 1350 0.0001 -
0.9174 1400 0.0001 -
0.9502 1450 0.0001 -
0.9830 1500 0.0001 -

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