marcelotiziano commited on
Commit
3588618
Β·
verified Β·
1 Parent(s): 569521e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +322 -1
README.md CHANGED
@@ -7,4 +7,325 @@ sdk: static
7
  pinned: false
8
  ---
9
 
10
- Edit this `README.md` markdown file to author your organization card.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  pinned: false
8
  ---
9
 
10
+ # OpenScriptura
11
+
12
+ > **Open LLMs for Protestant Theology β€” any tradition, any language, built to last.**
13
+
14
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-gold.svg)](https://opensource.org/licenses/Apache-2.0)
15
+ [![HuggingFace](https://img.shields.io/badge/πŸ€—%20HuggingFace-openscriptura-yellow)](https://huggingface.co/openscriptura)
16
+ [![CEFEAI Benchmark](https://img.shields.io/badge/Benchmark-CEFEAI%20AFB-blue)](https://cefe.ai)
17
+ [![Python 3.11+](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://python.org)
18
+
19
+ ---
20
+
21
+ ## What is OpenScriptura
22
+
23
+ OpenScriptura is an open-source applied research project that fine-tunes open LLMs with Protestant theological corpus β€” across **all Protestant traditions** and **all languages**.
24
+
25
+ **The problem:** Existing language models treat questions of faith with excessive neutrality or simply ignore the religious dimension. The CEFEAI benchmark demonstrated that all 27 frontier models tested in 2026 produce **0% predominantly religious responses** to everyday ethical questions, with even the best model (Grok 4.20) ignoring religious perspective 70% of the time.
26
+
27
+ **The solution:** Tradition-specific fine-tuning with high-quality confessional corpus, a three-layer validation pipeline, and scientifically comparable evaluation via CEFEAI.
28
+
29
+ **The scope:** OpenScriptura serves the full breadth of Protestant Christianity β€” Reformed, Lutheran, Anglican, Baptist, Methodist, Pentecostal, and beyond. Each tradition has its own confessional standards, its own dataset, and its own model variant. We start with Reformed theology in Brazilian Portuguese because that is where we started β€” not because that is where we end.
30
+
31
+ ---
32
+
33
+ ## Scientific Motivation
34
+
35
+ ```
36
+ Base models β€” CEFEAI Religious Representation (May 2026, 150 questions):
37
+
38
+ Grok 4.20 β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 29.3% Any Representation
39
+ Mistral Large β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 23.3%
40
+ GPT-5.4 β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 17.3%
41
+ Qwen3-8B base β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ ~6.0% ← our starting point
42
+ Claude Opus 4.7 β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 4.0%
43
+ Llama 4 Scout β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 3.3%
44
+
45
+ Predominantly Religious: 0% across all 27 models tested.
46
+
47
+ OpenScriptura v0.1 target: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ > 60%
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Protestant Traditions
53
+
54
+ OpenScriptura is designed to serve the full breadth of Protestant Christianity. Each tradition is treated with fidelity to its own confessional standards β€” there is no attempt to blend incompatible doctrines.
55
+
56
+ | Tradition | Primary Confessional Standards | Status |
57
+ |---|---|---|
58
+ | **Reformed / Calvinist** | Westminster Confession of Faith, Canons of Dort, Heidelberg Catechism, London Baptist Confession 1689 | πŸ”„ **v0.1 β€” first release** |
59
+ | **Lutheran** | Augsburg Confession (1530), Luther's Small & Large Catechisms, Formula of Concord | πŸ“‹ Planned |
60
+ | **Anglican / Episcopal** | Thirty-Nine Articles (1571), Book of Common Prayer | πŸ“‹ Planned |
61
+ | **Baptist (Traditional)** | Second London Confession (1689), New Hampshire Confession (1833), Baptist Faith & Message | πŸ“‹ Planned |
62
+ | **Methodist / Wesleyan** | Wesley's Articles of Religion, Methodist Discipline | πŸ“‹ Planned |
63
+ | **Pentecostal** | Assemblies of God Statement of Fundamental Truths | πŸ“‹ Planned |
64
+ | **Congregationalist** | Savoy Declaration (1658) | πŸ“‹ Planned |
65
+ | **Other Protestant** | Community contributions welcome | πŸ“‹ Open |
66
+
67
+ > **Note on tradition boundaries:** Models are labeled clearly by tradition. A Reformed model will not speak as a Lutheran, and vice versa. Where traditions share common ground (e.g. justification by faith), datasets naturally overlap. Where they diverge (e.g. baptism, Lord's Supper, church governance), each tradition's dataset reflects its own confessional position.
68
+
69
+ ---
70
+
71
+ ## Published Models
72
+
73
+ | Model | Base | Tradition | Language | CEFEAI RR | Download |
74
+ |---|---|---|---|---|---|
75
+ | `qwen3-8b-reformed-pt-br-v0.1` | Qwen3-8B | Reformed | PT-BR | πŸ”„ pending | [HF Hub](https://huggingface.co/openscriptura/qwen3-8b-reformed-pt-br-v0.1) |
76
+ | `qwen3-8b-lutheran-en-v0.1` | Qwen3-8B | Lutheran | EN | πŸ“‹ planned | β€” |
77
+ | `gpt-oss-20b-v1.0` | GPT-OSS 20B | Multi-tradition | Multilingual | πŸ“‹ planned | β€” |
78
+
79
+ Model naming convention: `openscriptura/{base}-{tradition}-{lang}-{version}`
80
+
81
+ ---
82
+
83
+ ## Repository Structure
84
+
85
+ ```
86
+ openscriptura/
87
+ β”œβ”€β”€ README.md
88
+ β”œβ”€β”€ CONTRIBUTING.md
89
+ β”œβ”€β”€ LICENSE # Apache 2.0
90
+ β”œβ”€β”€ requirements.txt
91
+ β”‚
92
+ β”œβ”€β”€ traditions/ # One folder per tradition
93
+ β”‚ β”œβ”€β”€ reformed/
94
+ β”‚ β”‚ β”œβ”€β”€ data/
95
+ β”‚ οΏ½οΏ½ β”‚ β”œβ”€β”€ tier_c/ # Native Q&A β€” catechisms
96
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ westminster_sc.jsonl
97
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ westminster_lc.jsonl
98
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ heidelberg.jsonl
99
+ β”‚ β”‚ β”‚ β”‚ └── canons_dort.jsonl
100
+ β”‚ β”‚ β”‚ β”œβ”€β”€ tier_b/ # Sermons and texts
101
+ β”‚ β”‚ β”‚ └── tier_a/ # Structured doctrinal topics
102
+ β”‚ β”‚ └── configs/
103
+ β”‚ β”‚ └── confessions.yaml # WCF, Dort, LCF references
104
+ β”‚ β”œβ”€β”€ lutheran/
105
+ β”‚ β”‚ β”œβ”€β”€ data/
106
+ β”‚ β”‚ └── configs/
107
+ β”‚ β”‚ └── confessions.yaml # Augsburg, Book of Concord
108
+ β”‚ β”œβ”€β”€ anglican/
109
+ β”‚ β”œβ”€β”€ baptist/
110
+ β”‚ β”œβ”€β”€ methodist/
111
+ β”‚ └── pentecostal/
112
+ β”‚
113
+ β”œβ”€β”€ data/
114
+ β”‚ └── processed/
115
+ β”‚ β”œβ”€β”€ reformed-pt-br-v1.0/
116
+ β”‚ β”‚ β”œβ”€β”€ train.jsonl # 4,800 examples (seed=42)
117
+ β”‚ β”‚ β”œβ”€β”€ eval.jsonl # 600 examples
118
+ β”‚ β”‚ β”œβ”€β”€ test.jsonl # 600 examples (holdout)
119
+ β”‚ β”‚ └── manifest.json # SHA-256 per split
120
+ β”‚ └── lutheran-en-v1.0/
121
+ β”‚
122
+ β”œβ”€β”€ scripts/
123
+ β”‚ β”œβ”€β”€ 00_cefeai_baseline.py
124
+ β”‚ β”œβ”€β”€ 01_extract_tier_c.py
125
+ β”‚ β”œβ”€β”€ 02_extract_tier_b.py
126
+ β”‚ β”œβ”€β”€ 03_confessional_judge.py # Tradition-aware judge
127
+ β”‚ β”œβ”€β”€ 04_merge_dataset.py
128
+ β”‚ β”œβ”€β”€ 05_train.py
129
+ β”‚ β”œβ”€β”€ 06_evaluate.py
130
+ β”‚ └── 07_cefeai_eval.py
131
+ β”‚
132
+ β”œβ”€β”€ configs/
133
+ β”‚ β”œβ”€β”€ exp_a.yaml # LR=2e-4, rank=32
134
+ β”‚ β”œβ”€β”€ exp_b.yaml # LR=2e-4, rank=64
135
+ β”‚ β”œβ”€β”€ exp_c.yaml # LR=1e-4, rank=32
136
+ β”‚ └── exp_d.yaml # LR=1e-4, rank=64 (default)
137
+ β”‚
138
+ β”œβ”€β”€ notebooks/
139
+ β”‚ β”œβ”€β”€ 01_baseline_analysis.ipynb
140
+ β”‚ β”œβ”€β”€ 02_dataset_eda.ipynb
141
+ β”‚ └── 03_results_comparison.ipynb
142
+ β”‚
143
+ └── docs/
144
+ β”œβ”€β”€ METHODOLOGY.md
145
+ β”œβ”€β”€ THEOLOGICAL_STATEMENT.md
146
+ β”œβ”€β”€ ADDING_A_TRADITION.md # Guide: how to add a new tradition
147
+ └── ADDING_A_LANGUAGE.md # Guide: how to add a new language
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Quick Start
153
+
154
+ ### Requirements
155
+
156
+ ```bash
157
+ Python 3.11+
158
+ CUDA 12.4+
159
+ GPU: RTX 4090 (24GB) minimum for experiments
160
+ A100 80GB recommended for final run
161
+ ```
162
+
163
+ ### Installation
164
+
165
+ ```bash
166
+ git clone https://github.com/openscriptura/openscriptura
167
+ cd openscriptura
168
+ pip install -r requirements.txt --break-system-packages
169
+ cp .env.example .env
170
+ # Edit .env with API keys (OpenRouter, HuggingFace)
171
+ ```
172
+
173
+ ### Run CEFEAI baseline
174
+
175
+ ```bash
176
+ # Cost: ~$0.29 | Time: ~2h
177
+ python scripts/00_cefeai_baseline.py --model qwen/qwen3-8b --benchmark rr
178
+ python scripts/00_cefeai_baseline.py --model qwen/qwen3-8b --benchmark cb
179
+ ```
180
+
181
+ ### Build the dataset (Reformed PT-BR v0.1)
182
+
183
+ ```bash
184
+ python scripts/01_extract_tier_c.py --tradition reformed
185
+ python scripts/02_extract_tier_b.py --tradition reformed --lang pt-BR
186
+ python scripts/03_confessional_judge.py --tradition reformed
187
+ python scripts/04_merge_dataset.py --tradition reformed --seed 42
188
+ ```
189
+
190
+ ### Fine-tuning
191
+
192
+ ```bash
193
+ # Free validation on Kaggle
194
+ python scripts/05_train.py --config configs/exp_d.yaml --tradition reformed --samples 500
195
+
196
+ # Full run β€” RunPod Secure A100
197
+ python scripts/05_train.py --config configs/exp_d.yaml --tradition reformed --full
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Dataset Schema (v1.0)
203
+
204
+ `tradition` and `language` are first-class fields. The same schema works for any Protestant tradition in any language:
205
+
206
+ ```json
207
+ {
208
+ "id": "os_reformed_c_wsc_001",
209
+ "instruction": "What is justification by faith alone?",
210
+ "input": "",
211
+ "output": "Justification is the forensic act by which God declares the sinner righteous...",
212
+ "source": "westminster_sc_q033",
213
+ "tier": "C",
214
+ "tradition": "reformed",
215
+ "confessional_ref": "WCF_11.1",
216
+ "language": "pt-BR",
217
+ "difficulty": "intermediate",
218
+ "annotation_model": "deepseek-v4-flash",
219
+ "validated_by": "gemini-flash-2",
220
+ "confidence": 0.94,
221
+ "confessional_score": 0.91,
222
+ "dataset_version": "v1.0",
223
+ "created_at": "2026-06-07"
224
+ }
225
+ ```
226
+
227
+ `tradition` values: `reformed` Β· `lutheran` Β· `anglican` Β· `baptist` Β· `methodist` Β· `pentecostal` Β· `congregationalist`
228
+
229
+ `language` follows BCP 47: `pt-BR` Β· `en` Β· `es` Β· `de` Β· `fr` Β· etc.
230
+
231
+ ---
232
+
233
+ ## Fine-tuning Configuration
234
+
235
+ ```yaml
236
+ # configs/exp_d.yaml β€” default (OpenMed config D)
237
+ model:
238
+ name: Qwen/Qwen3-8B
239
+ load_in_4bit: true
240
+ bnb_4bit_quant_type: nf4
241
+ bnb_4bit_use_double_quant: true
242
+
243
+ lora:
244
+ r: 64
245
+ lora_alpha: 64
246
+ lora_dropout: 0.05
247
+ target_modules: [q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj]
248
+
249
+ training:
250
+ per_device_train_batch_size: 4
251
+ gradient_accumulation_steps: 4
252
+ num_train_epochs: 3
253
+ learning_rate: 1e-4
254
+ lr_scheduler_type: cosine
255
+ warmup_ratio: 0.05
256
+ bf16: true
257
+ max_seq_length: 2048
258
+ seed: 42
259
+ ```
260
+
261
+ **Cost per model variant:** ~$11–17 total (dataset generation + fine-tuning + evaluation).
262
+
263
+ ---
264
+
265
+ ## Roadmap
266
+
267
+ ```
268
+ Phase 1 β€” Reformed Foundation
269
+ v0.1 Qwen3-8B Β· Reformed Β· PT-BR ← we are here
270
+ v0.2 GPT-OSS 20B Β· Reformed Β· PT-BR+EN
271
+ v0.3 Gemma 4 31B Β· Reformed Β· multilingual
272
+
273
+ Phase 2 β€” Tradition Expansion
274
+ v1.0 Lutheran Β· EN (Book of Concord corpus)
275
+ v1.1 Anglican Β· EN (39 Articles + BCP)
276
+ v1.2 Baptist Β· EN + PT-BR
277
+
278
+ Phase 3 β€” Community-Driven
279
+ v2.x Methodist, Pentecostal, Congregationalist
280
+ v2.x Spanish, German, indigenous languages
281
+ v3.0 Multi-tradition unified benchmark paper
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Contributing
287
+
288
+ We welcome contributions across all Protestant traditions and languages.
289
+
290
+ **New tradition:** see [`docs/ADDING_A_TRADITION.md`](docs/ADDING_A_TRADITION.md). You need: primary confessional standards, a seed corpus of at least 200 examples, and one person willing to do pastoral review.
291
+
292
+ **New language:** see [`docs/ADDING_A_LANGUAGE.md`](docs/ADDING_A_LANGUAGE.md).
293
+
294
+ **Dataset examples:** open an issue with theological Q&A in any tradition and language. Include the confessional reference.
295
+
296
+ **Doctrinal corrections:** open an issue with the problematic example and the correct reference.
297
+
298
+ **Code:** issues labeled `good first issue`.
299
+
300
+ ---
301
+
302
+ ## Citation
303
+
304
+ ```bibtex
305
+ @misc{openscriptura2026,
306
+ title = {OpenScriptura: Open LLMs for Protestant Theology},
307
+ author = {OpenScriptura Contributors},
308
+ year = {2026},
309
+ howpublished = {\url{https://github.com/openscriptura/openscriptura}},
310
+ note = {Apache 2.0. Multi-tradition, language-agnostic pipeline.
311
+ Benchmarked against CEFEAI AllFaith Benchmark.}
312
+ }
313
+ ```
314
+
315
+ ---
316
+
317
+ ## License
318
+
319
+ Apache 2.0 β€” see [`LICENSE`](LICENSE). Free use including commercial. Attribution required.
320
+
321
+ ---
322
+
323
+ <div align="center">
324
+
325
+ **Soli Deo Gloria**
326
+
327
+ *For the glory of God and the good of the Church β€” in every tradition and every language.*
328
+
329
+ [HuggingFace](https://huggingface.co/openscriptura) Β· [CEFEAI](https://cefe.ai) Β· [Issues](https://github.com/openscriptura/openscriptura/issues)
330
+
331
+ </div>