Lesson 8.1
Corpus Linguistics
Dictionary, collection, corpus
BootCat
AntConc
A normal person collects texts to read them.
A linguist collects texts so that it is easy to pull them apart.
Vladimir Plungian
Liguist (his interview)
Dictionary, collection, corpus
Dictionaries are systematized lists of lexical information consisting of individual vocabulary items. They are differentiated by:
  • vocabulary units — words, word combinations, etc.;
  • structure;
  • coverage of vocabulary — general vocabulary or some problem area;
  • TheFreeDictionary (many languages).

Text collections — a set of texts that can be analyzed.

Text corpus — a collection of texts gathered according to a certain principle of representativeness (by genre, author affiliation, etc.), in which all texts are marked up, i.e. provided with some linguistic markings (annotations) — morphological, accentual, syntactic, etc.

Another definition:
Corpus — a set of texts collected and processed according to the necessary rules and used as a basis for language study. A corpus is used in statistical analysis and for testing hypotheses, studying linguistic rules in a language.

Often, for brevity, collections of texts from the Internet are referred to as web corpora or simply corpora.





Methods of working with corpora:
  • concordance compilation;
  • calculation of absolute frequency of words;
  • keyword analysis;
  • cluster analysis.

Concordance is a list of all uses of a particular linguistic expression in context and citing the source when appropriate.

The results of the analysis allow us to understand:
  • the typical context of use and sentiment of the word;
  • tendency to form idioms and speech turns;
  • limitations: in terms of position in the sentence, meaning, forms and word compatibility.
BootCat
Gathering a text collection
We will work with two programmes:
  • BootCat — Bootstrap Corpora And Terms — fast collection of texts, which can be found in the first search results on Google pages.
  • AntConc — ANalysis Toolkit for CONCordancing and text analysis — programme for text analysis: most frequent words and collocations.

Other computational linguistics tools can be found here. And here are the AntConc tutorials made by its creator.

BootCat allows you to quickly and without programming gather a collection of texts from the Internet on a topic of interest to you.

Procedure:
  1. Next.
  2. Name your collection and select a language for it — in such way will be called the folder, where all the texts will be gathered.
  3. Now you need to choose the way of gathering:
  • Simple Mode — searching and gathering by keyword combinations; the most effective, will most definitely work;
  • Custom Tuples — searching and gathering by prewritten keyword combinations;
  • Custom URLs — collection from your links; works poorly because some sites block collection and others have incorrect html tags.;
  • Local files — collection from previously saved files;
  • Local queries — collection from previously saved search queries.
4. Let's say we've selected ​Simple Mode. Next, we select a search engine. I have only one option: External Browser (Google).




5. Enter N keywords, one word on each line.
6. Generate tuples — this will create different combinations of the entered keywords.
7. Refine the settings, such as excluding some domains from the collection or changing the number of links to be returned for each keyword combination.
8. Generate queries — generate queries from keyword combinations.
9. Open All in Browser — pages with search results for the generated queries will open in your browser. A pop-up window will appear to tell you where to download them.
10. Manually save all opened html pages to the queries subfolder of the project folder.
11. Collect URLs — gathering all the links from there.
12. If necessary, uncheck the unnecessary links. In the Retrieved URLs field we can see how many links were collected. In the Selected URLs field you can see how many links were selected for collection.
13. Next
14. Build corpus.
15. Finish.
16. Check whether everything was successfully collected in the project folder in the corpus subfolder. There should be a lot of .txt files there.

If there are very few text files collected, look at the file report.xlsx. If Status becomes CANNOT_PARSE after the first few lines, you are blocked by the search engine. This can be solved in python, but in BootCat you can only accept it and start the collection again.
AntConc
Programme for text analysis
  1. Load the corpus into the program via Open.

2. See if the texts have loaded correctly by clicking on one of them and clicking on File View.

3. To see the frequency of words in the corpus, go to Word, see the most popular words and their Freq (frequency)

Word — individual tokens (words) with the calculated frequency. We load exceptions (stop words) via Settings → Global Settings → Tool Filters → → Hide words in file → Apply.​

4. File View
  • normal search by text in a particular file, not in the whole corpus




5. Clusters — find a word or pattern in the corpus and group (cluster) them with the words on the left and right, and then rank the results by frequency. You can edit:
  • cluster size;
  • minimum frequency;
  • the minimum number of files in which this combination occurs (range).

6. N-Gram — counts the frequency of combinations of N number of words; an alternative to Cluster. Unlike Cluster, there is no need to enter a search keyword here. If n = 2, and the text is “This is an apple”, the tool will count the frequency of “This is”, “is an” and “an apple”. Also, there is no distinction here between right and left search. You can also use open slots — blank spaces, where can be put any word which we don't know in advance (for n = 3 and more).

7. Collocate — allows you to find words that often occur in close association (collocation) and look at the strength of the connection between them. Can search at a distance.
Keyword List
Keyword List allows to find words that are particularly frequent for a given corpus and yet rarely occur in the control corpus (reference).

Or on the contrary, occur too rare — for this you need to select the negative option in Tool Settings.



To use this feature, you need to load the control corpus via File → Corpus Manager.

Example of usage: to determine how the writer's style has changed in old age. To do this, it is necessary to compare the works for the last years of life with the works for all the years of creativity.
Concordance
KWIC (Key Word In Context) — allows you to find a word or phrase in the corpus and analyze the context of use.

1. You can edit the size of the context provided below in the field Context Size. So, “100” in this field would mean “find and display 100 characters to the left and one hundred characters to the right of the word or expression found.”

2. Below Sort Options — allows you to sort alphabetically by a few words next to the word you are looking for, and it helps you see patterns in the usage of that word
  • word number and direction: R Right or L Left, only three levels + press the button Sort.

3. To see where a found result occurred in the full text, just double click on it by the main highlighted word.

4. Above in Total Hits — how many cases of use were found.

5. If you add an asterics (*) after the word report, you will also find reported, reportedly, reporting etc.

6. В Search Query
  • no check marks — we search by a string (text), can be a sequence of characters including in the center of the word.
  • Words — by words, you can use * to include any word ending in the search.
  • Case — in which case the word is written, only in that case the words will be searched.
  • Regex — by regular expressions.

7. Adv(anced) Search
  • you can enter manually and search for multiple terms simultaneously;
  • it is possible to specify the context, together with which words the searched words should be used, and in which boundaries on the left and on the right there should be a match.



Shortcuts
1. Select with Shift pressed — select the consecutive ones.
2. Select with Ctrl pressed — select the needed ones.
3. Ctrl А — select all.
4. Ctrl C — copy selected.
5. Del — delete selected rows.

Plot — allows you to look at the distribution of the required word or expression in the texts: where it is more, where it is less, how it correlates with the file size, where within the text the word occurs more often: at the beginning, in the middle or at the end.

Dispersion — the evenness of the term distribution in the text. The closer to 1, the more evenly the term is distributed.

"A dispersion value is the degree to which a set of values are uniformly spread. Think of rainfall in the UK — generally fairly uniformly spread throughout the year. Compare with countries which have a rainy season.

In linguistic terms, one might wish to know how the occurrences of a word like skull are distributed in Hamlet, and WordSmith has shown this in plot form since version 1. The dispersion value statistic gives mathematical support to this and makes comparisons easier.

It ranges from 0 to 1, with 0.9 or 1 suggesting very uniform dispersion and 0 or 0.1 suggesting "burstiness" (Katz, 1996)
AntConc tutorial
in Russian
Analysis of text data from Weibo
(Chinese social media)
in Russian
This site was made on Tilda — a website builder that helps to create a website without any code
Create a website