---
language:
- en
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:14737
- loss:MultipleNegativesRankingLoss
base_model: BAAI/bge-large-en-v1.5
widget:
- source_sentence: 'Represent this sentence for searching relevant passages: What
are some best practices for ensuring images in horizontal cards are visually appealing
despite being cropped to fit a square format?'
sentences:
- 'Tree view
Usage guidelines
Horizontal scrolling: If you have a layout that doesn''t allow for users to adjust
the width of the container for a tree view, allow them to horizontally scroll
in order to see the full depth of the hierarchy.
Do: Allow horizontal scrolling in a fixed layout.
'
- 'Cards
Options
Vertical or horizontal : Standard cards can be laid out vertically (components
are organized in a column) or horizontally (components are organized in a row).
Horizontal cards always have a square preview, and the image is cropped to fit
inside the square. These can only be laid out in a tile grid where every card
is the same size.'
- 'Alert dialog
Behaviors
Button group overflow: An alert dialog can have up to 3 buttons. When horizontal
space is limited, button groups stack vertically. They should appear in ascending
order based on importance, with the most critical action at the bottom.'
- source_sentence: 'Represent this sentence for searching relevant passages: Are there
any guidelines for the timing and smoothness of the fading effect when hovering
over a segment in a donut chart?'
sentences:
- 'Color for data visualization
Usage guidelines
Categorical colors are not ordered. Use these for categorical scales. Do not use
these for ordinal, interval, or ratio scales.
Sequential colors are ordered. Use these for ordinal and interval scales. It’s
also acceptable to use these for ratio scales. Do not use these for categorical
scales.
Diverging colors are ordered. Use these for ordinal and ratio scales, especially
when there is a meaningful middle value. These may also be used for interval scales.
Do not use these for categorical scales.'
- 'Action group
Options
Density: Action groups come in 2 densities: regular and compact. The compact density
retains the same font and icon sizes, but has tighter spacing. The action buttons
also become connected for non-quiet action groups.'
- 'Donut chart
Behaviors
Hover: Hovering over a segment of a donut chart causes all other segments to fade
back from the view. A tooltip displays the segment name, percentage of total,
and metric value.'
- source_sentence: 'Represent this sentence for searching relevant passages: Why is
it important to orient the legend to match the chart whenever possible?'
sentences:
- 'Breadcrumbs
Options
Multiline: The multiline variation places emphasis on the selected breadcrumb
item as a page title, helping a user to more clearly identify their current location.'
- 'Cards
Layout
Card width: Cards are laid out in either a fluid card grid or have fixed widths.
Most cards can be organized within a grid where the width of each card is fluid
depending on the nature of the grid. In rare cases where cards can’t be laid out
in a card grid, they’ll have a fixed width that is defined manually.'
- 'Legend
Options
Orientation: Legends can have horizontal or vertical orientation. Whenever possible,
orient the legend to match the chart.'
- source_sentence: 'Represent this sentence for searching relevant passages: What
is the primary use case for radio buttons according to the Adobe Spectrum Design
Documentation?'
sentences:
- 'Radio group
Usage guidelines
Use radio buttons for mutually exclusive options: Radio buttons and [checkboxes](/page/checkbox)
are not interchangeable. Radio buttons are best used for selecting a single option
from a list of mutually exclusive options. Checkboxes are best used for selecting
multiple options at once (or no options).
'
- 'Additional resources: - [Human Interface Guidelines: iOS Tab Bars](https://developer.apple.com/design/human-interface-guidelines/ios/bars/tab-bars/)
- [Human Interface Guidelines: Accessibility](https://developer.apple.com/design/human-interface-guidelines/accessibility/overview/introduction/)
'
- 'Picker
Options
Label position: Labels can be placed either on top or on the side. Top labels
are the default and are recommended because they work better with long copy, localization,
and responsive layouts. Side labels are most useful when vertical space is limited.'
- source_sentence: 'Represent this sentence for searching relevant passages: How can
a designer balance the need for clear text links and the need for emphasized text
in a user interface?'
sentences:
- 'Meter
Options
Positive variant: The positive variant has a green fill to show the value. This
can be used to represent a positive semantic value, such as when there’s a lot
of space remaining.'
- 'Badge
Options
Size: Badges come in four different sizes: small, medium, large, and extra-large.
The small size is the default and most frequently used option. Use the other sizes
sparingly to create a hierarchy of importance on a page.'
- 'Typography
Usage guidelines
Don''t use underlines for adding emphasis: Underlines are reserved for text links
only. They should not be used as a way for adding emphasis to words.
'
datasets:
- JianLiao/spectrum-design-docs
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
model-index:
- name: SentenceTransformer based on BAAI/bge-large-en-v1.5
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: sds
type: sds
metrics:
- type: cosine_accuracy@1
value: 0.007462686567164179
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.015603799185888738
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.04748982360922659
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.7815468113975577
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.007462686567164179
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.005201266395296246
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.009497964721845319
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.07815468113975575
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.007462686567164179
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.015603799185888738
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.04748982360922659
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.7815468113975577
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.25440066233238845
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.10778547737502948
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.11639203259428242
name: Cosine Map@100
---
# SentenceTransformer based on BAAI/bge-large-en-v1.5
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) on the [spectrum-design-docs](https://huggingface.co/datasets/JianLiao/spectrum-design-docs) dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 1024 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [spectrum-design-docs](https://huggingface.co/datasets/JianLiao/spectrum-design-docs)
- **Language:** en
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("JianLiao/spectrum-doc-fine-tuned")
# Run inference
sentences = [
'Represent this sentence for searching relevant passages: How can a designer balance the need for clear text links and the need for emphasized text in a user interface?',
"Typography\nUsage guidelines\nDon't use underlines for adding emphasis: Underlines are reserved for text links only. They should not be used as a way for adding emphasis to words.\n\n",
'Meter\nOptions\nPositive variant: The positive variant has a green fill to show the value. This can be used to represent a positive semantic value, such as when there’s a lot of space remaining.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `sds`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.0075 |
| cosine_accuracy@3 | 0.0156 |
| cosine_accuracy@5 | 0.0475 |
| cosine_accuracy@10 | 0.7815 |
| cosine_precision@1 | 0.0075 |
| cosine_precision@3 | 0.0052 |
| cosine_precision@5 | 0.0095 |
| cosine_precision@10 | 0.0782 |
| cosine_recall@1 | 0.0075 |
| cosine_recall@3 | 0.0156 |
| cosine_recall@5 | 0.0475 |
| cosine_recall@10 | 0.7815 |
| **cosine_ndcg@10** | **0.2544** |
| cosine_mrr@10 | 0.1078 |
| cosine_map@100 | 0.1164 |
## Training Details
### Training Dataset
#### spectrum-design-docs
* Dataset: [spectrum-design-docs](https://huggingface.co/datasets/JianLiao/spectrum-design-docs) at [23f5565](https://huggingface.co/datasets/JianLiao/spectrum-design-docs/tree/23f5565f9fc1cfe31d1245ca9e5368f00fcaec00)
* Size: 14,737 training samples
* Columns: anchor
and positive
* Approximate statistics based on the first 1000 samples:
| | anchor | positive |
|:--------|:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
| type | string | string |
| details |
Represent this sentence for searching relevant passages: Are there any specific guidelines or best practices provided by the Spectrum team for integrating Spectrum CSS into a new or existing project?
| Spectrum CSS: An open source CSS-only implementation of Spectrum, maintained by the Spectrum team.
Dependency chain: Spectrum DNA → Spectrum CSS
[GitHub repository](https://github.com/adobe/spectrum-css/)
[Website](https://opensource.adobe.com/spectrum-css/)
[#spectrum_css](https://adobe.slack.com/archives/C5N154FEY)
|
| Represent this sentence for searching relevant passages: How does the default setting for progress circles affect their behavior in a UI?
| Progress circle
Options
Indeterminate: A progress circle can be either determinate or indeterminate. By default, progress circles are determinate. Use a determinate progress circle when progress can be calculated against a specific goal (e.g., downloading a file of a known size). Use an indeterminate progress circle when progress is happening but the time or effort to completion can’t be determined (e.g., attempting to reconnect to a server).
|
| Represent this sentence for searching relevant passages: What tools or methods can designers use to test the effectiveness of wrapped legends in their designs?
| Legend
Behaviors
Wrapping: When there isn’t enough space, wrap legends to ensure that dimension values are shown.
|
* Loss: [MultipleNegativesRankingLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: epoch
- `per_device_train_batch_size`: 22
- `per_device_eval_batch_size`: 16
- `gradient_accumulation_steps`: 16
- `learning_rate`: 2e-05
- `num_train_epochs`: 100
- `lr_scheduler_type`: cosine
- `warmup_ratio`: 0.1
- `bf16`: True
- `tf32`: True
- `load_best_model_at_end`: True
- `optim`: adamw_torch_fused
- `prompts`: {'anchor': 'Represent this sentence for searching relevant passages: '}
- `batch_sampler`: no_duplicates
#### All Hyperparameters