Spaces:
Sleeping
Sleeping
| """Centralized configuration for DAIOE Explorer. | |
| - Override dataset URLs via env vars (`DAIOE_SSYK2012_URL`, `DAIOE_SSYK96_URL`). | |
| - UI option lists used by `app.py` live here. | |
| """ | |
| from __future__ import annotations | |
| import os | |
| from typing import Dict, List, Tuple | |
| # Remote pre-translated datasets (can be overridden via env vars). | |
| DAIOE_SSYK2012_URL = os.getenv( | |
| "DAIOE_SSYK2012_URL", | |
| "https://raw.githubusercontent.com/joseph-data/07_translate_ssyk/main/03_translated_files/daioe_ssyk2012_translated.csv", | |
| ) | |
| DAIOE_SSYK96_URL = os.getenv( | |
| "DAIOE_SSYK96_URL", | |
| "https://raw.githubusercontent.com/joseph-data/07_translate_ssyk/main/03_translated_files/daioe_ssyk96_translated.csv", | |
| ) | |
| DATASET_URLS: Dict[str, str] = { | |
| "ssyk2012": DAIOE_SSYK2012_URL, | |
| "ssyk96": DAIOE_SSYK96_URL, | |
| } | |
| # Default CSV separator used by weighting/aggregation. | |
| DEFAULT_SEP: str = os.getenv("DAIOE_CSV_SEP", ",") | |
| # Taxonomy and level options shared across UI/CLI. | |
| TAXONOMY_OPTIONS: List[Tuple[str, str]] = [ | |
| ("๐ธ๐ช SSYK 2012", "ssyk2012"), | |
| ("๐ธ๐ช SSYK 1996", "ssyk96"), | |
| ] | |
| LEVEL_OPTIONS: List[Tuple[str, int]] = [ | |
| ("Level 4 (4-digit)", 4), | |
| ("Level 3 (3-digit)", 3), | |
| ("Level 2 (2-digit)", 2), | |
| ("Level 1 (1-digit)", 1), | |
| ] | |
| # Default UI selections. | |
| DEFAULT_TAXONOMY = "ssyk2012" | |
| DEFAULT_LEVEL = 3 | |
| DEFAULT_WEIGHTING = "emp_weighted" | |
| DEFAULT_TOP_N = 10 | |
| DEFAULT_SORT_DESC = True | |
| # Shared UI options. | |
| METRIC_OPTIONS: List[Tuple[str, str]] = [ | |
| ("๐ All Applications", "allapps"), | |
| ("โ๏ธ Abstract strategy games", "stratgames"), | |
| ("๐ฎ Real-time video games", "videogames"), | |
| ("๐ผ๏ธ๐ Image recognition", "imgrec"), | |
| ("๐งฉ๐ผ๏ธ Image comprehension", "imgcompr"), | |
| ("๐๏ธ๐ผ๏ธ Image generation", "imggen"), | |
| ("๐ Reading comprehension", "readcompr"), | |
| ("โ๏ธ๐ค Language modelling", "lngmod"), | |
| ("๐๐ค Translation", "translat"), | |
| ("๐ฃ๏ธ๐๏ธ Speech recognition", "speechrec"), | |
| ("๐ง โจ Generative AI", "genai"), | |
| ] | |
| WEIGHTING_OPTIONS: List[Tuple[str, str]] = [ | |
| ("Employment weighted", "emp_weighted"), | |
| ("Simple average", "simple_avg"), | |
| ] | |