Class 4: Comparing authors and models

Tuesday, October 27, 2026

Have your class 3 class3-prepared folder, your homework CSV, and your saved worksheet dh-b-movement.json at hand. Choose one author from the table in section 1; two students may choose the same author.

What you use From class 3 Today
Text 「蜘蛛の糸」 (“The Spider’s Thread”) and 103 works by Akutagawa Works associated with 13 writers; one writer per student
Search class3.lx class4.lx (the same lemma set, plus counting by part of speech)
Record CSV rows 1–10 CSV rows 11–12 and your author’s values checked against authors.csv

1. Set up your author’s prepared corpus

If you have not yet done so, submit your class 2 worksheet dh-b-movement.json at the submission page. Keep the page open: sections 5 and 6 use it.

If you no longer have dh-b-movement.json, save the sample worksheet and load it with 「保存したワークシートを開く」 (open a saved worksheet) in the worksheet of class 2 section 2. Rewrite the evidence of all seven rows in your own words, change the labels of any row you judge differently, then save and submit the file. Do not submit a file whose evidence is still the sample’s.

Save your author’s ZIP from the table below into the class 2 working folder dh-b-2026. Extracting the ZIP creates the author’s folder, such as class4-akutagawa, containing akutagawa.lingcorpus and the other files. On a computer without ling, first follow Set up ling.

Start your terminal in the folder that contains dh-b-2026. Run the following commands; if you have already extracted the ZIP with your file manager, skip the unzip line.

cd dh-b-2026
unzip class4-akutagawa.zip
cd class4-akutagawa
ling corpus inspect akutagawa.lingcorpus

Replace class4-akutagawa.zip and class4-akutagawa with your author’s ZIP and folder names from the table below. Replace akutagawa.lingcorpus with the prepared corpus filename inside that folder. If inspect reports the number of works in the table and finishes with complete:, continue to the next section.

Author Folder name Works ZIP
森鴎外 (Mori Ōgai) class4-mori 31 13 MB
泉鏡花 (Izumi Kyōka) class4-izumi 31 15 MB
国木田独歩 (Kunikida Doppo) class4-kunikida 19 3 MB
夏目漱石 (Natsume Sōseki) class4-natsume 14 29 MB
岡本綺堂 (Okamoto Kidō) class4-okamoto-kido 43 10 MB
谷崎潤一郎 (Tanizaki Jun’ichirō) class4-tanizaki 22 13 MB
室生犀星 (Murō Saisei) class4-murou 15 3 MB
芥川龍之介 (Akutagawa Ryūnosuke) class4-akutagawa 70 10 MB
梶井基次郎 (Kajii Motojirō) class4-kajii 13 2 MB
堀辰雄 (Hori Tatsuo) class4-hori 16 5 MB
夢野久作 (Yumeno Kyūsaku) class4-yumeno 25 12 MB
岡本かの子 (Okamoto Kanoko) class4-okamoto-kanoko 25 7 MB
太宰治 (Dazai Osamu) class4-dazai 56 13 MB

The course uses a fixed selection of 380 works from Soranoha, grouped by 13 writers. The selection includes Kunikida’s translation of 「糸くず」 and Mori’s translations of 「冬の王」 and 「みれん」; works.csv records the original author and each writer’s role. The texts and bibliographic information come from the Soranoha release recorded in README.txt. Akutagawa’s selection contains 70 works, compared with 103 in class 3.

The first_published field preserves Soranoha’s first-publication information when available; year is extracted from that field and is blank when no year is recorded. Check the work’s Soranoha page before comparing publication periods.

In the ZIP Contents
<author>.lingcorpus The writer’s selected works analyzed with the novel UniDic, as a prepared corpus
works.csv The list of works (file, title, author, year, genre, source)
class4.lx Today’s pattern file
README.txt Versions of the tools and dictionary, and the selection rule
How do I follow along without a terminal?

Read these outputs, saved from the same corpora and pattern file. You cannot change their patterns, but you can compare authors and check passages against the source. The README lists the commands and versions used. The table over all 13 authors is authors.csv.

