Open these slideskwokleongtang.net/workshops/2026_11_yale/slides.html

AI Workshop for Sinitic Studies · Yale

From a model that guesses to an agent that checks

Essential concepts of agentic AI for Chinese studies

Sat 2026-11-07 · 9:00–11:30
Luce Hall Room 203
KL
Kwok-leong TangDigital China Initiative, Harvard University
→ press Space or →, or swipe, to begin

Before we start

AI disclaimer

I use several AI models and agents in all my digital work. This workshop is no different.

  • AI agents helped me create these slides, the script and the exercises
  • AI agents also ran every exercise as a test, the day before the workshop
  • I read, checked and changed what they made
  • If you find a mistake, please tell me. It is my mistake, not the AI's
The agent does the work.I check it, and I am responsible for it.

That is also what I will teach you today.

Self-check · 3 minutes

Before we start

  • Rate yourself on 7 questions, from 0 to 6
  • Phone: scan the code, tap a number for each question
  • Laptop: open these slides and go to slide 4
  • The page adds up your score. Nothing is sent
  • I will only ask which range you are in
There are no right or wrong scores.This helps me teach to the people in this room.

Self-check · rate each from 0 to 6

How well can you explain…

Total 0 / 42
0 · cannot3 · part of it6 · clearly
  1. The difference between a chat assistant (ChatGPT, Claude) and a coding agent (Codex, Claude Code)
  2. What the Model Context Protocol (MCP) is
  3. How a large language model (LLM) produces an answer
  4. Why an LLM can give a wrong answer that sounds confident
  5. What "context" means, and why a long chat can lose track of earlier details
  6. How tools, web search, or skills change what an LLM can do
  7. What happens to your data when you upload it to one of these tools

Self-check · highest possible score: 42

Add up your score

Total 0 / 42
A0–10
B11–21
C22–32
D33–42

Raise your hand when I call your range.

Then: who uses AI every week, or every day?

Saturday, November 7 · Luce Hall 203

Today

9:00Self-check
9:05Claude Desktop, and a laptop check
9:22Review: inside the model (Teaching Lab)
9:44Agents and skills
10:06Find, save, cite
10:35Can you trust it?
10:50Git and GitHub: your own webpage
11:30Lunch
1:00《明光宗實錄》: from scanned pages to a database
3:00Office hour (optional)
No break this morning.Get up for coffee whenever you need it.

Before Part 1 · Claude Desktop · 1 of 3

Start a session in Code mode

YOUR TURN
  1. Click </> at the top of the sidebar (Code)The chat and code icons at the top of the sidebar
  2. Choose environment → Local: This computer
  3. Bottom row: click the folder → choose Documents › Claude › ProjectsThe environment and folder buttons under the prompt box
LOCAL OR CLOUD?Local: your computer, your files. Cloud: Anthropic’s computers, on a GitHub repository. It keeps going when you close the app. Today: Local.
The Choose environment menu: Local, This computer; Cloud, Auto or Default

Before Part 1 · Claude Desktop · 2 of 3

Model, effort, permissions

YOUR TURN
The model menu and the effort menu

Click the model name in the bottom row. Effort: higher is more thorough, but slower, and uses your limits faster.

Today: Opus 5.5 · Medium · Auto

The permissions menu: Auto, Accept edits, Plan

Next to the model: the permission mode. Auto: Claude decides what is safe. Plan: it changes nothing.

Plan usage limits

The small circle at the end of the row: how much of your plan you have used.

Before Part 1 · Claude Desktop · 3 of 3

Inside a session

YOUR TURN

TOP RIGHT OF THE WINDOW

Terminal, Browser and Files icons
IconPaneMacUse it to
>_Terminal⌘Jtype commands yourself
globeBrowser⇧⌘Bopen web pages the agent can see
folderFilessee and open the files in your folder

Windows: hover over an icon to see its shortcut. Files shows only after you choose a folder.

The Terminal pane The Browser pane The Files pane
TRY IT NOWOpen all three. Leave the Terminal open: we use it next.

Before Part 1 · laptop check · Mac and Windows

Check Git and GitHub

