PE-06 Keyword in context (KWIC; concordance)
List every occurrence of a keyword or phrase with a fixed number of surrounding words, giving a table of document, position and context.
What it does
Lists every occurrence of a keyword or phrase with a fixed number of surrounding words. Artefact: a table of document, position, preceding words, keyword and following words. Read how the term is used and whether use differs by source or period.
When to use it
Use when a frequent or surprising term needs checking for how it is used before it is counted or coded.
When it does not fit
Use it to check what a frequent or surprising term means before counting it. It is a reading aid, not a measurement. Reading only the first matches is the common misuse.
Result format
The result is a table with one row per occurrence of the keyword, giving the document, the position, the preceding words, the keyword and the following words. It ends with a statement of how the term is used and whether use differs by source or period.
Requirements on the material
| Property | Requirement type | Requirement |
|---|---|---|
| Structure | Applies in some cases | requires=unstructured; requires=semi-structured |
| Content type | Always applies | requires=text |
| Unit of analysis | Always applies | requires=document |
| Appraises source credibility | Applies in some cases | no |
Not restricted on: Variable types, Time structure, How the sample was chosen, Level of detail available, Number of sources, Whether sources can be joined, Amount of material, Known data problems, Producer interest, Source dependence, Origin, Document genre, Language, Personal information, Security classification, Licence.
| Minimum material | none |
|---|---|
| Additional sources needed | none |
| Not for (rules) | none |
| Not for (text) | The context table is used as a measurement of frequency or sentiment, or only the first matches are read. |
Choosing and ordering
| Kind of technique | Preparation technique, runs in step 5.2 |
|---|---|
| Phase tag | verify and prepare |
| Other phase tags | analyse |
| Kind of finding | pattern |
| Question answered | what |
| Strongest statement it supports | describe |
| Needs as input |
|
| Makes as output |
|
| Must exist first | None |
| Loop target | proceed with limit stated |
Library checks by stakes
Each stakes level includes the checks of the level below it. Checks that need a person apply at high stakes only, so the process leaves them out at lower stakes (decision 38). Repeatability: deterministic.
| Stakes | Check | Person involved | Counts as a different method |
|---|---|---|---|
| exploratory | input validation | none | no |
| decision-informing | input validation | none | no |
| decision-informing | spot check | optional | no |
| decision-informing | human review sample | needed; left out below high stakes | no |
| high-stakes | input validation | none | no |
| high-stakes | spot check | optional | no |
| high-stakes | human review sample | needed | no |
| high-stakes | independent review | needed | no |
| high-stakes | source-span citation | none | no |
Failure modes and limits
| Model suitability | model plus code |
|---|---|
| Typical model failure | Reads only the first few matches and reports a pattern of use for the whole corpus. |
| Error sources | input data; data transformation |
| Certainty limits | Certainty about usage drops when only part of the matches are read (reporting bias) or when the window is too short to show meaning (indirectness). |
Related techniques
- pairs with PE-07 Collocation and n-gram extraction (phrase detection; association measures): collocations suggest the terms whose use should be read in context
- pairs with MM-07 Supervised classification and dictionary methods (text classification; fine-tuned classifier; lexicon method): reading dictionary terms in context checks that they carry the intended meaning
Evidence and tag basis
Documented. In the quanteda software the default window is 5 words, and the pattern can be a phrase, wildcard or regular expression. (quanteda kwic reference)
Tag basis: input profile inference; selection inference; sequencing inference; robustness inference. All tag values are inference unless a source is named.