|$","",inside,flags=re.I)
+ inside=html.unescape(inside)
+ runs=re.findall(r"`+",inside);fence="`"*max(3,max((len(x)+1 for x in runs),default=3))
+ edits["html_pre_to_fenced_code"]+=1
+ preserved.append("\n\n"+fence+"\n"+inside+("\n" if not inside.endswith("\n") else "")+fence+"\n\n")
+ return f"\x00PRE{len(preserved)-1}\x00"
+ # Convert pre separately, then protect generated fences from all later formatting.
+ text=re.sub(r"([\s\S]*?)",pre,text,flags=re.I) + text=re.sub(r"
([^<>]+)
",para,text,flags=re.I) + # Keep",l,re.I): + flush() + if re.search(r"",l,re.I):out.append(plain(l,poetry,edits,allow_html)) + else:prebuffer=[l] + elif fence: + out.append(l) + if f and f.group(1)[0]==fence[0] and len(f.group(1))>=fence[1] and not f.group(2).strip():fence=None + elif math: + out.append(l) + if (math=='$$' and '$$' in l) or (math=='\\]' and '\\]' in l) or (math.startswith('\\end') and math in l):math=None + elif f: + flush();out.append(l);fence=(f.group(1)[0],len(f.group(1))) + elif l.startswith((" ","\t")): + flush();out.append(l) + elif MATH_START.match(l): + flush();out.append(l) + if '$$' in l: + if l.count('$$')<2:math='$$' + elif '\\[' in l: + if '\\]' not in l:math='\\]' + else: + env=re.search(r'\\begin\{([^}]+)\}',l) + if env and '\\end{'+env[1]+'}' not in l:math='\\end{'+env[1]+'}' + else:buffer.append(l) + flush() + if prebuffer is not None:out.append("".join(prebuffer)) + result="".join(out) + assert "\x00KEEP" not in result + return result,dict(edits) diff --git a/docs/books-markdown-processing/pipeline.py b/docs/books-markdown-processing/pipeline.py new file mode 100644 index 0000000000000000000000000000000000000000..d51a96d35370cd807220b1498c3bd6f4922f1021 --- /dev/null +++ b/docs/books-markdown-processing/pipeline.py @@ -0,0 +1,146 @@ +import os +os.environ["TOKENIZERS_PARALLELISM"]="false" +import sys +from pathlib import Path +ROOT=Path('/mnt/data/yuxu/datax-open');RUN=ROOT/'books-markdown-20261205';BUILD=ROOT/'books-build-20261205';REC=ROOT/'books-recovery' +sys.path.insert(0,str(BUILD/'vendor'));sys.path.insert(0,str(BUILD/'scripts')) +import orjson as j +import build,format_markdown as fmt +import collections,concurrent.futures,datetime,gzip,hashlib,json,re,sqlite3,shutil,fcntl +DB=None +ORPHAN=re.compile(r"(?m)^ {0,3}#{1,6} [^\n]+\n?\s*\Z") +SENTENCE=re.compile(r'[.!?。!?](?:["”’\')\]]*)[ \t]+(?=[A-Z0-9"“‘(\[])') +def now():return datetime.datetime.now(datetime.timezone.utc).isoformat() +def boundary(text,start,cap): + end=min(len(text),start+cap) + if end==len(text):return end + minimum=start+(end-start)//2;pick=None + for sep in ('\n\n','\n'): + k=text.rfind(sep,minimum,end) + if k>=minimum:pick=k+len(sep);break + if pick is None: + matches=list(SENTENCE.finditer(text,minimum,end)) + if matches:pick=matches[-1].end() + if pick is None: + for k in range(end-1,minimum-1,-1): + if text[k].isspace():pick=k+1;break + if pick is None:pick=end + while pick>start: + m=ORPHAN.search(text[start:pick]) + if not m or m.start()<512:break + pick=start+m.start() + return pick +def prepare(): + dbpath=RUN/'kept.sqlite' + if (RUN/'reports/index-ready.json').exists():return + assert not dbpath.exists(),'partial index; inspect first' + con=sqlite3.connect(dbpath) + con.execute('CREATE TABLE kept (repo TEXT,file TEXT,line INTEGER,doc TEXT,meta BLOB,PRIMARY KEY(repo,file,line)) WITHOUT ROWID') + batch=[];n=0 + with (ROOT/'docs/books-dispositions.jsonl').open('rb') as inp: + for raw in inp: + d=j.loads(raw) + if d.get('disposition')!='kept':continue + batch.append((d['source_repo'],d['source_file'],d['source_line'],d['document_id'],j.dumps(d))) + n+=1 + if len(batch)>=2000:con.executemany('INSERT INTO kept VALUES(?,?,?,?,?)',batch);con.commit();batch=[] + if batch:con.executemany('INSERT INTO kept VALUES(?,?,?,?,?)',batch);con.commit() + assert n==806309 + con.close() + (RUN/'reports/index-ready.json').write_bytes(j.dumps({'documents':n,'created_at':now()})) +def init(): + global DB + DB=sqlite3.connect(f'file:{RUN/"kept.sqlite"}?mode=ro',uri=True) + build.initialize();build.boundary=boundary +def base_meta(s,f,line,d,keep,raw,cleaned,edits): + up=d.get('metadata',{});lic,url=build.license_info(up,s['repo']) + assert lic==keep['license'] + return {k:v for k,v in { + 'document_id':keep['document_id'],'title':up.get('title') or 'Untitled', + 'source_repo':s['repo'],'source_revision':s['revision'],'source_file':f['path'],'source_line':line, + 'source_id':d.get('id'),'source_url':keep.get('source_url'),'authors':up.get('author'), + 'license':lic,'license_url':url,'license_evidence':up.get('license'), + 'license_verification':'upstream_metadata_not_independent_rights_clearance', + 'upstream_metadata':up,'upstream_source':d.get('source'),'upstream_added':d.get('added'),'upstream_created':d.get('created'), + 'raw_text_sha256':build.sha(raw.encode('utf-8')), + 'pre_markdown_text_sha256':build.sha(cleaned.encode('utf-8')), + 'cleaning':edits,'markdown_revision':fmt.VERSION, + 'quality_revision':'books_full_source_fidelity_markdown_20261205', + 'quality_status':'programmatically_formatted_not_independently_text_quality_accepted', + 'boundary_revision':'paragraph_sentence_heading_20261205' + }.items()} +def work(job): + index,s,f=job;tag=f'{index:03d}' + report=RUN/'reports'/f'{tag}.json' + if report.exists(): + r=j.loads(report.read_bytes()) + if r.get('complete'):return r + keep={ln:j.loads(meta) for ln,meta in DB.execute('SELECT line,meta FROM kept WHERE repo=? AND file=?',(s['repo'],f['path']))} + outpath=RUN/'staging'/f'{tag}.jsonl.gz' + stat={'stage':tag,'repo':s['repo'],'source_file':f['path'],'documents':0,'changed_documents':0,'slices':0, + 'tokens':0,'body_bytes':0,'text_bytes':0,'jsonl_bytes':0,'max_tokens':0,'edits':collections.Counter(), + 'license_slices':collections.Counter(),'started_at':now()} + ledger=RUN/'reports'/f'{tag}.documents.jsonl' + events=RUN/'samples'/f'{tag}.samples.jsonl' + selected=[];risk={};output_hash=hashlib.sha256() + with gzip.open(REC/f['local_path'],'rt',encoding='utf-8',errors='strict') as inp, gzip.open(outpath.with_suffix('.part'),'wb',compresslevel=1) as out,ledger.open('wb') as lg: + for lineno,line in enumerate(inp,1): + if lineno not in keep:continue + d=j.loads(line);k=keep.pop(lineno);raw=d['text'] + cleaned,cedits=build.clean(raw,s['repo']) + assert build.sha(raw.encode('utf-8'))==k['raw_text_sha256'] + assert build.sha(cleaned.encode('utf-8'))==k['cleaned_text_sha256'] + title=str(d.get('metadata',{}).get('title') or 'Untitled') + converted,edits=fmt.transform(cleaned,title) + assert bool(edits)==(converted!=cleaned),(s['repo'],lineno,'edit accounting') + meta=base_meta(s,f,lineno,d,k,raw,cleaned,cedits) + meta.update({'cleaned_text_sha256':build.sha(converted.encode('utf-8')), + 'cleaned_body_chars':len(converted),'cleaned_body_bytes':len(converted.encode('utf-8')), + 'markdown_changes':edits}) + stat['documents']+=1;stat['changed_documents']+=bool(edits);stat['edits'].update(edits) + stat['body_bytes']+=meta['cleaned_body_bytes'] + slices=tokens=0 + for sl in build.slices(converted,title): + text=sl.pop('text');m={**meta,**sl} + row={'id':f"books_en_{meta['document_id'].removeprefix('books_')}_{sl['slice_index']:05d}", + 'language':'en','meta':m,'text':text} + b=j.dumps(row)+b'\n';out.write(b);output_hash.update(b) + stat['slices']+=1;stat['tokens']+=sl['token_count'];stat['text_bytes']+=len(text.encode('utf-8')) + stat['jsonl_bytes']+=len(b);stat['max_tokens']=max(stat['max_tokens'],sl['token_count']) + stat['license_slices'][meta['license']]+=1 + slices+=1;tokens+=sl['token_count'] + lg.write(j.dumps({'document_id':meta['document_id'],'source_repo':s['repo'],'source_file':f['path'], + 'source_line':lineno,'pre_markdown_text_sha256':meta['pre_markdown_text_sha256'], + 'cleaned_text_sha256':meta['cleaned_text_sha256'],'cleaned_body_bytes':meta['cleaned_body_bytes'], + 'cleaned_body_chars':meta['cleaned_body_chars'],'markdown_changes':edits,'slices':slices,'tokens':tokens})+b'\n') + if edits: + # Deterministic hash-based sample; a separate per-rule sample catches uncommon transformations. + score=build.sha(('markdown-audit-v1:'+meta['document_id']).encode()) + candidate={'score':score,'document_id':meta['document_id'],'source_repo':s['repo'], + 'source_file':f['path'],'source_line':lineno,'title':title,'edits':edits, + 'before_chars':len(cleaned),'after_chars':len(converted)} + selected.append(candidate);selected.sort(key=lambda x:x['score']);selected=selected[:3] + for rule in edits: + if rule not in risk or score
A plain paragraph.
","## Methods"), +("list","• First item\n• Second item","- First item"), +("html_list","| Time | Value |
|---|---|
| 1 | 3 |
if x < y:\n print(x)","if x < y:"), +] +for name,text,expect in cases: + out,edits=transform(text) + assert expect in out,(name,out) + print(name,edits) +protected=[ +"```python\nCHAPTER IV\n\n
literal
\n```\n", +"$$\nx = 3 \\\\\ny=2\n$$\n", +"code literal
\n", +"| Do not infer |
Example
', '| unordered list |Example
']: + assert transform(raw)[0]==raw diff --git a/docs/books-markdown-report.json b/docs/books-markdown-report.json new file mode 100644 index 0000000000000000000000000000000000000000..c246fe02a3bdf77370ab3c073be074553ef537fb --- /dev/null +++ b/docs/books-markdown-report.json @@ -0,0 +1,875 @@ +{ + "conversion": { + "version": "conservative_markdown_v3_20261205", + "finished_at": "2026-12-05T12:34:31.583750+00:00", + "changed_documents": 68633, + "unchanged_documents": 737676, + "edits": { + "prose_hardwraps_joined": 127227766, + "plain_headings": 612979, + "unicode_bullets": 2017, + "html_emphasis": 12425, + "numbered_list_markers": 1567, + "html_paragraphs": 2 + }, + "policy": "Explicit headings, consecutive lists, simple HTML, high-confidence prose hardwraps; protect code/math/poetry/uncertain tables. No inferred missing text.", + "prior_release_tokens": 27063676982, + "prior_release_slices": 5404720, + "sample_driven_narrow_corrections": 6184, + "br_policy": "Preserved as inline HTML/possible inequality, never auto-rendered as linebreak." + }, + "sample_review": { + "review_complete": true, + "release_blockers": 0, + "reviewed_at": "2026-12-05T12:38:32.464581+00:00", + "reviewer": "assistant, source-grounded excerpt comparison", + "sample_records": 93, + "source_counts": { + "common-pile/doab_filtered": 21, + "common-pile/library_of_congress_filtered": 5, + "common-pile/libretexts_filtered": 17, + "common-pile/pre_1929_books_filtered": 6, + "common-pile/pressbooks_filtered": 19, + "common-pile/project_gutenberg_filtered": 25 + }, + "scope": "Reviewed displayed distributed diff excerpts/prefixes for all 93 fixed source records; not word-by-word full-book review. Additional HTML source contexts checked for seven samples.", + "selection": "12 hash-ranked changed + 3 hash-ranked unchanged per source where available, plus 2 examples/source/rule. Fixed seed; no resampling to pass.", + "same_fixed_sample_regression": true, + "automated_checks": "All 93 regenerated Markdown hashes match candidate records; non-HTML transformations preserve normalized letters/digits.", + "initial_findings_preserved": true, + "repairs": [ + "Preserve instructional HTML code", + "Stop BR conversion to preserve medical comparisons", + "Reject ambiguous/lowercase/TOC headings", + "Protect pipe tables from list normalization", + "Protect epic/drama hardwraps", + "Only horizontal whitespace in list-marker recognition" + ], + "v3_affected_records": 6184, + "outcome": "No remaining blocking formatting regression observed in reviewed excerpts; not full-corpus semantic or legal acceptance.", + "remaining_limitations": [ + "Implicit headings and original paragraph boundaries not always recoverable", + "Complex/OCR-flattened tables not reconstructed", + "Some HTML intentionally retained", + "Original OCR and caption boilerplate may remain", + "Multilingual quoted/teaching content may remain" + ], + "details": [ + { + "id": "books_0ec4b879750d3941f84abcb301358a2d", + "repo": "common-pile/doab_filtered", + "title": "Frontiers in Staphylococcus aureus", + "edits": { + "html_emphasis": 5 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_129f5008dc55226260d692ff90ce75ac", + "repo": "common-pile/doab_filtered", + "title": "Testing of Materials and Elements in Civil Engineering", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_16f985893ec2de32a5f90b2d5d5c02c8", + "repo": "common-pile/doab_filtered", + "title": "Design, Simulation and Construction of Field Effect Transistors", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_31d7d324af0dd4581dfea28ee44cb58f", + "repo": "common-pile/doab_filtered", + "title": "Social Responsibility", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_52fe437cc8cb119e92d2e94f4213d5a8", + "repo": "common-pile/doab_filtered", + "title": "The Fifth Generation (5G) of Wireless Communication", + "edits": { + "plain_headings": 6 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_7114b5aa3b1f4676668d99fba7b3625e", + "repo": "common-pile/doab_filtered", + "title": "Spectroscopic, Thermodynamic and Molecular Docking Studies on Molecular Mechanisms of Drug Binding to Proteins", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_711a70168ded4e8c09c2ccdf614a63bf", + "repo": "common-pile/doab_filtered", + "title": "Medical Robotics", + "edits": { + "plain_headings": 4 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_7380ed26e7357526a2a81206f54ca0c0", + "repo": "common-pile/doab_filtered", + "title": "A Guide to Small-Scale Energy Harvesting Techniques", + "edits": { + "plain_headings": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_738aef16cf911aa89a7ccca125bf10e6", + "repo": "common-pile/doab_filtered", + "title": "Pharmacognosy", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_7641b561548a67e7572cbbee0133f008", + "repo": "common-pile/doab_filtered", + "title": "Neonatal Bacterial Infection", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_871a641a814f987eb0798a354ac95f31", + "repo": "common-pile/doab_filtered", + "title": "Pharmacokinetics and Adverse Effects of Drugs", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_8ace5706f9d2214aae0378d4f53fdfb4", + "repo": "common-pile/doab_filtered", + "title": "Current Perspectives in HIV Infection", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_b1034d3fd5d2c0effac98b47dbca861f", + "repo": "common-pile/doab_filtered", + "title": "Laser Pulses", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_c2ae7b0cbfb77762cfe2b12c211ea97d", + "repo": "common-pile/doab_filtered", + "title": "Advanced Image Acquisition, Processing Techniques and Applications", + "edits": { + "plain_headings": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_c86e67d4101515387b3d35a3f3858c13", + "repo": "common-pile/doab_filtered", + "title": "Topological Soft Matter", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_cdc6f281332c87ed83b162d3e0178b6f", + "repo": "common-pile/doab_filtered", + "title": "Stochastic Modeling and Control", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_d4d03d9ed7d47380eabcadbb4bddc534", + "repo": "common-pile/doab_filtered", + "title": "Innate Immunity in Health and Disease", + "edits": { + "html_emphasis": 2, + "plain_headings": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_d50f6bbc5d8eb0a5630b06dae708f41c", + "repo": "common-pile/doab_filtered", + "title": "RoCKIn", + "edits": { + "plain_headings": 1, + "unicode_bullets": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_dc48904788b8a59f51833e97efdadd2c", + "repo": "common-pile/doab_filtered", + "title": "Machine Learning", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_f0c5e81c5bf37bc0b092728ded317027", + "repo": "common-pile/doab_filtered", + "title": "Advanced Biodiesel", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_f1cfbb8305ddc0ecaad43d612a2cb3b9", + "repo": "common-pile/doab_filtered", + "title": "Advances in Candida albicans", + "edits": { + "unicode_bullets": 6 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_261e22ab5d518de9901eaab43fa1a8c8", + "repo": "common-pile/library_of_congress_filtered", + "title": "Rhythmic action plays and dances; a book of original games and dances, arranged progressively, to Mother Goose and other action songs, with a teaching introductory; for the kindergarten, primary schools, playground and gymnasium", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_3f2bd8497dc0c1156d66f821208b8b90", + "repo": "common-pile/library_of_congress_filtered", + "title": "The building code of the city of Seattle and other data useful to architects and builders.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_a52a38371699a96094f8cd2d16991639", + "repo": "common-pile/library_of_congress_filtered", + "title": "Charter and by-laws, with lists of officers and members.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_c541165fd6436f194e54fddcf6c43344", + "repo": "common-pile/library_of_congress_filtered", + "title": "Airedale breeders' hand book.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_f025c64c651369f915247794f340c3ff", + "repo": "common-pile/library_of_congress_filtered", + "title": "Summary of tariff information, 1921, relative to the bill H.R. 7456.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_164a37e1aa2337f6cc6ffb52438e07d5", + "repo": "common-pile/libretexts_filtered", + "title": "4: Body Composition and Obesity", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_2e33b751b275cb5cd5b3e8a416c8436b", + "repo": "common-pile/libretexts_filtered", + "title": "1.3: The Epic of Gilgamesh", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_39e4d8d5a5a5b7ace26544e003c9ea54", + "repo": "common-pile/libretexts_filtered", + "title": "10.2: Mindfulness Practice", + "edits": { + "numbered_list_markers": 4 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_610a565f22fd7ce5f625da8fe9484f83", + "repo": "common-pile/libretexts_filtered", + "title": "8.12: Question and Answer Period", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_6314836f9a10316768d12a685c5884a9", + "repo": "common-pile/libretexts_filtered", + "title": "32.4: Other Drugs, Supplements, and Herbal Remedies", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_7cf579717438c19ae2cef7dfdaa35a84", + "repo": "common-pile/libretexts_filtered", + "title": "3.7: Self-Test #1", + "edits": { + "numbered_list_markers": 6 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_8c1aa07d8a4cdf30dd737a4801621918", + "repo": "common-pile/libretexts_filtered", + "title": "10.4.9.3: Behavioral Community Approaches", + "edits": { + "numbered_list_markers": 10 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_93c3ec60310de8c655edb3d6067ab45e", + "repo": "common-pile/libretexts_filtered", + "title": "2.1: Introduction", + "edits": { + "numbered_list_markers": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_986801d1eb7afbf589066196b04ed2f3", + "repo": "common-pile/libretexts_filtered", + "title": "1.5: CHAPTER 4 AQUINAS’S NATURAL LAW THEORY", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_ab2b385abca2427c27c573e86683d8e7", + "repo": "common-pile/libretexts_filtered", + "title": "3.4: Vocabulario- Adjetivos descriptivos", + "edits": { + "html_emphasis": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_b6ebcbb3830b5e38ae7a0aa9af917d58", + "repo": "common-pile/libretexts_filtered", + "title": "2.3: Lab Report", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_c1532548c6a99855ba267a28667fe71a", + "repo": "common-pile/libretexts_filtered", + "title": "5.2: Meteorological Hazards", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_c5ef9fd3122e6b14b57a35f412179bda", + "repo": "common-pile/libretexts_filtered", + "title": "Module 2 – Introduction to the Patient", + "edits": { + "numbered_list_markers": 13 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_c6e826d4a05766d2e51cfb9375045d26", + "repo": "common-pile/libretexts_filtered", + "title": "2.9: Aromatic Heterocycles - Pyridine and Pyrrole", + "edits": { + "numbered_list_markers": 4 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_d84dc167627e74434f2433047bf665eb", + "repo": "common-pile/libretexts_filtered", + "title": "1.3: Arabic's Influence in the Region", + "edits": { + "unicode_bullets": 3 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_fb15ed36b73723549fcfcde5433d8823", + "repo": "common-pile/libretexts_filtered", + "title": "26.4: Benito Cereno", + "edits": { + "prose_hardwraps_joined": 1531 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_fb2d58660d9d786c85764bab181062d2", + "repo": "common-pile/libretexts_filtered", + "title": "1.28: Introduction to Cultura- Los hispanos en los Estados Unidos", + "edits": { + "unicode_bullets": 4 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_1e5fa1040b94175bf62d876bbd0a5009", + "repo": "common-pile/pre_1929_books_filtered", + "title": "The life of James McNeill Whistler, by E. R. and J. Pennell.", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_5828a7e9ea7873d18ddd82287947ae1b", + "repo": "common-pile/pre_1929_books_filtered", + "title": "Outlines of astronomy by Sir John F.W. Herschel.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_69eda901b695cee7b7aa3ee18059f2cf", + "repo": "common-pile/pre_1929_books_filtered", + "title": "Washoe revisited.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_c699dee623f089f12981e97c593a1fc3", + "repo": "common-pile/pre_1929_books_filtered", + "title": "Elements of the English language, or, Analytical orthography : intended to teach the philosophy of orthography and orthoepy : adapted to schools / by Albert D. Wright.", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_d8b8375bf8e3364cc6f30f0611b823c6", + "repo": "common-pile/pre_1929_books_filtered", + "title": "The church in the Roman empire before A.D. 170. By W.M. Ramsay ...", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_e4401ab0cea2cf7d72bb96595b304305", + "repo": "common-pile/pre_1929_books_filtered", + "title": "Rhythmic action plays and dances; a book of original games and dances, arranged progressively, to Mother Goose and other action songs, with a teaching introductory; for the kindergarten, primary schools, playground and gymnasium [by] Irene E. Phillips Moses ...", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_041c855a303e948de073a6f21331f45f", + "repo": "common-pile/pressbooks_filtered", + "title": "OER by Discipline Guide: University of Ottawa (Version 2.0 - June 2022)", + "edits": { + "unicode_bullets": 4 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_17802a84764be0273785c1ef26a1a9b0", + "repo": "common-pile/pressbooks_filtered", + "title": "English Literature: Victorians and Moderns", + "edits": { + "prose_hardwraps_joined": 2142 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_237352828a465cb86f6a0df0368a6e80", + "repo": "common-pile/pressbooks_filtered", + "title": "88 Open Essays - A Reader for Students of Composition & Rhetoric", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_2a97f45badcaec93864ec26fbff893e3", + "repo": "common-pile/pressbooks_filtered", + "title": "Introduction to Ethics", + "edits": { + "prose_hardwraps_joined": 16 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_2ae9df2cc753275fa923de107a5c9872", + "repo": "common-pile/pressbooks_filtered", + "title": "Oregon Writes Open Writing Text", + "edits": { + "unicode_bullets": 7 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_438b80deecb28f72351600c2a147ff05", + "repo": "common-pile/pressbooks_filtered", + "title": "University 101: Study, Strategize and Succeed", + "edits": { + "numbered_list_markers": 5 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_4589f1229b1f68812a2a794b150c1c81", + "repo": "common-pile/pressbooks_filtered", + "title": "The Meaning of Love", + "edits": { + "numbered_list_markers": 3 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_46ee3ec5e6a6f5afc2e42938d3e8159d", + "repo": "common-pile/pressbooks_filtered", + "title": "Oral & Maxillofacial Surgery - A Handbook for Certified Dental Assistants", + "edits": { + "unicode_bullets": 9 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_47c9cd164d74f0284d96a6edfdaeef4d", + "repo": "common-pile/pressbooks_filtered", + "title": "American History from Reconstruction to the Present", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_49a5b73a3e0d7fd0257199dc799f3e12", + "repo": "common-pile/pressbooks_filtered", + "title": "Wellness", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_4ea009935eae3dfefddd11b660b17b5f", + "repo": "common-pile/pressbooks_filtered", + "title": "Wellness", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_5f59e3213f9bac8deaa668db480373fc", + "repo": "common-pile/pressbooks_filtered", + "title": "Drink, Swear, Steal, and Lie: Leadership in Four Easy Steps", + "edits": { + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_6c639f86481e47dc8aedbda75620dda2", + "repo": "common-pile/pressbooks_filtered", + "title": "University Academic Writing for International Students: A Usage-based Approach", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_7b7d92e970cd6c4a572b85ecab33096d", + "repo": "common-pile/pressbooks_filtered", + "title": "My Franconia, Bavaria Relatives", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_7f00b48e7f1d4ae65fe1d2aceefb0de0", + "repo": "common-pile/pressbooks_filtered", + "title": "Vanguard: Exercises for the Creative Writing Classroom", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_9cc9101a6df35b3fd7fbf72c2b09131c", + "repo": "common-pile/pressbooks_filtered", + "title": "Exploring Physical Phenomena", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_c17af4427965e12dd61f94f7d2a60fd9", + "repo": "common-pile/pressbooks_filtered", + "title": "Operations Management", + "edits": { + "numbered_list_markers": 8 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_c81b42ad5f01eb4b93277ce5a40721ea", + "repo": "common-pile/pressbooks_filtered", + "title": "Women’s voices in tourism research", + "edits": { + "numbered_list_markers": 6 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_d5a626c71a9d66cc6ea61384b3bc3900", + "repo": "common-pile/pressbooks_filtered", + "title": "Health Assessment Guide for Nurses", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_12d78a0d18d68b72a9f66c4d5eb41e1d", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Conquest of the Old Southwest; the romantic story of the early pioneers into Virginia, the Carolinas, Tennessee, and Kentucky, 1740-1790", + "edits": { + "plain_headings": 36, + "prose_hardwraps_joined": 3683, + "unicode_bullets": 40 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_32a6b4c1bafd23ca62847febc1b41da3", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Webster's Unabridged Dictionary", + "edits": { + "prose_hardwraps_joined": 15971 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_3bdcc3722cbf82e39d00c902d28229bf", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Student's Elements of Geology", + "edits": { + "plain_headings": 5, + "prose_hardwraps_joined": 12540, + "html_emphasis": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_48a646c01949129172a6df20c38265b6", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Special Delivery", + "edits": { + "prose_hardwraps_joined": 14 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_49e54581b1e0c115ee341ab6be1eeb5a", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Abergeldie Winter Book", + "edits": { + "prose_hardwraps_joined": 36 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_4b1836571e348d54b6ac7f49bdb3b088", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Letters from a Landscape Painter", + "edits": { + "prose_hardwraps_joined": 3258 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_4c2f47df9bfc23249aaddbd7df9e89f8", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Seven Plays in English Verse", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_52af63a56ac029624b189ef4e8fcbf7e", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Real Tsaritsa", + "edits": { + "html_paragraphs": 1, + "plain_headings": 12, + "prose_hardwraps_joined": 2334 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_5b0659d16b77526f794c32c0cdb3aef7", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Genealogy of Morals\nThe Complete Works, Volume Thirteen, edited by Dr. Oscar Levy.", + "edits": { + "prose_hardwraps_joined": 3850, + "plain_headings": 2, + "html_emphasis": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_653a5cb459187d2e467fa2d1e1be80cf", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The story of the Thirty-Third N. Y. S. Vols\r\nor two years campaigning in Virginia and Maryland", + "edits": { + "plain_headings": 38, + "prose_hardwraps_joined": 3344 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_7135b6c5a5b676e14ab41b6b1d7c7e60", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Aggravation of Elmer", + "edits": { + "prose_hardwraps_joined": 12 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_7b37fed176d6b2a07567c3f0d757cc63", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Physical Basis of Mind\r\nBeing the Second Series of Problems of Life and Mind.", + "edits": { + "plain_headings": 50, + "prose_hardwraps_joined": 3256 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_8284d569fe5198a118716a98982e6ce6", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Mountain Girl", + "edits": { + "plain_headings": 32, + "prose_hardwraps_joined": 3185 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_9d77a9faef6a131ef5fbce98063b8b7d", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Man from Mars: His Morals, Politics and Religion", + "edits": { + "prose_hardwraps_joined": 4232, + "plain_headings": 15 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_a12c3eee4537afc27d663bf3dc11ae5c", + "repo": "common-pile/project_gutenberg_filtered", + "title": "With a Camera in Majorca", + "edits": { + "unicode_bullets": 5, + "prose_hardwraps_joined": 2474 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_a24c82b3159f7a721fa84787a3133c7b", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Language: Its Nature, Development and Origin", + "edits": { + "plain_headings": 23, + "prose_hardwraps_joined": 9667, + "numbered_list_markers": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_b4a63c991d06fabdaa02a261365f1b57", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Maiden Mona the Mermaid: A Fairy Play for Fairy People", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_b6ae906273d59af4e99318bccc6eb19c", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Memoirs of an American Prima Donna", + "edits": { + "plain_headings": 35, + "prose_hardwraps_joined": 4792, + "html_paragraphs": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_c2ed47797ce5de243d6402283352a6f4", + "repo": "common-pile/project_gutenberg_filtered", + "title": "King's Cutters and Smugglers 1700-1855", + "edits": { + "plain_headings": 31, + "prose_hardwraps_joined": 5973 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_d3c7dd350393aa97683acaa841b2ec4f", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Brownie Scouts at Windmill Farm", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + }, + { + "id": "books_d7f8d29930b8e66bc512f461215790b9", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Theodore Roosevelt", + "edits": { + "plain_headings": 16, + "prose_hardwraps_joined": 1316 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_d86ce2c8cff543da014fc30691305b22", + "repo": "common-pile/project_gutenberg_filtered", + "title": "The Escorial\r\nA Historical and Descriptive Account of the Spanish Royal Palace, Monastery and Mausoleum", + "edits": { + "plain_headings": 4, + "prose_hardwraps_joined": 775 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_e343c27ea79fc2ffe9303213e1cd305f", + "repo": "common-pile/project_gutenberg_filtered", + "title": "From October to Brest-Litovsk", + "edits": { + "prose_hardwraps_joined": 2112, + "plain_headings": 1 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_e9d8486df5bd23370f673e9727b8985e", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Sources of the Synoptic Gospels", + "edits": { + "plain_headings": 30, + "prose_hardwraps_joined": 2832, + "numbered_list_markers": 2 + }, + "review": "excerpt_checked_no_remaining_blocker" + }, + { + "id": "books_f7ceada6b7f6c429e433c7700ba819c8", + "repo": "common-pile/project_gutenberg_filtered", + "title": "Little Dramas for Primary Grades", + "edits": {}, + "review": "unchanged_or_rolled_back_hash_confirmed" + } + ] + }, + "tokenizer": { + "repo": "Qwen/Qwen2.5-7B", + "revision": "d149729398750b98c0af14eb82c78cfe92750796", + "tokenizer_sha256": "c0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539", + "published_books_tokenizer_sha256": "c0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539", + "matches_published_books_tokenizer": true + }, + "technical_counts": { + "token_recounts": 3361, + "slices": 5405271, + "internal_boundaries": 4598962, + "paragraph": 4584032, + "document_end": 806309, + "line": 14860, + "fence_wrapped_boundary": 2429, + "sentence_space": 66, + "whitespace_inside_paragraph": 4 + }, + "preservation": "Same source document set and original raw hashes. pre_markdown_text_sha256 records pre-format body; cleaned_text_sha256 describes new Markdown body." +} \ No newline at end of file diff --git a/docs/books-markdown-script-hashes.json b/docs/books-markdown-script-hashes.json new file mode 100644 index 0000000000000000000000000000000000000000..87cb6d6ed1b0a2a8d6c2fe1a36a6a4dc611e4a97 --- /dev/null +++ b/docs/books-markdown-script-hashes.json @@ -0,0 +1,13 @@ +{ + "apply_fixes.py": "b5afaeeb11379998115bf303a93edb7f4c625ec5ff936d4fbec2828f6e088c66", + "fix_records.py": "db9686644dea22581a3d742bdd12e6e5e0fdd6577466946a36f7482589dc6a00", + "format_markdown.py": "f62d5af3cff3c69f852d4d0abdd965911e1fe1569e3085f58eb0244dbf056be8", + "format_markdown_v2.py": "ca2200ee3a935ef711cd7f35ce3e5ef44077477a1e040cb3d4fc475964785824", + "install.py": "db39423773c662989b68010b78f597b0678faae902e6ab433d60813a7cea8cb9", + "package.py": "89e22ad3bf23b148e5db37bf1d898e9019e91465cf7e576c48ed5c23e0ef3855", + "pipeline.py": "62c92f0100e56dc1c251639f9447e38e960b4aa08a12bd57519d602e5a58307c", + "sample_audit.py": "3c78e09330c6d4b6df9efcb34f7807e5eca9c26b3929a1e204ddbd1df8d1b329", + "sample_regression.py": "eef7d08879739a9c6d20cda59ed8067dfdcf92e16031f7fef8c6b1393a2a9336", + "test_format.py": "83accf013c5fd0b77ee87b043bce92dea6885264bfd89079102330551d470d08", + "validate.py": "c807cf488470a05c63b9c46f54b1803999ba075ab6d39f67f393c0c2145550b9" +} \ No newline at end of file diff --git a/docs/books-prepublish-validation.json b/docs/books-prepublish-validation.json new file mode 100644 index 0000000000000000000000000000000000000000..1982c4fcf447e27dbb6249c3ba6b429de9e6c7c6 --- /dev/null +++ b/docs/books-prepublish-validation.json @@ -0,0 +1,62 @@ +{ + "checked_at": "2026-12-05T12:47:20.853287+00:00", + "jsonl_validation": { + "checked_at": "2026-12-05T12:45:29.714595+00:00", + "passed": true, + "file_count": 640, + "slices": 5405271, + "documents": 806309, + "tokens": 26911243820, + "counts": { + "independent_token_recounts": 4445, + "slices_with_math_marker": 408411, + "upstream_replacement_character_slices": 21531 + }, + "checks": [ + "strict UTF-8", + "one JSON object per line", + "exact top-level schema and field types", + "required source/license/hash metadata", + "SHA256 and file sizes", + "unique derived IDs", + "contiguous within/across-shard document spans", + "stored token limits and independent recount sample" + ], + "limitations": "Not full token re-count or semantic/medical/scientific correctness assessment. Original OCR corruption disclosed." + }, + "formula_preservation": { + "checked_at": "2026-12-05T12:46:36.151361+00:00", + "sample_documents": 56, + "source_counts": { + "common-pile/project_gutenberg_filtered": 10, + "common-pile/libretexts_filtered": 6, + "common-pile/pressbooks_filtered": 10, + "common-pile/doab_filtered": 10, + "common-pile/library_of_congress_filtered": 10, + "common-pile/pre_1929_books_filtered": 10 + }, + "passed": true, + "preserved_span_counts": { + "latex_inline_parentheses": 110, + "latex_display_brackets": 7, + "latex_double_dollar": 1809, + "latex_commands": 33981, + "html_sup_sub": 13846, + "unicode_math_symbols": 4110 + }, + "scope": "Targeted source-to-current-body comparison. LaTeX spans/command sequence, HTML sub/sup and Unicode mathematical-symbol sequence. Not correctness verification or proof of complete original formulas." + }, + "formula_policy": "Retain existing LaTeX and original Unicode/subscript/superscript representations. No speculative reconstruction of missing OCR formula content.", + "formula_matching_caveat": "Delimiter matches are candidate spans, not verified complete or correct mathematical equations; OCR can resemble LaTeX delimiters.", + "release_recommendation": "Technically ready as source-fidelity Markdown corpus with disclosed limitations, not guaranteed-error-free high-quality full-book text.", + "known_limits": [ + "Upstream OCR and layout errors can remain", + "21531 slices contain preserved upstream replacement characters", + "Some source tables/formulas were already flattened or incomplete", + "Only limited formatting/formula samples reviewed", + "Existing metadata-based licensing is not independent rights clearance" + ], + "sha256sums_sorted": true, + "books_files": 640, + "nonbooks_sha_entries_unchanged": 328 +} \ No newline at end of file diff --git a/docs/books-preview-20261030/LICENSE.md b/docs/books-preview-20261030/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..1cf30e9ff5cba1c1ab99b0e372f58b057ddf212b --- /dev/null +++ b/docs/books-preview-20261030/LICENSE.md @@ -0,0 +1,209 @@ +# License and attribution + +This is a multi-source collection, **not one uniformly licensed text corpus**. +The dataset-card license list is an inventory, not a choice of alternative +licenses for every record. The underlying rights holders retain their rights. +The existing `wiki/` collection retains the Wikipedia terms below. +`periodicals/` is governed by each article's actual license/version and +provenance in `meta`. No blanket MIT, CC0, or ShareAlike license is imposed on +all source text. + +## Wikipedia-derived text + +Copyright in the source articles remains with Wikipedia contributors and, where +applicable, other rights holders. Wikipedia text is generally made available under +the **Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)** +license: + +- License summary: https://creativecommons.org/licenses/by-sa/4.0/ +- Controlling legal text: https://creativecommons.org/licenses/by-sa/4.0/legalcode +- Wikimedia dump licensing: https://dumps.wikimedia.org/legal.html +- Wikimedia Terms of Use: https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use + +Some source text may additionally be available under the GNU Free Documentation +License or other terms. Third-party quotations, fair-use materials, and other +exceptions can carry different restrictions. The source article and applicable +rights-holder terms control; the repository metadata is not a blanket relicensing +of all included material. **The article text is not offered under MIT.** + +## Wikipedia attribution and modifications + +Each record preserves its original title, source dump filename, page/revision IDs +and permanent Wikipedia revision URL in `meta`. Retain these attribution pointers +and relevant license notices. The linked revision and article history provide a +route to the source and contributor history. + +This release has been modified from the raw XML: text extraction; Chinese script +conversion; Markdown conversion; removal of images, navigation and reference +machinery; quality filtering and isolation of unsupported material; deduplication; +limited source-grounded typo/format corrections; and length-based slicing. +It is not an official Wikimedia release and is not endorsed by Wikimedia. + +When sharing adapted material, comply with the license's attribution, +indication-of-changes, and ShareAlike requirements as applicable. This repository +does not impose further restrictions on rights granted by the applicable licenses. + + +## Periodicals-derived text (`periodicals/`) + +The first batch `20261020_v6` has this observed article-license inventory. +Counts are **training slices**, not independent works: + +| Article license | Slices | Official legal terms | Included copy | +| --- | ---: | --- | --- | +| CC BY 2.5 Generic | 616 | https://creativecommons.org/licenses/by/2.5/legalcode | [CC-BY-2.5](licenses/CC-BY-2.5.html) | +| CC BY 4.0 International | 378,044 | https://creativecommons.org/licenses/by/4.0/legalcode | [CC-BY-4.0](licenses/CC-BY-4.0.txt) | +| CC0 1.0 Universal | 3,149 | https://creativecommons.org/publicdomain/zero/1.0/legalcode | [CC0-1.0](licenses/CC0-1.0.txt) | + +This describes this batch, not every future periodicals addition. This batch +contains no CC BY-SA periodicals records. Wikipedia and future records can +carry ShareAlike obligations; article-specific terms always control. + +### Attribution, rights and provenance + +Sources are Common Pile `pubmed` and `news_filtered`, and Chinese/English +Wikinews. Copyright remains with the authors/contributors and relevant rights +holders, except to the extent waived/dedicated under the applicable instrument. + +Each record retains `meta.source_repo`, `source_revision`, `source_file`, +`source_url`, `authors`, `license`, `license_url`, `license_evidence` and +`license_verification`. For Wikinews, the permanent source revision URL and +its contributor history provide an attribution route. Keep these notices and +provenance pointers with redistributed text. + +- Under CC BY, provide attribution and notices required by the applicable + version, preserve a license reference/link, and identify modifications. +- CC0 dedicates/waives copyright and related rights to the extent permitted; + its limitations and fallback provisions apply. Preserving provenance is good + practice; this repository does not invent an additional legal attribution + condition for material actually covered by CC0. +- If a future record uses CC BY-SA or another license, comply with its actual + attribution, adaptation and ShareAlike terms as applicable. Mixed licensing + is not permission to choose whichever license is least restrictive. +- Merely being downloadable or labelled "open access" is not permission to + redistribute. This batch uses explicit article-license metadata; PMC license + type is additionally matched through Europe PMC. +- Third-party excerpts and rights not covered by these instruments, including + privacy, publicity and trademarks, may have separate conditions. Source + notices and exceptions control. No independent full legal clearance of + every item is claimed; the repository grants no rights it does not hold. + +### Modifications + +Processing includes text/structure extraction to Markdown, Chinese script +normalization, filtering of unsupported or damaged content and site boilerplate, +recorded date/quality selection, deduplication, and length-bounded slicing. +Source citation identifiers may be retained where required for coherent prose. +Two article titles had deterministic opening-quote typography normalization; +original titles and the change evidence remain in metadata. Source/body hashes, +`meta.cleaning`, `meta.quality_revision` and slice spans preserve change history. +Not all original tables, references, images or other objects survive. + +Packaging adds a batch date/version to the JSONL filenames. Record IDs, text +and original source-attribution metadata are not rewritten for upload. +This is not an official release or endorsement by Wikimedia, Common Pile, +PMC, Europe PMC, or the publishers. + +### Future extensions + +Record new sources and licenses per article and per batch. Use new batch file +names, preserve old manifests and file hashes, and update the root SHA256SUMS +in relative-path lexicographic order. New licenses require appropriate notices +and terms; the current inventory does not authorize future sources automatically. +Do not erase attribution or license notices when adding or redistributing data. + +## No warranty + +The data may contain factual errors, bias, sensitive content and processing +artifacts. No guarantee of completeness, accuracy, absence of third-party rights, +or suitability for a particular use is provided. Users are responsible for +assessing the applicable terms and legal requirements for their own training, +redistribution and deployment activities. + +This file is a summary and notice, not a substitute for the controlling licenses. + +## Periodicals final update: 20261025_final (published 2026-10-26) + +The first-batch table above remains historical. This is the combined final inventory, counting training slices, not independent works: + +| Actual article license | Slices | Controlling terms | +| --- | ---: | --- | +| CC-BY-2.5 | 616 | https://creativecommons.org/licenses/by/2.5/legalcode | +| CC-BY-3.0 | 158 | https://creativecommons.org/licenses/by/3.0/legalcode | +| CC-BY-3.0-IGO | 297 | https://creativecommons.org/licenses/by/3.0/igo/legalcode | +| CC-BY-4.0 | 1,085,289 | https://creativecommons.org/licenses/by/4.0/legalcode | +| CC0-1.0 | 5,360 | https://creativecommons.org/publicdomain/zero/1.0/legalcode | + +The 20GB increment comes from official PMC OA S3 JATS XML; Europe PMC assists metadata verification. +Only explicitly permitted article licenses are admitted, not every PMC article and not merely an "open access" label. +No NC/ND/unknown license is admitted by this pipeline. Retain precise license versions, authors, source URLs, +license evidence and notices, and the recorded modifications in each record. + +CC BY 3.0 IGO is a separate intergovernmental-organization license: do not replace its identifier or URL +with generic CC BY 3.0. Its attribution, dispute-resolution and privileges/immunities provisions and +all other applicable terms control. Official unchanged copies: [CC BY 3.0](licenses/CC-BY-3.0.html) +and [CC BY 3.0 IGO](licenses/CC-BY-3.0-IGO.html). + +Additional processing includes source-evidenced corrections of specific prose/table transcriptions, +preservation of material formula/code, deduplication, slicing and documented article quarantine. +Upload changes only shard filenames, not stored records or source attribution. +Third-party rights, personal rights and original-source exceptions still apply; neither source retrieval +nor automated licensing checks are a full legal clearance. The collection is not uniformly relicensed. + +## Packaging-only layout update: 20261026_layout + +English shards were renamed to sequential language/index filenames. Four Chinese JSONL shards were concatenated in original order and gzip-compressed into one file. Record IDs, text, metadata, author/source attribution and license inventories were not changed. Historical manifests remain available at their original commits. No new rights are granted by this packaging change. + +## Packaging correction: 20261026_plain_jsonl + +The Chinese gzip wrapper described in the historical note above has been removed from the current release. Chinese records remain merged in one uncompressed UTF-8 file, periodicals_zh_00000.jsonl. All154English files are unchanged. Record content, order, attribution and license inventories are unchanged. All current training files are plain JSONL; historical layouts remain available in their commits. + + + +## Books preview: 20261030 + +`books/` is a **quality-disclosed preview**, derived from the pinned Common Pile filtered +Project Gutenberg, LibreTexts and PressBooks sources. It is not a uniformly licensed corpus. +The license list below is an inventory, not alternative permissions for each record. + +| Record license/status | Training slices | +| --- | ---: | +| CC-BY-3.0 | 519 | +| CC-BY-4.0 | 36,190 | +| CC-BY-SA-2.5 | 1 | +| CC-BY-SA-3.0 | 392 | +| CC-BY-SA-4.0 | 10,053 | +| CC0-1.0 | 1,517 | +| Public-Domain-US | 462,633 | + +- **CC BY / CC BY-SA:** comply with the exact version linked in each record, including attribution, + license notices, indication of modifications and ShareAlike where applicable. Author/contributor, + title, source URL and upstream license evidence are retained in `meta`. Do not replace 2.5 or 3.0 + identifiers with 4.0 without the applicable authority. Added copies are indexed in `licenses/README.md`. +- **CC0:** applies only to records actually covered by the instrument, subject to its limitations. +- **Public-Domain-US:** a source-specific U.S. copyright-status claim, **not a CC0 dedication, + not worldwide public-domain clearance, and not a grant of rights by this repository**. + Project Gutenberg's permissions guidance: https://www.gutenberg.org/policy/permission.html . + Users must assess status in their applicable jurisdictions and any special rights. +- Source metadata and book notices control. Third-party quotations, figures, translations and + other rights can differ from a collection or page-level label. Automated checks and source metadata + are not independent full legal clearance, and neither this repository nor an upstream aggregator + can grant rights they do not hold. +- Only the already-filtered current batch is published. DOAB, Library of Congress and pre-1929 + candidates from the local processing pool are not included in this upload. + +Processing includes strict UTF-8 reading, conservative cleaning, original-text-supported +format restoration, Markdown formatting and escaping of historical layout markers, +exclusion of unsupported material, document deduplication and non-overlapping token-bounded slicing. +No missing book prose, author identities or scientific quantities were generated to fill gaps. +Raw source identification, body hashes and modification notices remain in the records. +Some audit pointers name **local-only files**; they are not downloadable artifacts in this repository +and are not substitutes for the original public source URL. Public processing and quality summaries +are supplied in `docs/`, without internal API transcripts or private-server credentials. + +Three training records whose complete cleaned bodies are literal substrings of retained +collection records were removed. Their distinct provenance and attribution are retained in +[docs/books-contained-attribution.json](docs/books-contained-attribution.json). +This is not an official release or endorsement by Project Gutenberg, LibreTexts, PressBooks, +Common Pile or the underlying authors/publishers. No warranty of textual or factual correctness +or complete legal clearance is made. See [docs/books-quality.md](docs/books-quality.md). diff --git a/docs/books-preview-20261030/README.md b/docs/books-preview-20261030/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2a88b709de6b1cf0eec335a20f9d1fcb99ada25d --- /dev/null +++ b/docs/books-preview-20261030/README.md @@ -0,0 +1,134 @@ +--- +language: +- zh +- en +license: +- cc-by-sa-4.0 +- cc-by-2.5 +- cc-by-4.0 +- cc0-1.0 +- cc-by-3.0 +- other +- cc-by-sa-3.0 +task_categories: +- text-generation +pretty_name: DataX Open — Wikipedia, Periodicals & Books +size_categories: +- 1M