YOUR TURN
  1. Mac only: Apple menu → About This Mac. macOS 26.1? Update now.
  2. In Claude Desktop’s Terminal pane, run:
TERMINAL · MAC AND WINDOWS
git --version gh --version gh auth status
✓ TWO VERSION NUMBERS, AND “LOGGED IN TO GITHUB.COM”You are ready. Help your neighbor.
■ “NOT LOGGED IN”Fine for now. We log in together at 10:50.
✕ GIT OR GH IS MISSINGMac: a window asks to install developer tools → click Install. If it fails, or Windows says “not recognized”: next slide.

Before Part 1 · laptop check · only if something is missing

Fix it: Mac Plan B, or Windows

YOUR TURN

MAC · NO XCODE, NO HOMEBREW NEEDED

1 · INSTALL PIXI
curl -fsSL https://pixi.sh/install.sh | bash
2 · QUIT CLAUDE (⌘Q), OPEN IT AGAIN, THEN
pixi global install git gh

Works on macOS 11 (Big Sur) or newer, Intel and Apple Silicon.

WINDOWS · IN THE TERMINAL PANE (POWERSHELL)

1 · INSTALL GIT AND GH
winget install --id Git.Git -e winget install --id GitHub.cli -e
2 · QUIT CLAUDE COMPLETELY, OPEN IT AGAIN
git --version

Still stuck? Raise your hand. We fix it before 10:50.

Part 1 · the question behind today · from my course EASTD 143A, Harvard, fall 2026

When AI cannot finish a task, who failed?

The model?It cannot do the task yet. A rare character breaks into pieces, or the facts were never in its training.

Fix: wait for a better model, or try another one.
The engineering?The model could do it, but nothing around it helped: no reference tool, no context, no way to check.

Fix: add tools, skills and small steps.
The user?We asked in one chat message, gave too little, or did not check the answer.

Fix: learn to ask, split and check.
From the outside, the three look the same.Only the first needs a better model. Today we work on the other two.

Part 1 · Review: inside the model

First, a review: the model alone

WATCH

We use the Local LLM Teaching Lab. A small model, LFM3, runs inside Chrome on your laptop. No tools, no internet search.

  • Installed it? Open it, load LFM3, and follow along.
  • Not installed? Just watch my screen. You do not need it later today.

Free on the Chrome Web Store:chromewebstore.google.com/detail/local-llm-teaching-lab

Claude can look things up, so it hides the model’s mistakes.Here we see what the model does on its own.

Part 1 · Review: inside the model

Why does the model need help?

An LLM does not look anything up.
It writes the next likely token.

  • A token is a small piece of text
  • "Likely" is not the same as "true"
  • Dates, names, and offices are where likely and true come apart
Likely is not true.Next: watch it guess.

Part 1 · Review: inside the model · demo

Confident is not correct

WATCH · FOLLOW ALONG

Teaching Lab → load LFM3 1.7B → turn on Token confidence → ask both questions. LOOK FOR: how sure is it on each?

QUESTION 1 · EASY
Who was the first emperor of the Ming dynasty?
QUESTION 2 · HARD
Convert 泰昌元年八月初一日 to a Gregorian date.

LFM3 on Question 1sureless surenot sure

LFM3's answer to Question 1, each token colored by confidence
“Hongwu Dadian” is made up. The model was not sure.Why? openai.com/index/why-language-models-hallucinate
“the Great Cleansing” is not a standard name for any Hongwu policy. The model was sure.
The color shows how sure it is.Not if it is true.

Part 1 · Review: inside the model · demo

The model does not see characters

WATCH · FOLLOW ALONG
  1. Open Tokenizer.
  2. Load the LFM3 tokenizer.
  3. Paste each of these:
草莓龜龟one line from your own source

LOOK FOR

  • How many tokens does each one use?
  • Does any character break into pieces?

LFM3 TOKENIZER

龜→龜: two tokens, ID 18366 and ID 259
龟→龟: two tokens, ID 18366 and ID 262
  • One character, two pieces
  • Both start with the same piece (ID 18366)
  • Alone, each piece is just “�”
The model sees pieces.A lookup table sees the character.

