| | """Configuration module for Finesse Benchmark Database Generator
|
| |
|
| | This module holds all configurable parameters for generating atomic probes from Wikimedia Wikipedia datasets.
|
| | Based on the 'Beads and String' model: 64-token atomic beads from diverse languages, ensuring semantic continuity within strings but independence across probes.
|
| |
|
| | Key Principles:
|
| | - Fixed 64-token chunk size for atomic beads.
|
| | - Balanced sampling across languages for global diversity.
|
| | - Seeded randomness for perfect reproducibility.
|
| | - Output in probes_atomic.jsonl format for dynamic assembly in evaluation.
|
| |
|
| | Usage:
|
| | from config import tokenizer_name, languages, chunk_token_size, samples_per_language, output_file, seed
|
| | """
|
| |
|
| | from dataclasses import dataclass
|
| | import random
|
| |
|
| | @dataclass
|
| | class ProbeConfig:
|
| | """Central configuration for probe generation.
|
| |
|
| | This dataclass serves as a flexible template for library users.
|
| | Instantiate and populate it with desired values before passing to generate functions.
|
| |
|
| | Example:
|
| | config = ProbeConfig(
|
| | languages=['en', 'ko'],
|
| | samples_per_language=10,
|
| | chunk_token_size=64
|
| | )
|
| | """
|
| |
|
| |
|
| | tokenizer_name: str = "google-bert/bert-base-multilingual-cased"
|
| |
|
| |
|
| | languages: list[str] = None
|
| |
|
| |
|
| | chunk_token_size: int = 64
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | samples_per_language: int = 10000
|
| |
|
| |
|
| | output_file: str = "probes_atomic.jsonl"
|
| |
|
| |
|
| | seed: int = 42
|
| |
|
| | def get_config() -> ProbeConfig:
|
| | """Instantiate and return the configuration with languages initialized."""
|
| | config = ProbeConfig()
|
| | config.languages = [
|
| | 'en',
|
| | 'ko',
|
| | 'es',
|
| | 'ja',
|
| | 'ru',
|
| | 'zh',
|
| | 'ar',
|
| | 'id',
|
| | 'de',
|
| | 'vi',
|
| | ]
|
| |
|
| |
|
| | random.seed(config.seed)
|
| |
|
| | return config
|
| |
|
| |
|
| | CONFIG = get_config() |