Skip to main content

Data generation factory for atomic probes in Finesse benchmark. Generates probes_atomic.jsonl from Wikimedia Wikipedia.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description


license: apache-2.0

GitHub huggingface PyPI Blog

Finesse Benchmark Database

Overview

finesse-benchmark-database is a data generation factory for atomic probes in the Finesse benchmark. It generates probes_atomic.jsonl files from Wikimedia Wikipedia datasets, leveraging Hugging Face's datasets library, tokenizers from transformers, and optional PyTorch support.

This tool is designed to create high-quality, language-specific probe datasets for benchmarking fine-grained understanding in NLP tasks.

Installation

Install the package from PyPI:

pip install finesse-benchmark-database

Ensure you have Python 3.10+ installed.

Usage

Here's a complete example of how to configure and generate a dataset:

from finesse_benchmark_database.config import ProbeConfig
from finesse_benchmark_database.main import generate_dataset

# Define the configuration
my_config = ProbeConfig(
    languages=['en', 'ko'],  # Languages to generate probes for
    samples_per_language=10,  # Number of samples per language (reduce for testing)
    output_file='my_first_probes.jsonl',  # Output file path
    seed=123  # Random seed for reproducibility
)

# Generate the dataset
print(f"Generating '{my_config.output_file}'...")
generate_dataset(my_config)
print("Dataset generation completed!")

Configuration Options

  • languages: List of language codes (e.g., ['en', 'ko', 'fr']).
  • samples_per_language: Number of probe samples to generate per language.
  • output_file: Path to the output JSONL file.
  • seed: Optional seed for deterministic results.

Output Format

The output file (probes_atomic.jsonl) is a JSON Lines file where each line is a JSON object representing a probe sample. The structure is as follows:

  • source: An object containing metadata about the origin of the probe.
    • dataset: The source dataset, e.g., "wikimedia/wikipedia".
    • article_id: The unique identifier of the article, e.g., "5438".
    • lang: The language code, e.g., "en".
  • beads: An array of strings, where each string is a chunk ("bead") of the article text, processed into atomic units for probing.

Example:

{
  "source": {
    "dataset": "wikimedia/wikipedia",
    "article_id": "5438",
    "source_article_hash": "...article_hash...",
    "lang": "en"
  },
  "beads": [
    "Capricorn ( pl. capricorns )...",
    // more chunks
  ]
}

Requirements

  • datasets
  • transformers
  • torch (for tokenization)

License

This project is licensed under the Apache-2.0 license.

Contributing

Contributions are welcome! Please open issues or pull requests on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finesse_benchmark_database-0.1.14.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finesse_benchmark_database-0.1.14-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file finesse_benchmark_database-0.1.14.tar.gz.

File metadata

File hashes

Hashes for finesse_benchmark_database-0.1.14.tar.gz
Algorithm Hash digest
SHA256 546bd804de4ca69b1851b397deb35d28a37f64085d9099824fb52dfa388684fd
MD5 96be85ce975fa8d39293b21aadbe50f1
BLAKE2b-256 bb7494d2ab3985f81022fb3752517ec102dd743a7f469c377a754698d48f52ed

See more details on using hashes here.

File details

Details for the file finesse_benchmark_database-0.1.14-py3-none-any.whl.

File metadata

File hashes

Hashes for finesse_benchmark_database-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 d21ff264888c575ac16bbff62c79eececd765cc318d903c59482ccc1484b25d0
MD5 a1f99174f144e5e3cd9127252c64e9c1
BLAKE2b-256 4a4d9257a55715be2471c8fe89be009123144dd40286ebc29c5262838e06e35d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page