Part 1 · Review: inside the model · demo

Watch a tool call

WATCH

Teaching Lab → turn on Agent mode → in Tools, switch on convert_cjk_date → ask:

PASTE INTO THE TEACHING LAB
Convert 光緒二十四年三月廿七日 to a Gregorian date in YYYY-MM-DD form.

IN THE TRACE

1The model asks for the tool
Tool call: convert_cjk_date, 448 ms. Request with the date 光緒二十四年三月廿七日
2The tool runs, and the result goes back
Response: jdn 2414397, gregorian 1898-04-17
3The model writes the answer
The Gregorian date for 光緒二十四年三月廿七日 is 1898-04-17.
The date now comes from a table, not from memory.And the trace shows you where.

Part 1 · Review: inside the model · github.com/kltng/calendar_converter

Behind the tool: a table, and MCP

HOW THE CONVERTER WAS BUILT

  1. Data: the DILA time authority database (Dharma Drum): eras and lunar months
  2. Table: one SQLite file. 1,637 eras, 131,808 lunar months, China ~220 BCE–1912
  3. Pivot: every day gets one number, the Julian Day Number (JDN)
光緒二十四年三月廿七日
  → JDN 2414397
  → 1898-04-17
  1. Serve: the same code as a web API, an MCP server, and a Claude skill

WHAT IS MCP?

Model Context Protocol: a standard plug between a model and tools.

ModelTeaching Lab, Claude…
⇄MCP
Tool servercalendar converter
  • The server lists its tools: convert_cjk_date and three more
  • Any model that speaks MCP can use them
SAME TABLE, TWO WAYSMCP server: runs online, the date leaves your laptop. cjk-calendar skill: the same table, on your laptop.

Part 2 · Agents and skills

An agent is a loop

1Read the task 2Choose askill / MCP / tool 3Run it 4Read the result repeat until the task is done the trace shows each turn

A chat assistant answers from what it remembers.

An agent works in a loop, and uses skills and tools on the way.

LOOK BACKQuestion 1 of the self-check. Would you change your score?

Part 2 · Agents and skills

Install the skills

YOUR TURN
  1. Claude Desktop → Code → choose your Projects folder
  2. Type these lines in the message box, one at a time:
/plugin marketplace add kltng/humanities-skills
/plugin install cjk-calendar@humanities-skills
/plugin install cbdb-api@humanities-skills
/plugin install chgis-tgaz@humanities-skills
# also: yale-library-catalog, zotero-local,
# human-eval-review, tei-validator,
# alma-sru-catalogs

The skills are free on GitHub:github.com/kltng/humanities-skills

⟳ THEN: NEW SESSIONClick + New, folder Projects, so Claude loads the skills.
✓ DONE WHENType /plugin. You see cjk-calendar under Installed.
WHILE IT INSTALLSLook at the list on the next slide. You will use most of these today.

Part 2 · Agents and skills · github.com/kltng/humanities-skills

humanities-skills

Free skills for historical and East Asian research. We use most of them today.

NeedSkills
Peoplecbdb-apicbdb-local China Biographical Database
Placeschgis-tgaztgaz-sqlite China Historical GIS
Datescjk-calendar Chinese, Japanese, Korean, Vietnamese calendars
Librariesyale-library-catalogalma-sru-catalogstaiwan-ldt-authorities and more
Referenceszotero-local
Checkinghuman-eval-reviewargue-against-metei-validator

Part 2 · Agents and skills · demo in Claude

The same question, with skills

WATCH

Now in Claude, with cjk-calendar and cbdb-api:

QUESTION 1
Convert 泰昌元年八月初一日 to a Gregorian date.
QUESTION 2
What offices did 王守仁 hold? Give your sources.
Compare with the small model’s answer.Which one can you check?

Part 2 · Agents and skills

Open a skill

A skill is a folder:

cjk-calendar/
├── SKILL.md     ← when to use it, and how
├── scripts/     ← code that does the work
└── references/  ← details, read when needed

Open it on GitHub:github.com/kltng/humanities-skills/tree/main/cjk-calendar

The description tells the agent when to use it:

