Semi-Automated TEI/XML Encoding �of Modern Korean Novel
Academy of Korean Studies
Cultural informatics PhD. Student Gayeon Kim
Agenda
1
Why encode a novel?
2
The bottleneck — and what makes Korean harder
3
The system — a semi-automated pipeline with Gemini / AI Studio
4
The prompt as encoding manual
5
Live: one paragraph in, XML out
6
Where the model breaks — and why "semi," not "full"
7
Takeaways & open resources
Why encode a novel?
Why encode a novel?
▲ teiCrafter
(Link)
▲ Automated XML Tagging of the Hugo Schuchard Correspondence (Link)
Why encode a novel?
Prior work rarely shares the actual prompts used, and most remains at the level of proposals rather than implemented pipelines.
Existing XML auto-tagging work centers on drama and correspondence; unstructured prose and fiction remain largely untouched.
And no project has yet attempted semi-automated TEI/XML tagging tailored to the specifics of modern Korean Novel.
The bottleneck — and what makes Korean harder
So why use AI?
Time
: Hand-tagging a single short story takes a day or two; across 33 works, that alone is an entire project.
Expertise
: TEI has hundreds of elements; every annotator must know when to use persName vs. rs, yet our work was split across many hands in a training program.
Consistency
: If A's tagging of 『Kamja』 and B's of 『Nalgae』 diverge, the numbers start to lie the moment the two are analyzed together. A corpus becomes data only when it's consistent.
The bottleneck — and what makes Korean harder
So what makes Korean harder?
Mixed script
: A 1906 text and a 1950s text are written differently;
The bottleneck — and what makes Korean harder
So what makes Korean harder?
Mixed script
: A 1906 text and a 1950s text are written differently;
Particles
: Korean attaches particles to names
- 형식-ŭn | 형식-I | 형식-ŭl
Consistency
: One character is "Yŏngch'ae," then "she," then "the daughter," then "the master."
The bottleneck — and what makes Korean harder
Particles
: Korean attaches particles to names
- Hyongsik-ŭn | Hyongsik-I | Hyongsik-ŭl
Consistency
: One character is "Yŏngch'ae," then "she," then "the daughter," then "the master."
The system
The prompt as encoding manual
Role Assignment
You are an expert in digital humanities and the TEI (Text Encoding Initiative) standard, specializing in Korean literature. Your task is to process the provided input text and convert it into a single, complete, and perfectly-formed TEI XML document according to the following rules.
<author> from the text content. If they cannot be found, use “제목 미상” for the title and “저자 미상” for the author.
the text was provided by the user.
<projectDesc><p>본 전자본은 TEI P5 지침(TEI ALL)에 따라 구조화함.</p></projectDesc>.
Configuring the <teiHeader>
Configuring the <particDesc>
</term></keywords>.
<persName xml:lang="ko"> tag. Correct any entries that do not follow this format.
- Here is an example of a well-formed <particDesc>:
<particDesc>
<listPerson>
<person xml:id="ME"><persName xml:lang="ko">나</persName></person>
<person xml:id="JS"><persName xml:lang="ko">점순</persName></person>
</listPerson>
</particDesc>
Encoding the <body>
single <div> tag.
- Identify and tag all named entities that are not already tagged:
<persName> for people, <placeName> for places, <orgName> for organizations.
<persName>
<placeName>
<orgName>
Tagging through LLM reasoning
The Importance of Particle Separation
When tagging keeps the particle attached…
이형식 | 이형식은 | 이형식이 | 이형식을 → recognized as separate entities.
Normalizing every form of 이형식 into one canonical entity
Handling Hanja Tagging
Previous version: handled with <choice><orig><reg>
Source: 羽
Tagged: <foreign xml:lang=“zh”>羽</foreign>
Present version
- simply handled with the <foreign> tag
- **Direct Speech**: Convert all direct speech/dialogue (indicated by "...") into <said> elements.
The <said> element MUST have a 'who' attribute referencing the speaker's 'xml:id' from
<listPerson> (e.g., <said who="#LHS">).
- **Internal Monologue**: Convert all internal monologues (thoughts, typically enclosed in '...')
into <said aloud="false"> elements. This element also requires a 'who' attribute.
- The spoken text itself should be inside the <said> tag, but it does NOT need to be wrapped in a
<p> tag.
니?</said>“
- Incorrect: <said who="#JS">"얘! <rs ref="#ME">너</rs> 혼자만 일하니?"</said>
“얘! 너 혼자만 일하니?”
<rs ref=“#ME”>너</rs> 혼자만 일하니?</said>”
Direct Speech
Indirect Speech
‘이게 꿈인가...’
“얘! 너 혼자만 일하니?”
* “<said aloud=“true” direct=“true” who=“#JS”> 얘! <rs ref=“#ME”>너</rs> 혼자만 일하니?</said>”
Quotation-Mark Placement
Place quotation marks outside the tag
점순이가 말했다. “뭐해?”
* 점순이가 말했다. “<said who=“#JS”>뭐해?</said>”
Narration Separation
Narrator description vs. character speech — separation
6. Person and Reference Tagging:
<div n="1" type="chapter">
<head>1</head>
<p>...content of chapter 1...</p>
</div>
Finalizing the output
<?xml version="1.0" encoding="UTF-8"?>. Do not include any commentary, explanations, or markdown formatting like \`\`\`xml.
Live: one paragraph in, XML out
Where the model breaks
and why "semi," not "full"
<Big Problem>
Faulty <rs> resolution
— the model struggles to infer reference from context
Surface-level tagging
— the model marks form, not meaning
Open resources
▲ GitHub (Link)
Open resources
▲ Zenodo v4 (Link)
Thank you
For questions, contact eiloppang@naver.com