Author Saved output
森鴎外 Summary · Counts by work · 落ちる hits · 来る/行く passages
泉鏡花 Summary · Counts by work · 落ちる hits · 来る/行く passages
国木田独歩 Summary · Counts by work · 落ちる hits · 来る/行く passages
夏目漱石 Summary · Counts by work · 落ちる hits · 来る/行く passages
岡本綺堂 Summary · Counts by work · 落ちる hits · 来る/行く passages
谷崎潤一郎 Summary · Counts by work · 落ちる hits · 来る/行く passages
室生犀星 Summary · Counts by work · 落ちる hits · 来る/行く passages
芥川龍之介 Summary · Counts by work · 落ちる hits · 来る/行く passages
梶井基次郎 Summary · Counts by work · 落ちる hits · 来る/行く passages
堀辰雄 Summary · Counts by work · 落ちる hits · 来る/行く passages
夢野久作 Summary · Counts by work · 落ちる hits · 来る/行く passages
岡本かの子 Summary · Counts by work · 落ちる hits · 来る/行く passages
太宰治 Summary · Counts by work · 落ちる hits · 来る/行く passages

2. Count the vertical-movement lemmas in your author

class4.lx combines the vertical and deixis definitions from class 3 with pos, which counts tokens by part of speech. Each [...] is one token, and brackets written in a row match consecutive tokens. The key: line above a definition sets what summarize counts.

Definition in class4.lx Matches Counted by
pos := []. Every token upos, the part of speech
verbs := [upos=VERB]. Tokens whose part of speech is VERB lemma
vertical := [lemma in {上る, …}]. Tokens whose lemma is one of the 12 in the set lemma
deixis := (?<verb> [upos=VERB]) [lemma=て] (?<deictic> [lemma in {来る, 行く}]). Three consecutive tokens: a verb, て, then 来る or 行く The verb’s lemma and the 来る/行く lemma
The vertical definition: start, one token box with the lemma set, end

(?<name> ...) is a named capture: it gives the matched part a name that you can use later. In deixis, two parts have names.

Named part Lemma in key:
verb: the first verb token $verb.lemma
deictic: the final 来る/行く token $deictic.lemma

key: [$verb.lemma, $deictic.lemma] groups counts by the combination of these two lemmas.

The deixis definition: a verb token named verb, a て token, and a 来る/行く token named deictic in sequence
Does the pattern count compounds without て, such as 走り行く?

deixis counts only the three tokens verb, て, and 来る/行く. Compound verbs such as 走り行く and 帰り来る are analysed as one token with a one-word lemma such as 走り行く, so neither deixis nor [lemma=行く] matches them.

The following pattern counts one-token verbs whose lemma ends in 来る or 行く. 出来る and 心行く are excluded because they do not express movement.

key: [lemma]
deixis_compound := [upos=VERB & lemma ~ /(来る|行く)$/ & lemma not in {来る, 行く, 出来る, 心行く}].

The pattern is not complete. The two excluded lemmas may not be the only compounds without movement, and a compound that the analysis splits into two tokens does not match.

In the distributed corpora it matches 4 tokens for Akutagawa, 37 for Kunikida (deixis: 188), and 47 for Izumi (deixis: 525). State which pattern produced each count you report.

authors.csv was built from class4.lx so that all 13 authors are compared with the same set and the same denominator. Leave class4.lx as distributed. To run the set you revised in class 3, copy it to class4-mine.lx, edit the copy, and write class4-mine.lx beside every count taken from it.

ling check --patterns class4.lx
ling summarize --corpus akutagawa.lingcorpus --patterns class4.lx --top all > summary.txt
grep -w pos summary.txt | grep VERB
grep -w vertical summary.txt
grep -w vertical summary.txt | awk '{s+=$1} END {print s}'

The awk command sums and prints the counts from the first column, one per vertical lemma.

A vertical count is the number of tokens whose lemma is in the set, not the number of movements. In Akutagawa’s 「文章」 (Bunshō, “writing”; Akutagawa_R_Bunshou.md), 肉の落ちた (“thin”) matches 落ちる but describes a face, with no movement. The next command lists the first 40 落ちる hits with the file name, the sentence number within the work, and the surrounding text:

ling matches --corpus akutagawa.lingcorpus --tsv --context 8 --limit 40 --pattern '[lemma=落ちる].' | cut -f3,5,9-