SKILL.md · DESCRIPTIONConvert between Chinese, Japanese, Korean, and Vietnamese lunisolar calendar dates and Gregorian/Julian dates. Use when the user needs to look up historical East Asian dates, convert era names (年號) like 康熙, 天保, 崇禎 to Western dates, compute sexagenary cycle (干支) day/month/year, or work with Julian Day Numbers.

It is plain English.

Summing up · The words we used

Prompt, tool, MCP, skill, plugin

WordWhat it isExample
PromptYour words in this chat"Convert this date"
ToolOne action the agent can takeLook up one date
MCPA standard way to connect tools (Model Context Protocol)The Teaching Lab's calendar tool
SkillInstructions + code + references, loaded only when neededcjk-calendar
PluginA program that adds features to another appCNE in Zotero
A skill teaches the agent a method, not only an action.

Summing up · Before you upload anything

Where does your text go?

LocalCloud appApplication Programming Interface (API)
Examples todaythe Teaching Lab model (LFM3), cjk-calendar, cbdb-localclaude.ai, ChatGPT, Claude Desktopthe Teaching Lab’s calendar tool, cbdb-api, CHGIS, library catalogs
It runs onyour laptopthe company’s computersa third party’s server
What leaves your laptopnothingyour prompts and fileseach request your tool sends
Who sets the rulesyouyour plan’s termsthe provider’s terms
Good forprivate or unpublished sourcesthe strongest modelsdata you do not own: CBDB, CHGIS, catalogs
EASY TO MISSClaude Desktop’s “This computer” means the agent works on your files here. The model still runs in the cloud. What Claude reads is sent to Anthropic.
Ask two questions every time:Which computer runs this? What text leaves my laptop?

Summing up · Three ways to tell a computer what to do

Mouse, command, sentence

PastGUI · the mouse

You point and click.
You can only do what the buttons allow.

File → Export → CSV
PastCLI · commands

You type exact commands, or write code.
Powerful, but you must learn the language first.

sqlite3 cbdb.db "SELECT … WHERE c_name_chn='王華'"
NowNatural language

You say what you want.
The agent writes and runs the commands.

Find every 王華 in CBDB who lived in the Ming.
When the interface is a sentence, everyone can build their own tools.Your expertise decides what to ask for, and how to check the result.

Summing up · Other people’s digital tools → your own

From using tools to building them

BeforeLearn other people’s tools
  • Learn each tool’s buttons and its query language
  • Work the way the tool was built
  • Wait for someone else to add what you need
NowBuild your own
  • Describe the tool you need, in a sentence
  • The agent writes the code. You check the result.
  • Keep it, change it, share it on GitHub

Today: use Zotero and CNE well (next) → your own webpage (before lunch) → your own pipeline for one juan (afternoon) → your own skill (office hour).

Part 3 · Find, save, cite

From a catalog to a correct citation

WATCH
1 · FIND the book yale-library-catalog alma-sru-catalogs 2 · CHECK the name forms taiwan-ldt-authorities e.g. 黃宗羲 = Huang Zongxi 3 · SAVE to Zotero zotero-local 4 · CITE in three scripts CNE Chicago 18th CNE ✓ you check here ✓ and here

One chain, four tools. The last step gives a citation with the original script, the romanization, and a translation.

Part 3 · Find, save, cite

Connect Claude to CNE

  1. In Zotero: Settings → CNE → Agent access. Turn it on.
  2. Click Copy connection.
  3. Paste it into Claude with:
PASTE INTO CLAUDE · CODE TAB
This is the connection to the CNE plugin in my Zotero. Add the romanized title, the original-script title, and an English translation to the item I just saved. Show me the citation in Chicago 18th CNE before you save.

CNE (Cite Non-English) is by Bo An, a Yale alumnus. Free on GitHub:github.com/boan-anbo/cite-non-english

KEEP IT PRIVATEThe connection holds a private key (a token). Paste it only into your own Claude.
The agent proposes.You check, then it saves.

Part 3 · Find, save, cite · 20 minutes

Your turn

YOUR TURN

Use one book or article you cite often.

  1. Find it in a catalog
  2. Save it to Zotero
  3. Get a Chicago 18th CNE citation

