manidoraisamy commited on
Commit
b9bb652
·
verified ·
1 Parent(s): 797b47a

Add the own-data readers (readers/: schema items, two reading models, re-scorer, refusal); cards describe them

Browse files
README.md CHANGED
@@ -1,6 +1,9 @@
1
  ---
2
  license: apache-2.0
3
- base_model: Qwen/Qwen2.5-0.5B
 
 
 
4
  library_name: peft
5
  tags:
6
  - text-to-sql
@@ -14,9 +17,10 @@ tags:
14
  This repository contains the public, manifest-pinned runtime weights for
15
  [Prereasoner](https://github.com/ManiDoraisamy/prereasoner-data), an interpretable
16
  table-question-answering system. Learned components produce semantic evidence: named coordinates
17
- for columns and question words, and Schema.org property and class scores. A deterministic typed AST
18
- planner builds every query and owns joins, calculation verification, selection, rendering, and
19
- execution. No model in this bundle writes SQL, and the bundle is not a standalone text-to-SQL model.
 
20
 
21
  ## Install
22
 
@@ -43,21 +47,27 @@ the complete bundle, and only then installs it.
43
  | `anchor_assignment.npz` | Calibrated named-dimension thresholds |
44
  | `primitives.npz` | Learned primitive-composition head |
45
  | `schema_property_head.pt` | Calibrated Schema.org named-property evidence head |
 
 
 
 
46
 
47
  The source repository contains the small ontology, calibration, taxonomy, and manifest artifacts.
48
- The base Qwen model is downloaded separately from its publisher. `python -m engine.fetch_weights`
 
49
  downloads only the files the source manifest lists. Prereasoner loads no SQL-generating model; the
50
  retired SQL proposer adapter (`sql_proposer/`) was removed from this repository on 2026-10-02 and
51
  remains in its history.
52
 
53
  ## Model Boundary
54
 
55
- The encoder adapter emits named Schema.org property probabilities, calibrated class proposals,
56
- embeddings for structural intent and ranking, and calculation operand signals. A released class may
57
- propose a coarse resolver family, but no score can authorize a table, join, calculation, or answer.
58
- Prereasoner's deterministic search builds every query from these signals, and the engine serves the
59
- best-ranked query that runs on the data. An operator may enable an external Gemini fallback for
60
- questions the search cannot answer; it is not part of this bundle, and its answers are labelled.
 
61
  Deterministic code applies ontology mapping, exact source grounding, typed constraints, abstention
62
  rules, and execution checks.
63
 
@@ -95,6 +105,9 @@ servable. Unsupported and under-calibrated coordinates abstain.
95
  ## License
96
 
97
  The Prereasoner weight bundle is released under Apache-2.0. The base model and source datasets retain
98
- their own licenses and terms. The retired `sql_proposer/` adapter in earlier revisions was trained on
 
 
 
99
  Spider TRAIN (Yu et al., EMNLP 2018; CC BY-SA 4.0); keep that attribution when redistributing it. See
100
  [`THIRD_PARTY.md`](https://github.com/ManiDoraisamy/prereasoner-data/blob/main/THIRD_PARTY.md).
 
1
  ---
2
  license: apache-2.0
3
+ base_model:
4
+ - Qwen/Qwen2.5-0.5B
5
+ - FacebookAI/xlm-roberta-base
6
+ - FacebookAI/xlm-roberta-large
7
  library_name: peft
8
  tags:
9
  - text-to-sql
 
17
  This repository contains the public, manifest-pinned runtime weights for
18
  [Prereasoner](https://github.com/ManiDoraisamy/prereasoner-data), an interpretable
19
  table-question-answering system. Learned components produce semantic evidence: named coordinates
20
+ for columns and question words, Schema.org property and class scores, and the own-data readers'
21
+ readings of a question (which tables, columns, values, groups, orders and calculations it asks for).
22
+ A deterministic typed AST builder makes every query from those readings and owns joins, calculation
23
+ verification, rendering, and execution. No model in this bundle writes SQL, and the bundle is not a standalone text-to-SQL model.
24
 
25
  ## Install
26
 
 
47
  | `anchor_assignment.npz` | Calibrated named-dimension thresholds |
48
  | `primitives.npz` | Learned primitive-composition head |
49
  | `schema_property_head.pt` | Calibrated Schema.org named-property evidence head |
50
+ | `readers/stage1/` | Own-data schema-item model (XLM-R base): scores each table's and column's use |
51
+ | `readers/stage2_a/`, `readers/stage2_b/` | Own-data reading models (XLM-R large), one with the question's values beside their columns and one without |
52
+ | `readers/rescorer/` | Re-scorer (XLM-R base): orders the readings' queries that ran |
53
+ | `readers/refusal.json` | Logistic refusal over the re-scorer's confidence, fitted on held-out calibration databases |
54
 
55
  The source repository contains the small ontology, calibration, taxonomy, and manifest artifacts.
56
+ The base Qwen model is downloaded separately from its publisher. The readers' directories hold their
57
+ complete fine-tuned weights (encoders in bfloat16, heads in float32) and tokenizer files. `python -m engine.fetch_weights`
58
  downloads only the files the source manifest lists. Prereasoner loads no SQL-generating model; the
59
  retired SQL proposer adapter (`sql_proposer/`) was removed from this repository on 2026-10-02 and
60
  remains in its history.
61
 
62
  ## Model Boundary
63
 
64
+ The encoder adapter emits named Schema.org property probabilities, calibrated class proposals, and
65
+ embeddings for column typing and the structural intent of composition and world questions. A released
66
+ class may propose a coarse resolver family, but no score can authorize a table, join, calculation, or
67
+ answer. Own-data questions are read by separate XLM-R readers (`engine/data/readers/`); a deterministic
68
+ builder makes each of their readings a typed query, and no model writes SQL. The optional Gemini model
69
+ serves only the chat orchestrator, starter questions and reference generation, and is not part of
70
+ this bundle.
71
  Deterministic code applies ontology mapping, exact source grounding, typed constraints, abstention
72
  rules, and execution checks.
73
 
 
105
  ## License
106
 
107
  The Prereasoner weight bundle is released under Apache-2.0. The base model and source datasets retain
108
+ their own licenses and terms. The readers in `readers/` are fine-tuned from XLM-RoBERTa (MIT) on Spider's
109
+ train and dev questions (Yu et al., EMNLP 2018; CC BY-SA 4.0), BIRD train (Li et al., NeurIPS 2023;
110
+ CC BY-SA 4.0) and Spider-Syn (Gan et al., ACL 2021; MIT); keep those attributions when redistributing
111
+ them. The Spider test set appears in no training step. The retired `sql_proposer/` adapter in earlier revisions was trained on
112
  Spider TRAIN (Yu et al., EMNLP 2018; CC BY-SA 4.0); keep that attribution when redistributing it. See
113
  [`THIRD_PARTY.md`](https://github.com/ManiDoraisamy/prereasoner-data/blob/main/THIRD_PARTY.md).
qwen_lora/README.md CHANGED
@@ -13,7 +13,8 @@ This directory of the
13
  [Prereasoner runtime bundle](https://huggingface.co/prereasoner/prereasoner-weights) holds the LoRA
14
  adapter that turns `Qwen/Qwen2.5-0.5B` into an encoder whose representation feeds named semantic
15
  readouts. Prereasoner uses the base without its decoder and loads no SQL-generating model: a
16
- deterministic search builds every query. A retired SQL proposer adapter (`sql_proposer/`) from an
 
17
  earlier design was removed from this repository on 2026-10-02 and remains in its history.
18
 
19
  Install and validate the complete compatible bundle through the source repository:
 
13
  [Prereasoner runtime bundle](https://huggingface.co/prereasoner/prereasoner-weights) holds the LoRA
14
  adapter that turns `Qwen/Qwen2.5-0.5B` into an encoder whose representation feeds named semantic
15
  readouts. Prereasoner uses the base without its decoder and loads no SQL-generating model: a
16
+ deterministic builder makes every own-data query a typed AST from the readings of separate XLM-R
17
+ readers. A retired SQL proposer adapter (`sql_proposer/`) from an
18
  earlier design was removed from this repository on 2026-10-02 and remains in its history.
19
 
20
  Install and validate the complete compatible bundle through the source repository:
readers/refusal.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "coef": [
3
+ 2.517458605608872,
4
+ 0.429020566395794,
5
+ 0.2848816003601845,
6
+ 0.07420142722472789,
7
+ -0.11174800968699541
8
+ ],
9
+ "features": [
10
+ "rescorer_probability",
11
+ "score",
12
+ "margin",
13
+ "rank",
14
+ "empty"
15
+ ],
16
+ "intercept": -0.7305985111800368,
17
+ "matched": {
18
+ "answered": 881,
19
+ "baseline_wrong": 294,
20
+ "questions": 1053,
21
+ "right": 587,
22
+ "wrong": 294
23
+ },
24
+ "target": null,
25
+ "threshold": 0.2511
26
+ }
readers/rescorer/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-05,
14
+ "max_position_embeddings": 514,
15
+ "model_type": "xlm-roberta",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "output_past": true,
19
+ "pad_token_id": 1,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.17.0.dev0",
22
+ "type_vocab_size": 1,
23
+ "use_cache": true,
24
+ "vocab_size": 250002
25
+ }
readers/rescorer/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bda010f1ed74e34f6f85e0546f0efd8799ec48d5a9e7aacc541369debaa526b
3
+ size 556142991
readers/rescorer/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
readers/rescorer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
readers/rescorer/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"model_max_length": 512}
readers/stage1/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-05,
14
+ "max_position_embeddings": 514,
15
+ "model_type": "xlm-roberta",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "output_past": true,
19
+ "pad_token_id": 1,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.17.0.dev0",
22
+ "type_vocab_size": 1,
23
+ "use_cache": true,
24
+ "vocab_size": 250002
25
+ }
readers/stage1/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f84c5cd9424f008116befbcd2d1a08c9508a2583be05139694edea7a78ade7e
3
+ size 556161927
readers/stage1/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
readers/stage1/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
readers/stage1/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"model_max_length": 512}
readers/stage2_a/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 1024,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 4096,
13
+ "layer_norm_eps": 1e-05,
14
+ "max_position_embeddings": 514,
15
+ "model_type": "xlm-roberta",
16
+ "num_attention_heads": 16,
17
+ "num_hidden_layers": 24,
18
+ "output_past": true,
19
+ "pad_token_id": 1,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.17.0.dev0",
22
+ "type_vocab_size": 1,
23
+ "use_cache": true,
24
+ "vocab_size": 250002
25
+ }
readers/stage2_a/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c6065296b9c61dffab87c7d4f22979918a7b1322fed3e9945c09a40a1a25fa1
3
+ size 1124924775
readers/stage2_a/reader.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"anchored": true}
readers/stage2_a/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
readers/stage2_a/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
readers/stage2_a/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"model_max_length": 512}
readers/stage2_b/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 1024,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 4096,
13
+ "layer_norm_eps": 1e-05,
14
+ "max_position_embeddings": 514,
15
+ "model_type": "xlm-roberta",
16
+ "num_attention_heads": 16,
17
+ "num_hidden_layers": 24,
18
+ "output_past": true,
19
+ "pad_token_id": 1,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.17.0.dev0",
22
+ "type_vocab_size": 1,
23
+ "use_cache": true,
24
+ "vocab_size": 250002
25
+ }
readers/stage2_b/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:052ea4af552951d5589b04ae9be52a38c2167e68e024ca44e861f1663dd438d2
3
+ size 1124924775
readers/stage2_b/reader.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"anchored": false}
readers/stage2_b/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
readers/stage2_b/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
readers/stage2_b/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"model_max_length": 512}