Authors differ in the length of their works, so compare counts as a rate per 10,000 verbs. The rate is the vertical total divided by the VERB count, times 10,000. In Akutagawa’s 70 works, the vertical total is 406, the VERB count is 30,878, and the rate is 131.5.

  1. Calculate the vertical total, the VERB count, and the rate, and record them in your notes.
  2. Write down the top three vertical lemmas.
  3. Find one 落ちる hit in your author in which nothing moves, and write down its wording and file name.
  4. Compare the three values with your author’s row in authors.csv, columns verbs, vertical, and vertical_per_10k_verbs. If a value differs, write down which command gave the different count.
Your value Column in authors.csv
The VERB count verbs
The vertical total vertical
The rate, to one decimal place vertical_per_10k_verbs
落ちて来る, 落ちて行く (section 3) 落ちる_来る, 落ちる_行く
上って来る, 上って行く (section 3) 上る_来る, 上る_行く

3. Check how often verbs combine with 来る and 行く

grep -w deixis summary.txt | grep -E '上る|落ちる|下りる'

In Akutagawa’s 70 works, 落ちる combines with 来る 10 times and 行く once, and 上る combines with 来る 10 times and 行く 13 times. A pair absent from the output has a count of 0.

  1. Compare your author’s four counts with the authors.csv columns in the section 2 table.
  2. Does 落ちる also combine more frequently with 来る in your author? Write one sentence.

4. Choose a work and read two passages

ling matches --corpus akutagawa.lingcorpus --tsv --pattern '[lemma in {上る, 落ちる, 下りる}] [lemma=て] [lemma in {来る, 行く}].' | cut -f3 | sort | uniq -c | sort -rn | head
ling matches --corpus akutagawa.lingcorpus --where '@document.title = 杜子春' --tsv --context 12 --pattern '[lemma in {上る, 落ちる, 下りる}] [lemma=て] [lemma in {来る, 行く}].' | cut -f3,5,9-

The first command counts, per file, the passages in which 上る, 落ちる, or 下りる is followed by て来る or て行く: three consecutive tokens, as in Figure 3.

The section 4 pattern: a token from the three-lemma set, a て token, and a 来る/行く token

The second shows the passages of one work: the file name, the sentence number within the work, and the surrounding text. Replace akutagawa.lingcorpus with your corpus filename and 杜子春 with the title value of the chosen file in works.csv.

「杜子春」 (Toshishun) has four such passages. In Kunikida’s corpus, only 「少年の悲哀」 (Kodomo no kanashimi, “childhood sorrow”) (Kunikida_D_Kodomonokanashi.md) has two. When no work by your author has at least two such passages, run the second command without --where '@document.title = 杜子春' and choose passages from two works. Without a terminal, the saved 来る/行く passages file for your author lists the same output.

  1. Choose the file with the most passages, select two passages, and read the full paragraph containing each one: open the work’s reader link in works.csv and search for the wording shown by ling. The linked examples above open the relevant paragraph directly.
  2. Classify them with the same three judgments as in class 2 and add them as CSV rows 11–12. Write the work’s title in part and the wording shown by ling in expression. The other column values are those in the class 3 homework table.
  3. Write in your notes the file name and sentence number of each passage, who moves, and where the narrator watches from.

5. Compare the class’s results

authors.csv holds the section 2 and 3 values for all 13 authors.

The submission page shows the label distributions, deferrals, and pairwise agreement for rows 2–7, separately for direction and the movement judgment. Outlines mark the passages where your labels differ from the majority.

  1. Write down the authors with the highest and lowest rates per 10,000 verbs, and one possible reason based on the kind of work or the period.

  2. Write down any author whose works do not combine 落ちる with 来る more often than with 行く.

  3. Choose the row with the lowest agreement. Look in the submitted criteria list for a criterion that would resolve the disagreement for that row. If none does, write your own in the worksheet’s 「修正した基準」 (revised criterion) field.

    When you save and resubmit the file, the list updates within a minute. If the page is unavailable, or no submissions are listed yet, compare your labels in worksheet section 4 with a partner’s saved file or with the sample worksheet, and write a criterion for a row where the judgments differ in your notes. A comparison with the sample is agreement with one reading, not the class’s agreement rate.

The rate counts lemma hits, including hits like the one you noted in section 2, and depends on the dictionary’s decisions and on the choice of the vertical set. The selection includes children’s fiction and three translations, and first-publication information is incomplete. State these conditions whenever you describe a difference between authors.