LOOK FOR

  • Is the romanization right?
  • Is the translated title right?
  • Would you put it in your dissertation as it is?
START HERE · CLAUDE CODE TAB
Search the Yale library catalog for the exact title [title], as a phrase. Show me the best match and its call number. Ask me before you save it to Zotero.

Part 4 · Can you trust it?

Same name, different people

YOUR TURN
PASTE INTO CLAUDE · CODE TAB
Use cbdb-api to find 王華, the father of 王守仁. How many people named 王華 did the search return? Which one is the father, and how do you know?

LOOK FOR

  • How many came back? CBDB has 15. Why the gap?
  • How did the agent choose one?
  • Would you have chosen the same one?
IN CBDB15 people named 王華. 8 of them lived in the Ming.
USE CBDB A LOT? USE CBDB-LOCALcbdb-local keeps the whole CBDB on your laptop: one download of about 560 MB. It finds all 15 people, and it is faster.
/plugin install cbdb-local@humanities-skills
The agent can be wrongeven when the database is right.

Part 4 · Can you trust it?

Three questions for any AI result

1 · Where did it come from?A database, a tool, or the model's memory?
2 · Can I check it?Is there an ID, a source, or a page number?
3 · Who decided?The agent, or me?

We use these three questions all afternoon.

Part 5 · Git and GitHub

Why Git?

Before lunch, you put your own page on the web. This afternoon, Git keeps a copy of every step.

Gitrecords versions of your files on your laptop
GitHubstores them online
A commitone saved version, with a short note
GitHub Pagesturns a repository into a website, for free
If a step goes wrong,you can go back.

Part 5 · Git and GitHub · setup clinic

Check your setup

YOUR TURN

Open a terminal and run:

git --version
gh --version
gh auth status
git config --global user.email
✓ ALL FOUR WORKEDAnd the email ends in @users.noreply.github.com? Help your neighbor.
■ SOMETHING FAILEDRaise your hand. We fix it now.

Name or email wrong? On github.com/settings/emails, tick Keep my email addresses private, and copy the address that ends in @users.noreply.github.com. Then run:

git config --global user.name "Your Name"
git config --global user.email "12345678+your-username@users.noreply.github.com"
# not logged in?  gh auth login   # GitHub.com → HTTPS → Login with a web browser

Part 5 · Git and GitHub · GitHub Pages

Put your own page on the web

YOUR TURN
PASTE INTO CLAUDE · CODE · PROJECTS FOLDER
Make a folder called my-page with one simple web page, index.html, about my research. First ask me for my name, my field, and two or three sentences about my work. No email address. No outside libraries. Open the page in the browser so I can check it. When I say it is good: make it a Git repository, commit, create a public GitHub repository called my-page, push, and turn on GitHub Pages for the main branch. Then tell me the web address.
⟳ FIRST: NEW SESSIONClick + New, folder Projects. Claude makes Projects › my-page: one folder, one repository.

YOUR ADDRESS

https://your-username.github.io/my-page/
PUBLICAnyone can see this page. Put nothing private or unpublished on it.
✓ DONE WHENThe page opens on your phone. It can take 1–2 minutes.

Part 5 · Git and GitHub · the loop you use all afternoon

Change it, publish again

YOUR TURN
PASTE INTO CLAUDE · SAME SESSION
Add a section called “A source I work with”, with its title in Chinese and in English. Show me what changed. Then commit with a short note and push.
  1. Reload the page on your phone.
  2. Open github.com/your-username/my-page → Commits. Every version is there.
Change → commit → push.This afternoon you do this after every step.
STILL STUCK AT 11:30?Come to me at lunch.

Before lunch · One habit for the afternoon

Divide and conquer

One big taskScan → TEI in one prompt
  • The agent does everything at once
  • A misread character in step 1 is still there in step 8
  • You see only the end, not where it went wrong
Small tasks, checkedEight steps, a check after each
  • Split the big task into small tasks
  • Check each result before the next step
  • Fix a mistake where it starts, then commit

