lang_table / README.md
talzoomanzoo's picture
Add balanced semantic-v1 datasets, labels, setup subsets, and provenance
343cd2b verified
|
Raw History Blame Contribute Delete
7.26 kB
---
language:
- en
license: cc-by-sa-4.0
task_categories:
- question-answering
size_categories:
- n<1K
tags:
- transition-analysis
- proof-of-concept
- semantic-probing
configs:
- config_name: default
default: true
data_files:
- split: test
path: lang_table.json
field: examples
- config_name: semantic
data_files:
- split: test
path: semantic/lang_table.json
field: examples
- config_name: setup
data_files:
- split: test
path: setup/lang_table.json
field: examples
---
# Prose–table representation transitions
PoC1 matched-input examples using English prose (A) and Markdown tables (B). Version `semantic-v1` adds a balanced semantic-probing set to the original 10 setup examples. Each example contains four prompts: AA, AB, BA, and BB.
| Configuration | Examples | Prompts | Intended use |
| --- | ---: | ---: | --- |
| `default` | 90 | 360 | Original setup plus semantic extension |
| `semantic` | 80 | 320 | Balanced inference, CKA, and probing |
| `setup` | 10 | 40 | Original setup examples, unchanged |
The `semantic` configuration has target `comparison_result` with 40 yes and 40 no. Its labels and grouping information are in `labels/lang_table.json`.
## Conditions and schema
The first condition letter specifies S1 and the second specifies S2. AA/BB use the same representation in both segments; AB/BA cross representations. Segment meanings, identifiers, row order, and the English question are fixed across conditions. The final English prose question can introduce a further boundary after S2 in AB/BB.
The JSON files contain a top-level object with setup metadata and an `examples` list. Configurations expose that list as the `test` split. This split name denotes evaluation examples; it does not indicate an independently sampled held-out benchmark. The configurations overlap: do not treat `default`, `semantic`, and `setup` as disjoint training/test splits.
Examples contain `id`, `task`, `segments`, `question`, `question_language`, and `inputs`. Gold answers are in `expected_answers`, with comparison rules in `answer_comparison`. Source tables and provenance are retained in additional fields.
New examples additionally include `group_id`, `semantic_facts`, and `extension`. Only send `inputs[condition]` to the model. Gold answers, semantic facts, group IDs, and provenance are auditing/evaluation metadata and must not enter the prompt.
## Loading
```python
from datasets import load_dataset
examples = load_dataset("talzoomanzoo/lang_table", "semantic", split="test")
prompt = examples[0]["inputs"]["AB"]
```
To retrieve the original JSON structure together with labels:
```python
import json
from huggingface_hub import hf_hub_download
def read_json(filename):
path = hf_hub_download("talzoomanzoo/lang_table", filename, repo_type="dataset")
with open(path, encoding="utf-8") as f:
return json.load(f)
document = read_json("semantic/lang_table.json")
labels = read_json("labels/lang_table.json")
prompt = document["examples"][0]["inputs"]["AB"]
```
Use `lang_table.json` to download the combined dataset or `setup/lang_table.json` to recover the original release. The published JSON bytes match the project files; some metadata paths refer to the original project layout.
## Probe protocol
Each annotation identifies a dataset (`lang_table`), example ID, group ID, and categorical label `comparison_result`. All four conditions of an example share its label and remain in the same evaluation fold. Related variants must share a group ID. The semantic subset supports five grouped folds with every class represented in training and evaluation.
For transition transfer, train on BB and evaluate held-out BB versus AB; separately train on AA and evaluate held-out AA versus BA. Use the last question token as the primary probe position so the representation has access to both segments and the query. Use the same model and thinking setting when comparing conditions.
The custom target equals the gold answer in this extension; the two probes do not provide independent evidence. Use `semantic` for gold-answer classification: the original setup examples have singleton answer classes. They have no annotations for the custom extension target and should be excluded from that target's probe evaluation.
## Construction and limitations
The extension uses 80 distinct tables referenced by WikiTableQuestions training questions. Each selects four unique source entries and one numeric count or measurement column. S1 maps opaque record IDs to entries; S2 maps IDs to values. Each generated question asks whether one entry's value is strictly greater than another's. Queried values are unequal; two other records serve as distractors. Source values are not synthesized.
There are two question templates, each with 20 yes and 20 no examples. The first queried record appears at each of four positions 10 times per answer class, separately in S1 and S2. Conditions preserve the same ordering. Tables were selected from a seeded shuffle using eligibility rules for unique entries and unambiguous numeric values, excluding aggregate/footer entries.
Each source table forms a group. Future questions from the same table must retain its group ID. Distinct tables can share entities and topics, so this is not an entity-disjoint or domain-disjoint evaluation. Models may recall real-world facts. Classes are balanced overall, not necessarily within source domains.
## Attribution and source snapshots
Adapted from [WikiTableQuestions](https://huggingface.co/datasets/stanfordnlp/wikitablequestions) by Panupong Pasupat and Percy Liang, introduced in [Compositional Semantic Parsing on Semi-Structured Tables (2015)](https://aclanthology.org/P15-1142/). The [upstream repository](https://github.com/ppasupat/WikiTableQuestions) is pinned to commit `7d455a5a707b96341ef72aff9428749d443d8aa9` for the semantic extension.
`sources/wikitablequestions/selected_tables.json` contains the original TSV contents for the 80 extension tables, their SHA-256 hashes, selected columns, eligible source rows, and reference questions. Original question/answer fields provide provenance; they are not the answers to the newly generated comparison questions. Source row numbers are one-based excluding the header; column indices are zero-based. Rendered headers normalize literal backslash-n sequences to spaces; nonbreaking spaces are also normalized. Raw snapshots preserve original bytes.
Changes include selecting rows/columns, generating or rewording questions, assigning record IDs, splitting facts into segments, shuffling row orders, and rendering prose/Markdown variants. These examples are an adaptation, not an unmodified benchmark evaluation split. The adaptation and source snapshots retain upstream CC BY-SA 4.0; see [the included license](sources/wikitablequestions/LICENSE).
These are small pilot datasets. Automated checks cover answers, paired renderings, provenance, class balance, and group-disjoint fold eligibility. They do not establish model or probe accuracy. Compare against appropriate baselines and establish same-condition performance before interpreting transition effects. The project design references `tue-meeting.pdf`, which is not included here.