# Card Sort

Source: https://www.potatoannotator.com/docs/annotation-types/card-sort

The card sort annotation schema provides a drag-and-drop interface for grouping items into categories. This schema is ideal for information architecture research, content categorization, and any task where annotators need to organize items into meaningful groups.

## Overview

The card sort schema supports two modes:
- **Closed sort** - Annotators drag cards into predefined groups
- **Open sort** - Annotators create their own groups and name them

Cards are draggable elements that annotators arrange by dropping them into group containers, making the task intuitive and engaging.

## Quick Start

```yaml
annotation_schemes:
  - annotation_type: card_sort
    name: content_grouping
    description: Drag each card into the most appropriate group.
    mode: closed
    groups:
      - Positive
      - Negative
      - Neutral
```

## Configuration Options

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `annotation_type` | string | Required | Must be `"card_sort"` |
| `name` | string | Required | Unique identifier for this schema |
| `description` | string | Required | Instructions displayed to annotators |
| `mode` | string | Required | `"closed"` (predefined groups) or `"open"` (annotator-created groups) |
| `groups` | array | Required (closed) | List of group names for closed sort mode |
| `items_field` | string | `"items"` | Field in the data JSON containing the list of card items |
| `allow_empty_groups` | boolean | `true` | Whether groups can remain empty on submission |
| `allow_multiple` | boolean | `false` | Whether a card can be placed in multiple groups |

## Examples

### Sentiment Sorting (Closed)

```yaml
annotation_schemes:
  - annotation_type: card_sort
    name: sentiment_sort
    description: Sort each comment into the appropriate sentiment category.
    mode: closed
    groups:
      - Positive
      - Negative
      - Mixed
      - Off-topic
    allow_empty_groups: true
```

With sample data:
```json
{
  "id": "batch_001",
  "items": [
    "Great product, love it!",
    "Terrible experience, never again.",
    "It was okay, some good and bad parts.",
    "Anyone know the weather today?"
  ]
}
```

### Open Card Sort for Information Architecture

```yaml
annotation_schemes:
  - annotation_type: card_sort
    name: ia_sort
    description: >
      Group these menu items into categories that make sense to you.
      Name each group with a descriptive label.
    mode: open
    items_field: "menu_items"
    allow_empty_groups: false
```

### Multi-Label Grouping

```yaml
annotation_schemes:
  - annotation_type: card_sort
    name: theme_sort
    description: >
      Sort each statement into relevant themes.
      A statement can belong to multiple themes.
    mode: closed
    groups:
      - Economy
      - Healthcare
      - Education
      - Environment
      - Security
    allow_multiple: true
```

## Output Format

```json
{
  "content_grouping": {
    "groups": {
      "Positive": ["Great product, love it!"],
      "Negative": ["Terrible experience, never again."],
      "Mixed": ["It was okay, some good and bad parts."],
      "Off-topic": ["Anyone know the weather today?"]
    }
  }
}
```

For open sort, group names are annotator-defined strings.

## Best Practices

1. **Use closed sort for consistent results** - predefined groups ensure comparable annotations across annotators
2. **Use open sort for exploratory research** - when you want to discover how people naturally group items
3. **Keep card text short** - long text on cards makes dragging awkward; use concise labels or excerpts
4. **Limit the number of cards** - 15-30 cards per task is ideal; more than 40 becomes tedious
5. **Provide clear group labels** - for closed sort, use unambiguous group names to reduce confusion

## Further Reading

- [Radio & Multiselect](/docs/annotation-types/radio-multiselect) - Standard label selection
- [Best-Worst Scaling](/docs/annotation-types/best-worst-scaling) - Comparative annotation
- [Productivity Features](/docs/features/productivity) - Keyboard shortcuts and efficiency

For implementation details, see the [source documentation](https://github.com/davidjurgens/potato/blob/main/docs/annotation_schemes.md).