This is human-in-the-loop: the agent does each step, and you check and decide before it goes on. We do exactly this after lunch: eight steps, one juan.

AI Workshop for Sinitic Studies · Afternoon

From printed materials to a database

Agentic workflow in practice, with 《明光宗實錄》

1:00–3:00
Office hour 3:00–4:00
KL
Kwok-leong TangDigital China Initiative, Harvard University

Afternoon · the source

《明光宗實錄》, juan 2

Academia Sinica edition, 1962.

  • Copied by hand, not printed
  • No punctuation
  • Dates use the reign year, the month, and the sexagenary day (干支)
  • Juan 2 is still 萬曆四十八年七月 (1620-08-19 to 08-27). From 八月, the year is 泰昌元年.
By 3:00: a TEI file of this juan.Every entry dated. People and places linked. Checked by you.
The first page of juan 2 of the 明光宗實錄, from the 1962 Academia Sinica edition
明光宗實錄 卷二, p. 0023 (1962 ed.) · for workshop use only

Afternoon · before step 1

Start the project, make a first commit

YOUR TURN
⟳ FIRST: NEW SESSIONClick + New, folder Projects.
PASTE INTO CLAUDE · CODE · PROJECTS FOLDER
Create a folder called guangzong-shilu, and make it a Git repository. Download https://kwokleongtang.net/workshops/2026_11_yale/guangzong_juan2_source.zip and unzip it into guangzong-shilu/source. Add a .gitignore that keeps source/ and all PDF files out of Git. Add a README that says we will turn one juan of the 明光宗實錄 into a TEI file. Use main as the branch name. Make the first commit. Then create a private GitHub repository for it and push.
⟳ THEN: NEW SESSIONClick + New, folder Projects › guangzong-shilu. We stay in this session all afternoon.
✓ DONE WHENYou see your private repository on github.com, without source/ and the PDF.
IF A STEP FAILS LATERDownload the ready-made files by hand. Copy only the file for your step into guangzong-shilu.
kwokleongtang.net/workshops/2026_11_yale/guangzong_juan2_backup.zip

Afternoon · 《明光宗實錄》 · from scans to a database

Eight steps, one juan

OVERVIEW
1 · OCR Read 2–3 pages Claude · gaaucau → ocr.txt 2 · COMPARE Count OCR errors errors → errors.md 3 · CLEAN Mark each entry Claude → entries.txt 4 · DATE 干支 → Western date cjk-calendar → dated.csv 5 · LINK People and places cbdb-api chgis-tgaz → linked.csv 6 · REVIEW You decide human-eval-review → decisions.json 7 · TEI Encode the juan Claude → juan.xml 8 · VALIDATE Check the file tei-validator → report.txt · done = git commit · divide and conquer: you check after every step · stuck? use the backup ZIP

Afternoon · steps 1–2 · 15 minutes

OCR, and its errors

YOUR TURN
1 OCR2 Compare3 Clean4 Date5 Link6 Review7 TEI8 Validate
PASTE INTO CLAUDE · CODE TAB
Read pages 1–3 of source/juan2.pdf. Transcribe them exactly, line by line, with no punctuation. Mark any character you are unsure of with [?]. Save the result as ocr.txt.

Then compare ocr.txt with source/database.txt, a text from a database.

LOOK FOR

  • How many characters were wrong?
  • Similar shapes, variant forms, or the handwriting?
  • Did the model add or change anything without saying so?
COMMITgit commit after each step.

Afternoon · steps 1–2 · more about OCR

Three ways to OCR

Vision LLM (VLM)local-ocr skillgaaucau Quick OCR
What it isClaude reads the page image, as in step 1Datalab’s open OCR models: Chandra, Surya, Indraa Mac app: PaddleOCR-VL with layout detection
It runs onthe company’s computersyour laptopyour Mac (Apple Silicon)
How to starta prompt/plugin install local-ocr@humanities-skillsMac App Store
Good forhard pages; it says where it is unsuremany pages, private sources; ALTO, PAGE, TEIa quick text, no setup
Watch forit may “correct” the text without telling youa 5 GB download for Chandra; Indra cannot read vertical textMac only; check the reading order

