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... (all languages present in the Arch Wiki)
|
| 14 |
+
pretty_name: Arch Wiki - Complete Offline Dump
|
| 15 |
+
size_categories:
|
| 16 |
+
- 100K-1M
|
| 17 |
+
task_categories:
|
| 18 |
+
- document-retrieval
|
| 19 |
+
- question-answering
|
| 20 |
+
- text-generation
|
| 21 |
+
tags:
|
| 22 |
+
- arch-linux
|
| 23 |
+
- wiki
|
| 24 |
+
- documentation
|
| 25 |
+
- rag
|
| 26 |
+
- offline
|
| 27 |
+
|
| 28 |
+
# Arch Wiki - JSONL Dataset
|
| 29 |
+
|
| 30 |
+
This dataset provides the complete Arch Linux Wiki in a clean, machine‑readable JSON Lines format (.jsonl).
|
| 31 |
+
It is derived from the official arch-wiki-docs package, which contains static HTML exports of all language versions.
|
| 32 |
+
|
| 33 |
+
Each line is one wiki page, with extracted plain text, headings, language code, and a relative URL path – ready for RAG (Retrieval-Augmented Generation), embedding, full‑text search, or offline browsing.
|
| 34 |
+
|
| 35 |
+
## Dataset Structure
|
| 36 |
+
|
| 37 |
+
One JSON object per line. Example:
|
| 38 |
+
|
| 39 |
+
{
|
| 40 |
+
"lang": "en",
|
| 41 |
+
"title": "Arch Linux",
|
| 42 |
+
"url_path": "en/Arch_Linux.html",
|
| 43 |
+
"content": "Arch Linux is an independently developed, x86-64 general-purpose Linux distribution that strives to provide the latest stable versions of most software...",
|
| 44 |
+
"headings": ["Arch Linux", "History", "Installation", "Package management"]
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
| Field | Type | Description |
|
| 48 |
+
|------------|--------------|-------------|
|
| 49 |
+
| lang | string | Two‑letter language code (e.g., en, fr, de). Chinese variants are zh-hans/zh-hant. |
|
| 50 |
+
| title | string | Page title as displayed in the wiki (without “ - ArchWiki” suffix). |
|
| 51 |
+
| url_path | string | Path relative to the root of the offline dump (e.g., en/Arch_Linux.html). |
|
| 52 |
+
| content | string | Clean plain‑text version of the article. All HTML tags, edit links, tables of contents, and navigation elements have been removed. |
|
| 53 |
+
| headings | list[string] | All h1, h2, h3 headings found on the page, in order of appearance. |
|
| 54 |
+
|
| 55 |
+
## Statistics
|
| 56 |
+
|
| 57 |
+
- Total pages: 5,713 (may vary slightly with updates)
|
| 58 |
+
- Languages: All languages served by the official Arch Wiki (determined by the arch-wiki-docs package)
|
| 59 |
+
- Average content length: ~2,500 characters per page
|
| 60 |
+
- File size (compressed): ~50‑80 MB (.7z or .gz)
|
| 61 |
+
- File size (uncompressed JSONL): ~200‑300 MB
|
| 62 |
+
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
Load with Hugging Face datasets:
|
| 66 |
+
|
| 67 |
+
from datasets import load_dataset
|
| 68 |
+
|
| 69 |
+
dataset = load_dataset("your-username/arch-wiki-jsonl", split="train")
|
| 70 |
+
|
| 71 |
+
# Examine a page
|
| 72 |
+
print(dataset[0]["title"])
|
| 73 |
+
print(dataset[0]["content"][:500])
|
| 74 |
+
|
| 75 |
+
Load from raw JSONL (pure Python):
|
| 76 |
+
|
| 77 |
+
import json
|
| 78 |
+
|
| 79 |
+
pages = []
|
| 80 |
+
with open("arch_wiki.jsonl", "r", encoding="utf-8") as f:
|
| 81 |
+
for line in f:
|
| 82 |
+
pages.append(json.loads(line))
|
| 83 |
+
|
| 84 |
+
# Filter by language
|
| 85 |
+
en_pages = [p for p in pages if p["lang"] == "en"]
|
| 86 |
+
|
| 87 |
+
Build a simple RAG pipeline (example with LangChain):
|
| 88 |
+
|
| 89 |
+
from langchain.document_loaders import JSONLoader
|
| 90 |
+
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 91 |
+
|
| 92 |
+
loader = JSONLoader(
|
| 93 |
+
file_path="arch_wiki.jsonl",
|
| 94 |
+
jq_schema=".content",
|
| 95 |
+
text_content=False
|
| 96 |
+
)
|
| 97 |
+
documents = loader.load()
|
| 98 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)
|
| 99 |
+
chunks = text_splitter.split_documents(documents)
|
| 100 |
+
# → now embed and index
|
| 101 |
+
|
| 102 |
+
## Licenses and Attribution
|
| 103 |
+
|
| 104 |
+
The content of the Arch Wiki is licensed under the GNU Free Documentation License 1.3 and Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0).
|
| 105 |
+
|
| 106 |
+
This dataset is a derivative work. Full attribution to the Arch Linux community and all wiki contributors is required. When using this dataset, please include:
|
| 107 |
+
|
| 108 |
+
> Based on the Arch Linux Wiki (https://wiki.archlinux.org/), available under CC BY‑SA 3.0 and GFDL.
|
| 109 |
+
|
| 110 |
+
The conversion script is provided under the MIT License.
|
| 111 |
+
|
| 112 |
+
## Generation Process
|
| 113 |
+
|
| 114 |
+
1. Installed the official arch-wiki-docs package:
|
| 115 |
+
sudo pacman -S arch-wiki-docs
|
| 116 |
+
2. Wrote a Python script using BeautifulSoup4 to parse all HTML files.
|
| 117 |
+
3. Extracted: title (from title tag), clean text (from #mw-content-text), headings (from h1-h3).
|
| 118 |
+
4. Output as JSON Lines (.jsonl) with one page per line.
|
| 119 |
+
|
| 120 |
+
You can find the conversion script in the scripts/ folder of this repository (or linked in the dataset card).
|
| 121 |
+
|
| 122 |
+
## Changelog
|
| 123 |
+
|
| 124 |
+
- 2026-05-27: Initial release based on arch-wiki-docs version as of May 27 2026.
|
| 125 |
+
|
| 126 |
+
## Notes
|
| 127 |
+
|
| 128 |
+
- This dataset is static. For the very latest wiki content, regenerate from an updated arch-wiki-docs package or pull from the live wiki.
|
| 129 |
+
- If you need the original HTML (e.g., for full styling), install arch-wiki-docs directly on an Arch Linux system.
|
| 130 |
+
- The headings field is useful for document structure‑aware chunking (e.g., split by heading boundaries).
|