BeeGass's picture
Upload folder using huggingface_hub
2446235 verified
|
raw
history blame
3.52 kB

pretty_name: Permutation Composition Dataset (A5) size_categories: - small - medium - large - xlarge - xxlarge tags: - mathematics - group-theory - permutations - sequence-to-sequence - benchmark - generated task_categories: - text-generation - sequence-modeling annotations_creators: - no-annotations language_creators: - other language: - en licenses: - mit

Permutation Composition Dataset for A5

This dataset contains sequences of permutation IDs and their compositions, designed for benchmarking sequence-to-sequence models on group theory tasks.

Dataset Structure

The dataset is split into train and test sets. Each sample in the dataset has the following features:

  • input_sequence: A space-separated string of integer IDs representing the sequence of permutations to be composed.
  • target: An integer ID representing the composition of the input_sequence permutations.

Group Details

  • Group Name: A5
  • Group Type: Alternating Group
  • Degree: 5 (permutations act on 5 elements)
  • Order: 60 (total number of elements in the group)

Data Generation

This dataset was generated using the s5-data-gen script. The generation process involves:

  1. Generating all unique permutations for the specified group.
  2. Mapping each unique permutation to a unique integer ID.
  3. Randomly sampling sequences of these permutation IDs.
  4. Composing the permutations in the sequence (from right to left: p_n o ... o p_2 o p_1).
  5. Mapping the resulting composed permutation to its integer ID as the target.

Generation Parameters:

  • Total Samples: 20000
  • Minimum Sequence Length: 3
  • Maximum Sequence Length: 512
  • Test Split Size: 0.2

Dataset Statistics

  • Train Samples: 16000
  • Test Samples: 4000

Permutation Mapping

The mapping from integer IDs to their corresponding permutation array forms is provided in the metadata.json file alongside the dataset. This file is crucial for interpreting the input_sequence and target IDs.

Example of metadata.json content:

{
  "0": "[0, 1, 2, 3, 4]",
  "1": "[0, 1, 3, 2, 4]",
  "2": "[0, 1, 4, 3, 2]",
  "3": "[0, 2, 1, 3, 4]",
  "4": "[0, 2, 3, 1, 4]"
  // ... and so on for all 60 permutations
}

Usage

You can load this dataset using the Hugging Face datasets library:

from datasets import load_dataset
import json
from huggingface_hub import hf_hub_download

# Load the dataset
dataset = load_dataset("BeeGass/permutation-groups")

# Load the permutation mapping
metadata_path = hf_hub_download(repo_id="BeeGass/permutation-groups", filename="metadata.json")
with open(metadata_path, "r") as f:
    id_to_perm_map = json.load(f)

# Example: Decode a sample
first_train_sample = dataset["train"][0]
input_ids = [int(x) for x in first_train_sample["input_sequence"].split(" ")]
target_id = int(first_train_sample["target"])

print(f"Input sequence IDs: {input_ids}")
print(f"Target ID: {target_id}")

# Convert IDs back to permutations (example for the first input permutation)
# Note: SymPy Permutation expects a list of integers, not a string representation
# You would need to parse the string representation from id_to_perm_map
# For example: eval(id_to_perm_map[str(input_ids[0])])

print(f"First input permutation (array form): {id_to_perm_map[str(input_ids[0])]}")
print(f"Target permutation (array form): {id_to_perm_map[str(target_id)]}")

License

This dataset is licensed under the MIT License.