What vision models can do with hard books: two models read every page, and the edition shades where they disagree.kwokleongtang.net/collections/ocr/

Every OCR makes mistakes.Pick the tool for the page, then check it.

Afternoon · steps 1–2 · demo

Database or scan? You decide

WATCH
One item on the review page: the scan column with a red box, the database reading 所角□羊進者應, the agent's reading 所解進者應, and three choices
  1. Agents compared all 30 pages with database.txt: 75 differences.
  2. human-eval-review made one page: the scan, both readings, a choice.
  3. I choose, and click Download Results. Claude reads my choices.
THE DATABASE IS WRONG HEREThe scan has 解. The database split it into 角□羊.

Try the page:kwokleongtang.net/workshops/2026_11_yale/proofreading_review.html

Afternoon · steps 3–4 · 25 minutes

Entries and dates

YOUR TURN
1 OCR2 Compare3 Clean4 Date5 Link6 Review7 TEI8 Validate
  1. Ask Claude to mark where each entry starts. An entry starts with ○.
  2. Use cjk-calendar to give each entry a Western date.
WATCH THE ERA CHANGEThe same year can be written as 萬曆四十八年 or 泰昌元年.
Check three dates by hand.Do they match?
PASTE INTO CLAUDE · CODE TAB
Split source/database.txt into entries, one per line, and save entries.txt. Give each entry a Western date with cjk-calendar, and save dated.csv with the original date text next to it. Notes: cjk-calendar cannot read a 干支 day, so convert the month, then find the day whose 干支 matches. Write 萬曆, not 萬歷. An entry with no 干支 is on the same day as the entry before.

Afternoon · steps 5–6 · 25 minutes

People and places

YOUR TURN
1 OCR2 Compare3 Clean4 Date5 Link6 Review7 TEI8 Validate
  1. Find every person and place in your entries.
  2. Look them up with cbdb-api and chgis-tgaz.
  3. Make a human-eval-review page for the uncertain matches. Decide.
Who decided: the agent, or you?Your review file records the answer.
PASTE INTO CLAUDE · CODE TAB
Read the text of each entry in dated.csv and list every person and place. Look up people with cbdb-api, and places with chgis-tgaz for the year 1620. cbdb-api gives only its best match, so check its dates and offices. When a match is uncertain, or there is more than one candidate, make a human-eval-review page so I can choose. Save my choices as decisions.json.

Afternoon · steps 7–8 · 15 minutes

TEI, and checking it

YOUR TURN
1 OCR2 Compare3 Clean4 Date5 Link6 Review7 TEI8 Validate

TEI is the standard way to encode texts in the humanities (tei-c.org). One entry looks like this:

<div type="entry">
  <date when="YYYY-MM-DD">○干支</date>
  ……<persName ref="cbdb:ID">name</persName>……
  ……<placeName ref="tgaz:ID">place</placeName>……
</div>
PASTE INTO CLAUDE · CODE TAB
Write my reviewed entries as TEI in juan.xml, with dates, persName and placeName. Then check juan.xml with tei-validator and show me the report.
✓ DONE WHENThe tei-validator report has no errors, and your last commit is pushed.

Afternoon · 2:40

Show and tell

One entryFrom the scan to TEI
One errorWhat the AI got wrong, and how you caught it
Your historyOne commit for each step on GitHub

Where did it come from? Can I check it? Who decided?

Office hour · 3:00–4:00 · optional

Write your own skill

Think of a database, archive, or method you use often. Write three lines:

  1. Name: what the skill is called
  2. When to use it: one sentence
  3. What it does: the steps a careful scholar would follow
⟳ FIRST: NEW SESSIONClick + New, folder Projects. Ask Claude to make a folder for your skill.
That is the start of a SKILL.md.Claude can help you write the rest.

AI Workshop for Sinitic Studies · Yale · thank you

Questions? Write to me.

After today too: a question about the exercises, the skills, or your own project.

kwokleongtang@fas.harvard.edu

All materials: kwokleongtang.net/workshops/2026_11_yale/
KL
Kwok-leong TangDigital China Initiative, Harvard University
← → move · F full screen · T dark theme