Skip to main content

Turn any text into cuneiform clay tablets - translate, transliterate, and render ancient Mesopotamian writing

Project description

CuneiScribe

Bridge a 4,000-year cultural gap — read and write in cuneiform.

CuneiScribe lets you interact with humanity's oldest writing system. Translate between English and Akkadian, convert to cuneiform Unicode signs, and render clay tablet images — with built-in confidence gating that tells you when results are unreliable.

$ cuneiscribe cuneiform "LUGAL dan-nu LUGAL KUR aš-šur"
𒈗 𒆗𒉡 𒈗 𒆳 𒀸𒋩

$ cuneiscribe classify "The computer sends an email"
Type:       modern
Confidence: 0.70
Warnings:
  - Contains 2 modern concept(s) with no direct Akkadian equivalent

All outputs are machine-generated approximations. Consult Assyriological expertise for research or public-facing use.

Showcase

Reading the past: Epic of Gilgamesh → English

Input (Akkadian):  ša naq-ba i-mu-ru i-šid ma-a-ti ša kul-la-ta i-du-u₂
Cuneiform:         𒊭 𒅘𒁀 𒄿𒈬𒊒 𒄿𒋃 𒈠𒀀𒋾 𒊭 𒆰𒆷𒋫 𒄿𒁺𒌑
English:           "What Naqba saw, the fortress of all the lands, which knows all of them."

Gilgamesh tablet

Writing the past: Shakespeare → Cuneiform

Input (English):   "To be, or not to be, that is the question"
Akkadian:          šá-a-šú u la šá-a-šú šá-a-lu
Input (English):   "The king sent a letter to his brother"
Akkadian:          LUGAL a-na ŠEŠ-šu i-sap-ra
Cuneiform:         𒈗 𒀀𒈾 𒋀𒋗 𒄿𒉺𒅁𒊏

Royal inscription tablet

Confidence gating in action

$ cuneiscribe classify "The king rules the land"
Type:       short
Confidence: 0.85
Mode:       experience          ← Safe to render

$ cuneiscribe classify "Send me an email about the algorithm"
Type:       modern
Confidence: 0.70
Mode:       educational
Warnings:
  - Contains 2 modern concept(s) with no direct Akkadian equivalent
                                ← Warning: these concepts have no Akkadian equivalent

$ cuneiscribe classify "<script>alert(1)</script>"
Type:       anomalous
Confidence: 0.90
Warnings:
  - Input rejected              ← Blocked: anomalous input

Install

pip install cuneiscribe

Quick Start

CLI

# Convert transliteration to cuneiform
cuneiscribe cuneiform "LUGAL dan-nu"        # → 𒈗 𒆗𒉡

# Classify input before processing
cuneiscribe classify "The king rules"       # → short, 0.85, experience mode

# Render as clay tablet
cuneiscribe render "šar kiš-ša-ti" -o tablet.svg

# Full pipeline with confidence gating (requires model)
cuneiscribe craft "The king rules" --model models/byt5-base-akkadian --json

# Look up a sign
cuneiscribe info LUGAL                      # → 𒈗, U+12217

Python API

from cuneiscribe import CuneiScribe, classify

# Check input first
result = classify("I love pizza")
print(result.input_type)   # "short"
print(result.warnings)     # []

# Full pipeline with gating
tc = CuneiScribe(model_path="models/byt5-base-akkadian")
result = tc.craft("The mighty king")

print(result.akkadian)     # Transliteration
print(result.cuneiform)    # Unicode cuneiform
print(result.confidence)   # 0.0-1.0
print(result.suggestion)   # "render" / "render_with_caveat" / "fallback"
print(result.warnings)     # List of caveats

# No model needed for transliteration → cuneiform
result = tc.transliterate_and_render("LUGAL dan-nu", output_path="tablet.svg")

Web Demo

pip install cuneiscribe[serve]
python -m cuneiscribe.interfaces.demo --model models/byt5-base-akkadian --share

How It Works

User Input
    │
    ▼
Input Classifier ──→ anomalous? → REJECT
    │
    ▼
ByT5 Translation (En→Ak)
    │
    ▼
Output Validator ──→ unreliable? → FALLBACK (transliteration only)
    │
    ▼
Cuneiform Converter (14,240 mappings)
    │
    ▼
Tablet Renderer (SVG/PNG)
    │
    ▼
Result + Confidence + Warnings

The confidence gating pipeline ensures the system never confidently renders wrong cuneiform. When output quality is uncertain, it degrades gracefully to transliteration-only with a warning.

Features

Feature Description
Confidence Gating Input classification + output validation before rendering
Cuneiform Converter 14,240 transliteration→Unicode mappings, 95.3% coverage
Clay Tablet Renderer SVG/PNG with authentic Mesopotamian styling, <10ms
Bidirectional NMT English→Akkadian and Akkadian→English (ByT5-base, 49.1 BLEU)
CLI cuneiform, render, craft, classify, info commands
Web Demo Gradio interface with 4-panel display

Architecture

cuneiscribe/
├── pipeline/      ← Confidence gating (classifier + validator)
├── models/        ← ByT5 bidirectional translator
├── knowledge/     ← Sign tables + cuneiform converter
└── interfaces/    ← CLI, web demo, SVG renderer

Four decoupled layers. Swap the model, update sign tables, or add a dialect without breaking interfaces.

Limitations

  • English→Akkadian produces approximate modern transliterations, not authentic ancient text
  • Trained on Neo-Assyrian/Old Babylonian data; other Akkadian dialects (e.g., Old Assyrian commercial texts) may have substantially lower quality
  • Even with 14,240 sign mappings and a 17K-lemma dictionary, domain-specific data matters more than model size
  • Currently English-only

See ROADMAP.md for the engineering roadmap.

Citation

@inproceedings{cuneiscribe2026,
  title={CuneiScribe: Bridging a 4,000-Year Cultural Gap with Bidirectional Akkadian NMT and Cuneiform Rendering},
  author={Wang, Geoffrey},
  booktitle={Proceedings of the 4th Workshop on Cross-Cultural Considerations in NLP (C3NLP)},
  year={2026}
}

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cuneiscribe-0.2.0.tar.gz (139.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cuneiscribe-0.2.0-py3-none-any.whl (139.3 kB view details)

Uploaded Python 3

File details

Details for the file cuneiscribe-0.2.0.tar.gz.

File metadata

  • Download URL: cuneiscribe-0.2.0.tar.gz
  • Upload date:
  • Size: 139.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cuneiscribe-0.2.0.tar.gz
Algorithm Hash digest
SHA256 803d2858d55ee3cafef9c942556146377071f3423c2ad8fd3d52b938ccdae85a
MD5 003bab733b310b27180800977200b132
BLAKE2b-256 656241e004055e4818945fb7e20352c15f9813a3c8fb18032d5bcf9688219831

See more details on using hashes here.

File details

Details for the file cuneiscribe-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cuneiscribe-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 139.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cuneiscribe-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7f10db241de4d70d75416f0ed4bb6e2bdfd72403c7ed9172c37b6a7b9230f48
MD5 d9ab9324c7b4d3ba573f5c8c9da602c2
BLAKE2b-256 38d888d5b562c0498489e3476bf44e68c980c42299f3c1716b27037457289122

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page