In our little stylometric experiments, we compared different manga in terms of their hiragana frequencies. While we were able to say how similar or different the comics are to each other, it’s hard to tell in what way precisely they are different, i.e. which hiragana differed vastly in quantity and which were more or less the same. Intuitively, we ought to be able to answer this by looking at how much the hiragana counts differ from the average, but it would be good to have a more exact measure of what it means to differ “vastly” or to be “more or less” the same. If we could identify those hiragana in which the manga are hardly any different, we could ignore them in future experiments, which would be a relief since we’re otherwise stuck with as many as ~50 hiragana to keep track of.
Enter chi-squared (also called chi-square, or χ²), which is perhaps the most widespread of several statistical tests for this purpose. I first learned about it during my Master’s, but either I forgot about it or I had never really understood it in the first place. But now that I’ve looked it up again, I found it’s actually quite simple: the idea is to not only calculate the difference between the actual (observed) and the “average” (expected) value, but to square the result and then divide it by the expected value. The squaring has the effect to make large differences stand out more, while the division makes different chi-squared values comparable.
So, the formula would be:
(observed – expected)² / expected
[You might have seen this formula with a sum sign at the beginning: when you perform a “chi-squared test”, you take the sum of all calculated values and look it up in a table to determine whether your experiment is random or not (see below). In our case, it definitely isn’t.]
Let’s take the hiragana で de as an example. In our first 100-character sample from Katsuhiro Ōtomo’s Akira (A1), で de occurred 8 times (see the chart here). In the second Akira sample (A2), it is found 3 times. In the two manga samples from Morning magazine, Miko Yasu’s Hakozume (M1) and Rito Asami’s Ichikei no karasu (M2), で de is found 6 and 7 times, respectively. Overall, there are 24 で de in those four manga samples. The sum of all hiragana in these manga samples is 435 (so it turns out I took slightly more than 100 hiragana for each sample; don’t ask me why), which means that on average, で de should occur with a frequency of 24/435 = 0.0552. In other words, roughly every 19th hiragana in any of the four manga should be a で de. For the first of the two Akira samples, A1, which consists of 112 hiragana in total, the expected value for で de is 112 * 0.0552 = 6.18, i.e. we expect to find 6 or 7 で de in A1.
There actually are 8 で de in A1. That’s a difference of 8 – 6.18 = 1.82. Squared and divided by the expected value of 6.18, this results in a chi-squared value of 0.536.
Compare this to the frequency of で de in the other Akira sample, A2, where it occurs only 3 times, i.e. much less than one would have thought. Given a hiragana total of 106 for A2, we get an expected value of 106 * 0.0552 = 5.85. Accordingly, chi-squared for で/A2 is (3 – 5.85)² / 5.85 = 1.39.
However, our aim was to compare different hiragana, so let’s also calculate the chi-squared values for し shi, which occurs 7 times in A1, 1 time in A2, and 6 times in the other two manga, so the total for し shi is 14. Chi-squared for し in A1 is (7 – (14/435)*112)² / ((14/435)*112) = 3.199 and chi-squared for し in A2 is (1 – (14/435)*106)² / (14/435)*106 = 1.705.
As you can see, the chi-squared values for し shi are higher than for で de, which means that the former hiragana contributes more to the overall difference between A1 and A2 than the latter. In other words, the usage of で de throughout Akira is close to the average, thus comparatively unremarkable and perhaps not the most relevant stylometric property.
Here’s a chart of the chi-squared values for all 51 hiragana characters that occur in the four manga samples (click to enlarge):
One can easily see several spikes at the hiragana え e, ん n, と to and ず zu, though more important than the individual values are the sums, which are also high for お o and こ ko. These 6 hiragana alone contribute roughly 70% towards the overall sum of chi-squares! If our corpus was of a sufficient size (which it is definitely not), we could focus on these 6 hiragana in further experiments, as difference in hiragana usage among manga would be most likely connected to them.
In contrast, hiragana like び bi, く ku and に ni, with chi-square values close to zero, seem to have very little explanatory power over stylometric differences; their usage differs hardly among the four manga in question.
Of course, chi-squared can not only be applied to character counts in stylometry, but also to anything else that is countable. For instance, I recently mentioned the 1:1 gender ratio as a potential criterion for corpus building. One possible null hypothesis would be that good (or popular) comics are equally likely to be authored by men or by women. If we look at the 60 people who authored the top 10 comics from each of the last four years’ best-of lists (only counting the first-mentioned author when there are more than 3), we end up with 41 men and 19 women. This distribution isn’t quite the 30:30 we might have expected, but can it still be said to be roughly equal?
To answer this with the help of chi-squared, we calculate the two chi-squared values, one for male authors:
(41 – 30)² / 30 = 4.033
and one for female authors:
(19 – 30)² / 30 = 4.033
Now we add those two numbers together and look up the result in a table like this one. We need to use the first row as we have 1 “degree of freedom” in our essentially binary variable. There, our chi-squared sum of 8.07 lies between the p=0.01 and the p=0.001 column, meaning that the null hypothesis can be rejected with high confidence. In other words, the deviation of our sample from a 30:30 gender ratio is statistically significant. Of course, what exactly this gender bias means and where it comes from is another question.
In case all of this didn’t make any sense to you, there are many online tutorials on chi-squared which perhaps explain it better, among which I recommend this video by Paul Andersen on YouTube.
Some time ago, I attended a fascinating presentation about ELTeC (European Literary Text Collection), a multilingual corpus of novels. Such a corpus is not a new idea, but the way in which novels are chosen for inclusion in ELTeC is so thoughtful and transparent that Humanities scholars (and perhaps particularly art historians) might learn something from it. Because usually, they (i.e. we) don’t think much about which objects they select for an analysis, much less justify their choices, thus leading to an inaccurate or distorted representation of reality with little scholarly merit.
The ELTeC criteria for inclusion can be seen on the Summary Page that shows the texts included so far:
- language: the number of texts per language varies, but that is surely going to change; they seem to be capped at 100, and even languages with relatively few speakers such as Slovenian and Hungarian have reached this number already. Thus the project appears to strive for equal representation of all languages considered.
- male author / female author: some of the numbers show that ELTeC aims at a quota of either 50:50 (English) or 2:1 (German, French). In other cases the ratio of female authors is lower though.
- short/medium/long: probably based on word counts, the novels are divided into three categories of length. The idea was to represent all lengths equally, but this doesn’t seem to have worked out in all languages: e.g. only 8% of the Slovenian novels are ‘long’.
- year of first publication: most likely due to copyright restrictions, only novels published in or before 1920 are included in the corpus. The earliest date is 1840, but they plan to extend the corpus to earlier novels eventually. This 1840-1920 period is divided into four 20-year segments, and again the aim is to represent all segments equally – in French, for example, exactly 25 texts are included from each segment.
- frequent/rare: this criterion concerns the canonicity of the novels, as measured by the number of reprints. Both well-known and less widely known texts should be equally represented, although there doesn’t yet seem to be a strict rule in place how many reprints constitute a “frequent” or “rare” text.
For Comics Studies, a sampling approach based on these criteria is intriguing. As an example, albeit not actually a scholarly one, let’s look at the titles of the “best manga of 2016” reviews on this weblog, of which there are currently 11. So far, these manga have only been chosen for review because I happened to have been reading them (or meaning to read them) anyway, but what if I wanted to take a more systematic approach?
- language: of course they are all originally published in Japanese, but the starting point of my blogpost series was to find out which manga were popular according to English and German sources. Who knows, maybe completely different manga would surface when one turns to other parts of the world?
- male author / female author: the current ratio is 3 male mangaka to 8 female mangaka (including a team of two women). If I wanted to achieve a ratio more like 50:50, the next review should be about a manga authored by a man (spoiler: yes, it’s going to be).
- short/medium/long: instead of word counts, the number of tankōbon volumes per series should be a feasible measure of length (although my reviews only refer to one individual volume each). Based on the number of volumes published in Japan at the time of reviewing, the 3-quantiles of our current ‘corpus’ would be the following:
- short: 1-5 volumes
- medium: 7-13 volumes
- long: 15-29 volumes
That’s not terribly helpful though: what if there already is a bias in the current sample? A better way would be to calculate the quantiles from all manga published in 2016. That would be a lot of work, but maybe the picture would change quite a bit due to the consideration of long-running series such as One Piece (83 volumes by 2016), or a higher number of one-shots.
- time segments: while the manga are supposed to be from a single year, 2016, there is some leeway as sometimes the date of the American or German publication is the one that led to the inclusion of the manga in the “best comics of 2016 meta list”. The most extreme time lag is perhaps that of Goodnight Punpun (not yet reviewed here) which was originally published from 2007-2013; due to its American publication in 2016 it was included in that list (and even ranked within the top 20). As mentioned in an earlier blogpost, this focus on ‘2016’ is not so much about that particular year but more about getting an idea what manga in the 2010s were like. Perhaps it’s not worth the trouble to categorise them into such small time brackets though.
- frequent/rare: while the number of reprints would not be a suitable indicator for relatively new manga, one could complement the popular manga from the 2016 meta list with lesser-known ones that were ignored by English- and German-language media. I already did that, though not systematically: in fact, 6 out of the 11 manga reviewed were not ‘nominated’ by anyone as best manga of 2016 as far as I could see.
Regardless of the purpose of your corpus, the ELTeC criteria might help you detect biases. There’s no need to follow them religiously and strive for exact equality in all categories, but they are a good starting point for thinking about how you want to select the objects of your study. In other words: if there are e.g. no female authors in your corpus, you’d better be prepared to explain why.
Multivariate statistics: how to measure similarity between comics (or anything, really) based on several characteristicsPosted: December 18, 2019
In recent blogposts about stylometry (e.g. here), I skipped a bit of maths that, in hindsight, might be worth talking about. As it turns out, it’s actually both highly useful and easy to understand.
The examples used here are going to be the same as in the aforementioned post, i.e. 2 scenes from Katsuhiro Ōtomo’s Akira (vol. 5, p. 16 ff, which we’ll call A1, and vol. 3, p. 125 ff, which we’ll call A2) and 2 manga chapters from the October 11, 2018 issue of Morning magazine, Miko Yasu’s Hakozume (M1) and Rito Asami’s Ichikei no karasu (M2).
Let’s say you want to compare these 4 comics based on 1 variable, e.g. the frequency of the hiragana character で de. (Which is not the most realistic stylometric indicator, but it will make more and more sense with an increasing number of variables.) Nothing easier than that. First, here are the numbers of で de per 100 hiragana for each text:
- A1: 8
- A2: 3
- M1: 6
- M2: 7
By simply subtracting the numbers from each other, we get the difference between any pair of manga and thus their similarity. Ranked from smallest difference to largest, these would be:
- A1/M2: 1
- M1/M2: 1
- A1/M1: 2
- A2/M1: 3
- A2/M2: 4
- A1/A2: 5
So the two Morning manga and one of the Akira scenes can be said to be similar, while the other Akira scene is the odd one out.
With 2 variables, it gets more interesting. Let’s assume you decide that the similarity of these manga is best based on their use of the hiragana で de and い i. The frequencies for the latter are:
- A1: 7
- A2: 8
- M1: 3
- M2: 2
On a side note, at this point it might be a good idea to think about normalisation: are the numbers of the two variables comparable, so that a difference of e.g. “2” carries the same weight for both characteristics? In our example, this is not a problem because we’re dealing with two hiragana frequencies measured on the same scale, but if your two variables are e.g. the total number of kana characters per chapter and the shoe size of the author, the former will probably have much more impact on the similarity scores than the latter, because the range of numbers is wider – unless you adjust the scale of the variables. Except if this different impact was precisely what you wanted.
To calculate the distance between any two of these points (i.e. the similarity of two manga), you’ll probably want to use Pythagoras and his a² + b² = c² formula, a.k.a. the Euclidean distance, with ‘a’ and ‘b’ representing the horizontal and vertical distances and ‘c’ being the diagonal line we’re looking for. There’s nothing wrong with that, but it might suprise you that in actual statistics and stylometrics, there are several other ways of measuring this distance. However, we’re going to stick with good old Pythagoras here.
The distance between A1 (で de: 8 / い i: 7) and A2 (3/8), for instance, would be the square root of the sum of (8-3)² and (7-8)², which is approximately 5.1. All distances, ranked from lowest to highest, would be (rounded to one decimal):
- M1/M2: 1.4
- A1/M1: 4.5
- A1/A2: 5.1
- A1/M2: 5.1
- A2/M1: 5.8
- A2/M2: 7.2
Now the two Akira excerpts appear to be more similar than before when the similarity was only based on the frequency of で de, and the similarity between the two Morning manga is greater than that between the first Akira excerpt and either of the two Morning manga.
Just as you imagine two points in 2-dimensional space forming two corners of a right-angled triangle (see above), in 3-dimensional space you have to image a rectangular cuboid – a ‘box’ (see the illustration on Wikipedia). Apparently, how to calculate the distance between the two opposite corner points of a cuboid is something you learn in high school, but I couldn’t remember and had to look it up. The formula for distance ‘d’ is: d² = a² + b² + c².
As our third variable, we’re going to use the frequency of the hiragana し shi. In the following list, the number of し shi per 100 hiragana is added as the third coordinate to each manga:
- A1 (8/7/7)
- A2 (3/8/1)
- M1 (6/3/1)
- M2 (7/2/5)
For instance, the distance between A1 and A2 is the square root of: (8-3)² + (7-8)² + (7-1)², i.e. roughly 7.9. Here are all the distances:
- M1/M2: 4.2
- A1/M2: 5.5
- A2/M1: 5.8
- A1/M1: 7.5
- A1/A2: 7.9
- A2/M2: 8.2
As we can see, the main difference between this similarity ranking and the previous one is that the similarity between the two Akira scenes has become smaller.
You might have guessed it by now: even though it gets harder to imagine (and even more so to illustrate) a space of more than 3 dimensions, we can apply more or less the same formula regardless of the number of variables. We only need to add a new summand/addend for each new variable. For 4 variables, the distance between two points would be the square root of (a² + b² + c² + d²). These are the distances if we add the hiragana て te (which occurs 7 times per 100 hiragana in A1, 2 times in A2, 6 in M1, 4 in M2) as the 4th dimension:
- M1/M2: 4.7
- A1/M2: 6.2
- A2/M1: 7.1
- A1/M1: 7.5
- A2/M2: 8.5
- A1/A2: 9.3
Note how the changes become smaller now – apart from the last two pairs having swapped places, the similarity ranking is the same as before.
So how about 25 hiragana frequencies? This is more than half of all the different hiragana in our (100-hiragana samples of the) four manga. I added 21 random hiragana (see the graph) to the 4 from the previous section, and these are the resulting distances:
- A1/M2: 9.7
- A2/M1: 11.0
- A1/A2: 12.5
- M1/M2: 13.0
- A2/M2: 13.3
- A1/M1: 14.7
Who would have thought that? Now it looks as if the ‘scientists’ scene from Akira (A1) is similar to Ichikei no karasu (M2), and the ‘insurgent thugs’ scene from Akira (A2) is similar to Hakozume (M1). Which is what we suspected all along. So who knows, maybe we can do away with all this maths stuff after all? However, the usual caveat applies: proper stylometry should really be based on larger samples than 100 characters per text.
The Flesch reading-ease score (FRES, also called FRE – ‘Flesch Reading Ease’) is still a popular measurement for the readability of texts, despite some criticism and suggestions for improvement since it was first proposed by Rudolf Flesch in 1948. (I’ve never read his original paper, though; all my information is taken from Wikipedia.) On a scale from 0 to 100, it indicates how difficult it is to understand a given text based on sentence length and word length, with a low score meaning difficult to read and a high score meaning easy to read.
Sentence length and word length are also popular factors in stylometry, the idea here being that some authors (or, generally speaking, kinds of text) prefer longer sentences and/or words while others prefer shorter ones. Thus such scores based on sentence length and word length might serve as an indicator of how similar two given texts are. In fact, FRES is used in actual stylometry, albeit only as one factor among many (e.g. in Brennan, Afroz and Greenstadt 2012 (PDF)). Over other stylometric indicators, FRES would have the added benefit that it actually says something in itself about the text, rather than being merely a number that only means something in relation to another.
The original FRES formula was developed for English and has been modified for other languages. In the last few stylometry blogposts here, the examples were taken from Japanese manga, but FRES is not well suited for Japanese. The main reason is that syllables don’t play much of a role in Japanese readability. More important factors are the number of characters and the ratio of kanji, as the number of syllables per character varies. A two-kanji compound, for instance, can have fewer syllables than a single-kanji word (e.g. 部長 bu‧chō ‘head of department’ vs. 力 chi‧ka‧ra ‘power’). Therefore, we’re going to use our old English-language X-Men examples from 2017 again.
The comics in question are: Astonishing X-Men #1 (1995) written by Scott Lobdell, Ultimate X-Men #1 (2001) written by Mark Millar, and Civil War: X-Men #1 (2006) written by David Hine. Looking at just the opening sequence of each comic (see the previous X-Men post for some images), we get the following sentence / word / syllable counts:
- AXM: 3 sentences, 68 words, 100 syllables.
- UXM: 6 sentences, 82 words, 148 syllables.
- CW:XM: 7 sentences, 79 words, 114 syllables.
We don’t even need to use Flesch’s formula to get an idea of the readability differences: the sentences in AXM are really long and those in CW:XM are much shorter. As for word length, UXM stands out with rather long words such as “unconstitutional”, which is reflected in the high ratio of syllables per word.
Applying the formula (cf. Wikipedia), we get the following FRESs:
- AXM: 59.4
- UXM: 40.3
- CW:XM: 73.3
Who would have thought that! It looks like UXM (or at least the selected portion) is harder to read than AXM – a FRES of 40.3 is already ‘College’ level according to Flesch’s table.
But how do these numbers help us if we’re interested in stylometric similarity? All three texts are written by different writers. So far we could only say (again – based on a insufficiently sized sample) that Hine’s writing style is closer to Lobdell’s than to Millar’s. The ultimate test for a stylometric indicator would be to take an additional example text that is written by one of the three authors, and see if its FRES is close to the one from the same author’s X-Men text.
Our 4th example will be the rather randomly selected Nemesis by Millar (2010, art by Steve McNiven) from which we’ll also take all text from the first few panels.
These are the numbers for the selected text fragment from Nemesis:
- 8 sentences, 68 words, 88 syllables.
- This translates to a FRES of 88.7!
In other words, Nemesis and UXM, the two comics written by Millar, appear to be the most dissimilar of the four! However, that was to be expected. Millar would be a poor writer if he always applied the same style to each character in each scene. And the two selected scenes are very different: a TV news report in UXM in contrast to a dialogue (or perhaps more like the typical villain’s monologue) in Nemesis.
Interestingly, there is a TV news report scene in Nemesis too (Part 3, p. 3). Wouldn’t that make for a more suitable comparison?
Here are the numbers for this TV scene which I’ll call N2:
- 4 sentences, 81 words, 146 syllables.
- FRES: 33.8
Now this looks more like Millar’s writing from UXM: the difference between the two scores is so small (6.5) that they can be said to be almost identical.
Still, we haven’t really proven anything yet. One possible interpretation of the scores is that the ~30-40 range is simply the usual range for this type of text, i.e. TV news reports. So perhaps these scores are not specific to Millar (or even to comics). One would have to look at similar scenes by Lobdell, Hine and/or other writers to verify that, and ideally also at real-world news transcripts.
On the other hand, one thing has worked well: two texts that we had intuitively identified as similar – UXM and N2 – indeed showed similar Flesch scores. That means FRES is not only a measurement of readability but also of stylometric similarity – albeit a rather crude one which is, as always, best used in combination with other metrics.
I ended my blogpost on hiragana frequency as a stylometric indicator with the remark that, rather than the frequency distribution of different hiragana in the text, the ratio of kana to kanji is used as one of several key characteristics in actual stylometric analysis of Japanese texts. I was curious to find out if this number alone could tell us something about the 4 manga text samples in question (2 randomly selected scenes from Katsuhiro Ōtomo’s Akira and 2 series from Morning magazine, Miko Yasu’s Hakozume and Rito Asami’s Ichikei no karasu – in the following text referred to as A1, A2, M1 and M2, respectively). My intuition was that the results wouldn’t be meaningful because the samples were too small, but let’s see:
This time I chose a sample size of 200 characters (hiragana, katakana, and kanji) per text.
Among the first 200 characters in A1 (i.e. Akira vol. 5, p. 16), there are 113 hiragana, 42 katakana and 45 kanji. This results in a kanji-kana ratio of 45 : (113 + 42) = 0.29.
In A2 (Akira vol. 3, pp. 125 ff.), the first 200 characters comprise of 126 hiragana, 34 katakana, and 40 kanji, i.e. the kanji-kana ratio is 0.25.
In M1, there are 122 hiragana, 9 katakana, and 69 kanji, resulting in a kanji-kana ratio of 0.52.
In M2, there are 117 hiragana, 0 katakana, and 83 kanji, resulting in a kanji-kana ratio of 0.71!
Thus this time the authorship attribution seems to have worked: the two Ōtomo samples have an almost identical score, whereas those of the two Morning samples are completely different. Interestingly, this result contradicts the interpretation from the earlier blogpost in which I had suggested that the scientists in Akira and the lawyers in Karasu have similar ways of talking. The difference in the kanji-kana ratio between Akira and the two Morning manga, though, is explained not only through the more frequent use of kanji in the latter, but also through the vast differences in katakana usage (note that only characters in proper word balloons, i.e. dialogue, are counted, not sound effects).
Ōtomo uses katakana for two different purposes: in A1 mainly to reproduce the names of the foreign researchers, and in A2 to stretch syllables otherwise written in hiragana at the end of words, e.g. なにィ nanii (“whaaat?”) or 何だァ nandaa (“what is iiit?”). Therefore the similarity of the character use in the two Akira samples is superficial only and the pure numbers somewhat misleading. On the other hand, it makes sense that an action-packed scene such as A2 contains less than half as many kanji as the courtroom dialogue in M2; in A2 there are more simple, colloquial words for which the hiragana spelling is more common, e.g. くそう kusou (“shit!”) or うるせェ urusee (“quiet!”), whereas technical terms such as 被告人 hikokunin (“defendant”) in M2 are more clearly and commonly expressed in kanji.
In the end, the old rule applies: only with a large number of sample texts, with a large size of each sample, and through a combination of several different metrics can such stylometric approaches possibly succeed.
The other day I’ve been made aware that some things I’ve said in an earlier blogpost, “Author dictionaries and lexical analysis for comics”, might be misleading. So let’s be clear: if you would like to find something out about the writing style of an author or text, it’s not the best idea to look at the frequently used nouns, kanji, or other units of high semantic content. Those are more useful for analysing the content, i.e. the topic(s), of texts. In stylometry, units with low semantic content, such as function words (the, a, it, etc.), are more attractive objects of study, as they can be used almost independently of the topic and often present writers with a choice of which word to use when. In other words, the same writer tends to use the same function words and may be identified by them. (In practice, though, a combination of different characteristics is used for analysis – see the Stylometry article at Wikipedia and the references there.)
In order to automatically separate function words from content words in a digital text, part-of-speech tagging software may be employed. For Japanese, there is e.g. Kuromoji. But isn’t there a simpler way? Can’t we make use of the kanji–kana distinction used in the aforementioned earlier blogpost? If we identified kanji as the semantically rich(er) units, wouldn’t it be sufficient to focus on the kana for stylometric analysis? Maybe, maybe not. The results would probably be poorer, due to two main reasons:
- Every content word (noun, verb, adjective), even if usually written in kanji, may also be written in kana. For instance, 分かる (to understand) is more frequently spelled in hiragana only, わかる. So when we gather kana from a text, we might end up with unwanted content words.
- In flection suffixes, hiragana are dependent on the preceding kanji, and thus ultimately on the content of the text. For instance, a text on musical performance might contain many instances of the verb 引く hiku (to play an instrument), so one can expect the hiragana か ka, き ki, く ku, け ke and こ ko to occur more frequently than in other texts, as they are used for inflecting 引く.
That being said, why don’t we put this kana analysis method to the test anyway? Let’s take the example from Akira vol. 5, p. 16 again in which the scientists are talking (初めまして。スタンリー・シモンズ博士です etc.). We’ll focus on hiragana and ignore katakana, as they tend to be used for nouns too. Starting from those two panels, I manually counted these and the following hiragana until I reached 100. Here are the 5 most frequent hiragana in this set:
- de: 8
- i: 7
- shi: 7
- te: 7
- no: 6
That means, if this was a sufficiently large sample, in any other piece of text by Ōtomo, or at least within Akira, roughly 8% of its hiragana should be de, 7% should be i, etc. So I randomly picked another scene from Akira (vol. 3, p. 125 ff) and looked at the first 100 hiragana there. The 5 most frequently used hiragana from the previous example are used less often here, with the exception of i:
- de: 3
- i: 8
- shi: 1
- te: 2
- no: 3
In these pages in vol. 3, we find mainly other hiragana such as tsu (9 times – including small tsu), ga (6 times), o (5 times) and su (5 times) to be the most frequently used. That, however, doesn’t tell us anything yet about the similarity of these two pieces of text (which I’m going to call “Akira 1″ and “Akira 2″ from here on). We need to add a third example, and for this purpose I’m going to use 100 hiragana from Miko Yasu’s Hakozume from the recently reviewed Morning magazine. If our method is successful, the differences between Hakozume and each of the two Akira scenes should be larger than those between Akira 1 and Akira 2. With frequency values for approximately 50 distinct hiragana we now have 3 × ~50 data points on which we could unleash the whole range of advanced statistical methods. But we’ll keep things simple by simply adding up the differences in frequencies: Hakozume contains only 6 instances of de, i.e. 2 less than Akira 1; Hakozume uses 3 times i as opposed to the 7 in Akira 1, i.e. 4 less; Hakozume contains 6 instances of shi less than Akira 1; etc. Here’s the table of frequencies of de, i, shi, te and no in Hakozume:
- de: 6
- i: 3
- shi: 1
- te: 6
- no: 8
The combined difference between Hakozume and Akira 1 for these 5 hiragana would be 2+4+6+1+2 = 15. For all ~50 different hiragana, the sum is 96.
This looks like a large number, and indeed, when we calculate the difference between Akira 1 and Akira 2 in this way, the result is 82. This means, the two Akira chunks are more similar in their usage of hiragana than Hakozume and Akira 1.
However, we’re not done yet. We still need to compare Hakozume to Akira 2. The result of this comparison may come as a surprise: the sum of differences is also 82! So Akira 2 is as similar to Hakozume as it is to Akira 1. If our goal was to find out whether a given piece of text is taken from Akira or not, our method would fail if we used Akira 2 as our base text with which to compare all others.
Just to make sure, I took another 100 hiragana from a different random manga in the same issue of Morning, Rito Asami’s Ichikei no karasu. I’ll refer to Ichikei no karasu as Morning 2 from now on, and to Hakozume as Morning 1. The results of the comparisons are even ‘worse’: while the sum of differences between Morning 2 and Akira 2 is 98 – i.e. vastly different – the difference between Morning 2 and Akira 1 is only 74, i.e. very similar.
In a way, the results do make sense though. We’re looking at dialogue, after all, and the way scientists (in Akira 1) speak is closer to that of lawyers (in Morning 2) than that of insurgent thugs (in Akira 2). And apparently, the conversation between the two policewomen (in Morning 1) is not quite unlike the latter.
As ever so often we could now blame the unsatisfactory results on the small sample size – if we had used chunks of 1000 hiragana instead of 100, surely our attribution attempts would have been more successful? We’ll never find out (unless we obtain a complete digital copy of Akira and extract the hiragana automatically). Another way to improve results would be to tweak the methodology: using data mining algorithms, more elaborate metrics such as co-occurrence of several hiragana could be employed. In actual stylometric research, hiragana seem to be used in yet another metric – the ratio of all hiragana to all other characters (kanji, katakana, rōmaji).
Every once in a while I learn something at my day job that I think would be applicable to comics research too. For instance, in literary studies, dictionaries are compiled that contain all the words (or only the nouns, similar to an encyclopedia) used by a particular author, or even only those used in one single literary text. Think of it as a sort of commentary in a critical edition which explains references to real-world entities, or obscure words that aren’t used anymore, only separate from the source text and organised alphabetically.
Applying this method to comics, we would, of course, ignore all the images and lose the information they convey. On the other hand, looking at the words alone might yield interesting results. For instance, by comparing the frequency of words used in a particular comic to the frequency with which they occur in written language in general, we could test common hypotheses such as “author X uses word Y a lot”.
For comics of more than a few pages length, it would be nice to automatically create a list of all the words in digital form (at least those in speech/thought bubbles and captions – sound effects and inscriptions/labels can be difficult to automatically recognise). Unless a script for the comic you’re interested in is already available, a straightforward (though not necessarily easy) way to get such a list would be to obtain digital images (e.g. scans) of the pages of the comic, then run Optical Character Recognition (OCR) software on them.
As an example, consider these two panels from Akira, in which a scientist is introduced to some colleagues:
The OCR software www.onlineocr.net recognises the text in the five speech bubbles like this:
As far as I can see, only two mistakes (ノレ instead of ル and ですノ instead of です) were made. Instead of focusing on nouns (for which there probably are detecting algorithms for Japanese), it’s easier for now to just look at the kanji and filter out all hiragana and katakana characters. (While you can’t simply say that kanji represent nouns and kana represent other parts of speech, the idea here is that kanji tend to carry more semantic information than kana, which are often only used as flection suffixes.) That leaves us with the six kanji 初, 名, 前, 博, 士, and 初 again.
We can look up their frequency with which they occur in Japanese language in general, e.g. the frequency rank at WWWJDIC:
- 前: 27
- 初: 152
- 名: 177
- 士: 526
- 博: 794
i.e. 前 is the most frequent of the five, 博 the least frequent. Compare these ranks to the frequency with which they occur in our slim sample of two panels:
- 初: 33% of all kanji
- 前, 名, 士, 博: 17% each
What we can see here, if anything, is that two kanji, 士 and 博, are significantly more often used by Katsuhiro Ōtomo than by the average Japanese author. This doesn’t come as a surprise, as the compound 博士 signifies the academic title ‘Dr.’, which is the appropriate form of address for the scientists in this scene, whereas the other kanji 前, 初 and 名 are linked to names and introductions in general, and thus more often used in standard Japanese.
However, even if the frequency of 士 and 博 remained above-average if we analysed all of Akira‘s over 2000 pages, that wouldn’t necessarily mean we had discovered a lexical characteristic of Ōtomo’s writing style. What it would tell us is that there is a subplot about scientists in Akira. Of course, topic analysis based on word frequency is nothing new. More interesting from a formal-lexical point of view would be if we discovered kanji used in different frequencies than we would expect with regard to the subject matter treated in Akira. In this situation it might be useful to look at synonyms: when Ōtomo had several options to express the same thing, why did he choose some words over others?
For instance, on the same page as the example above, the relatively infrequent (rank 920) kanji 栄 is used as part of the word “honour” in the expression “I’m honoured to meet you”. Instead, Ōtomo could have used the phrase “nice to meet you” for a third time, using the kanji 初 again, but he didn’t. Suppose there was a significant number of further instances of 栄 in Akira, maybe that would be a formal-stylistic choice, rather than one merely implied by the content of the comic?
I’m aware that all this is very hypothetical, and that looking at just a few panels doesn’t show anything, but if I wanted to analyse a comic in this way, I would basically go on about it as described here, only with more scans. If you would like to learn more about this kind of analysis, I recommend Allen Riddell’s tutorial on “Feature selection: finding distinctive words”.
Out of the many authors who publish on comics, Frederik L. Schodt is one of the few with a truly distinct writing style – neither academic nor fannish, neither highbrow nor colloquial, his writings are full of rather obscure words, some of which I have never seen anywhere else. Recently I re-read the beginning of his book Dreamland Japan, and while doing so, just for fun,* assembled this list of my favourite eccentric words therein and their meanings (as far as I could find out):
to accord – p. 19: “Japan is the first nation in the world to accord ‘comic books’ […] nearly the same social status as novels and films.” – to grant, to give.
bone-crushing – p. 28: “Yet along with this celebration of the ordinary is the bone-crushing reality that the vast majority of manga border on trash.” – back-breaking, depressing (cf. German: ‘erdrückend’).
hari-kari – p. 11: “in due time both words [manga and anime] will undoubtedly be listed in the standard English dictionary along with other Japanese imports like ‘hari-kari’ and ‘karaoke.'” – variant of harakiri (ritual suicide).
finicky – p. 13: “In Japan, people’s names are usually listed with the family name first and the given name last. Certain academic types in the English-speaking world are rather finicky about this convention and insist on preserving it even in English texts” – difficult to please, demanding.
to flounder – p. 34: “Japanese people have floundered about trying to the right term to describe the sequential picture-panels that tell a story.” – to struggle.
full-figured – p. 26: “Japanese manga offer far more visual diversity than mainstream American comics, which […] still reveal an obsession with muscled males and full-figured females” – according to Wiktionary, ‘full-figured’ means ‘fat’ or ‘plump’, but here it’s probably used in the sense of ‘curvaceous’ or ‘voluptuous’.
persnickety – p. 14: “Fans of Japanese manga (even more than academics) can be a rather persnickety and unforgiving lot” – see finicky.
profuse – p. 15: “Profuse thanks are offered to all who helped.” – plenty, abundant.
raga-like – p. 14: “[…] with raga-like stories that may continue for thousands of pages” – maybe Schodt means, ‘as lengthy as an Indian epic (raga)’?
satori-like – p. 21: “his face lit up in a satori-like realization” – (Buddhist) enlightenment.