6. Compare a model’s extractions with your labels

For the seven worksheet passages, compare your classifications with the results from rules, the LLM Qwen3.5-4B, and Perplexity Decider. For extraction from whole paragraphs, compare the results from rules, GLiNER2.5, and Qwen3.5-4B. The notebook displays saved results, so no model download is required. The following command installs only marimo. Its interface is in Japanese.

Unpack the extraction comparison notebook (ZIP) and keep all files together, including notebook-theme.css and the hidden .marimo.toml. Run this command from that folder and open the URL it prints in your browser. The notebook opens in a browser window. Keep the submission page open in another tab or window and switch between them in the steps below.

uvx --python 3.14 marimo==0.25.0 edit --no-sandbox movement-extraction.py

If uvx is not recognized, first install uv by following Run a course notebook.

  1. On the submission page, choose one passage with a wavy underline in the 規則 (rules), Qwen, or Decider column. The underline marks a method label that differs from the label most readers chose. If the page is unavailable or no passage is underlined, choose row 2, どこまでものぼって行けば, or row 5, 下りろ. In the saved results, Qwen’s movement judgment for these two rows differs from the example labels.
  2. Switch to the notebook window and open your dh-b-movement.json with 「第2回のワークシートを開く」 (open the class 2 worksheet). If it does not open, the supplied examples become the reference.
  3. In the notebook’s 「同じ箇所を分類する」 (classify the same passages), compare each method’s direction, movement judgment, actor, and supporting wording for that passage with your labels, and record the disagreement.
  4. In 「段落から探す」 (find in the paragraph), record whether each method found the worksheet expression and what else it extracted.

The notebook calculates agreement between your labels and each method’s output. Agreement shows consistency, not correctness. Seven passages, with rules written specifically for them, cannot establish accuracy on other passages.

For one disagreement, read the paragraph and record which case in the table below applies.

Qwen and Decider received instructions to use the narrator’s perspective, judge whether the movement itself occurs under negation or inability, and treat commands or conditions alone as insufficient evidence that movement happened. The rule-based method classifies by verb ending. 「方法の違い」 (differences between methods) at the end of the notebook summarizes each method.

Keep your worksheet file or notes open beside the notebook: it does not show the criterion you revised in class 2.

Case What to record
Your criterion and the model’s criteria differ The two criteria, and the wording to which each applies
The paragraph does not settle the judgment The wording that leaves it open
One side misread the paragraph The wording that decides it, and the label it supports
How do I run the models myself?

「選んだ段落で実行」 (run on the selected paragraph) needs an environment with the model libraries. Close the notebook and reopen it from the same folder with this command. In a notebook opened with --no-sandbox, 「実行する」 fails with an import error because the libraries are missing.

uvx --python 3.14 marimo==0.25.0 edit --sandbox movement-extraction.py

This command downloads a few hundred MB of libraries on first use. After you switch to 「選んだ段落で実行」 and press 「実行する」, the notebook downloads and runs the models; the first run downloads several GB. The steps for an NVIDIA or AMD GPU on Linux are the same as for the NER comparison, with movement-extraction.py in place of ner-comparison.py.

Exit note

Record these four items in your notes (.txt or .md) and submit the notes at the submission page.

What to save Contents
Your author’s values The three values and four counts, and whether they match authors.csv (sections 2 and 3)
Two passages CSV rows 11–12 (section 4)
A difference between authors One difference in rate or bias and a possible reason (section 5)
A disagreement with a model One passage, which of the three cases applies, and the supporting wording (section 6)

Homework: decide the question for your class 5 investigation

Allow 20–30 minutes. Submit the result at the submission page before class 5.

In class 5, an agent investigates the same question, and you check its claims with your own commands and the source. Record your own investigation first.

  1. Write one question about your author that corpus counts can answer, and your prediction, in the question and prediction fields of the evidence record. The submission page lists the questions and predictions from the submitted records. Example: in this writer’s selected works, does 落ちる combine with 来る more often than with 行く?
  2. Run two commands that answer the question, and record the commands, the output counts, and the unit counted (tokens, works, or per 10,000 verbs).
  3. Read one passage from the output in its full paragraph, and write one sentence on what the counts show and one on what they do not.
  4. Submit the CSV, including rows 11–12, and the evidence record at the submission page before class 5.

Search the course pages