










Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!











1. What is a corpus? Collecting and assessing a (good) corpus is the first step to take into account when conducting a statistical analysis of textual data. A corpus is a collection of consistent and homogeneous texts that prove suitable to answer a (good) research question. - To evaluate/select the group of texts to be included in a corpus, a number of criteria come into play to manage variability in relevant properties: language, genre, source, author (and her/his characteristics, such as gender, age, geographical region of origin, etc.), topic, style, size, time-span, etc. Warning : o you have to reduce sources of variability/variation that are not relevant for your research aims, and, viceversa, you have to maintain/magnify those sources of variability and/or language variation that are relevant for your research aims. - Moreover, we have to take into account five sources of (potential) language variation (Berruto, 1987): a) diachronic → the variation deriving from chronological differences = time; b) diatopic → the variation deriving from different geographical settings; c) diaphasic → the variation mirroring differences in the communicative situation (e.g. formal vs. informal); d) diastratic → the variation of different social groups; e) diamesic → the variation connected to difference in the means of communication (the basic opposition is between written and oral texts). - Mention TTR and hapax%↓
2. What is a subcorpus? - A subcorpus is a group of texts of a corpus that share an attribute/property (or more than one) (= texts that belong to the same group), such as the author by whom they were written and/or the period in which they were written (e.g. “texts written by the same author”, “texts written by male authors”, “texts written by female authors in the 19th Century”, etc.). For instance, when comparing texts written by male authors, the “gender of the author” is the observed property (the object of my research question), whereas “male” is the category. - In order to identify the distinctive features of a “group”, we have to compare and contrast the texts included in the sub-corpus of that group with the texts of (one or more than one) other groups → Subcorpora play a major role in strengthening the comparative dimension of the study. N.B. When a property (or a number of properties) is the object of the study itself (e.g. similarities and differences among group of texts), a balancing problem arises, meaning that the researcher should be aware that the collected subcorpora should be consistent among themselves, with no over-representations. 3. What are word-tokens and word-types? In order to enumerate “the words” contained in a corpus we need to distinguish two (or more) concepts… - word-tokens (N): number of total textual units (words considered just a sequence of letters) → the number of word-tokens is the size of the corpus; o In statistical terms, N = number of observations (statistical units). - word-types (V): number of “features”, unique/different words (repetitions are not considered) → the number of word-types is the size of the vocabulary. o In statistical terms, V = number of attributes. N.B. the frequency of a word-type is the number of corresponding word-tokens in the corpus. - hapax legomena (V 1 ): words that occur only once (= word-types with a frequency equal to 1 ). When word lists (list of word-types) and frequencies are the basis of your statistical analysis, you are working within a bag-of-words approach. When is the number of word-tokens and word-types suitable for a statistical approach? In order to understand whether it is possible to work in the frame of quantitative approaches and allow the implementation of statistical methods, size and richness of the corpus should be evaluated. This happens by means of empirical measures such as: - TTR (V/N): number of word-types divided by the number of word-tokens → If the result is 0,20 (20%) or lower (like 0,19, 0,18…), my corpus is large enough for a statistical purpose. 0,20 is the threshold. We always need more redundancy: the lower the number, the more the redundancy; o It is the reciprocal of mean frequency (N/V). - hapax% (V 1 /V): number of word-types that have only one occurrence in the corpus (hapaxes, hapax legomena) divided by the number of word-types → If the result is 0,50 (50%) or lower, my corpus is large enough. If the result is higher than 0,50, it means that there are too many words that occur only once. → The basic idea is that you need redundancy to pursue a statistical approach based on frequencies of words.
6. What are stopwords? Stopwords are not always useless. For instance, pronouns represent a good proxy for individual traits and rhetorical style (e.g. a discourse focused on “I”-words vs. “we”-words) and, in literary studies, grammatical words prove useful to identify the author’s hand in authorship attribution tasks. 7. What are ccr and vcr? - Corpus Coverage Rate : ccr represents the portion of corpus that word-types with a frequency higher than a given threshold y (gamma) are able to cover. - Vocabulary Coverage Rate : vcr represents the portion of vocabulary that word-types with a frequency higher than a given threshold y (gamma) are able to cover. How to read a frequency list - Starting from the first word of a vocabulary (a word list sorted by frequency in a decreasing order), the high frequency zone is located between the first word (the word with the highest frequency) and the word preceding the first pair of words with identical frequency. - Starting from the last word of the vocabulary, that is, from the hapaxes, the low frequency zone is located between the last word and the first frequency “gap” in the series of natural numbers. The last position of the interrupted sequence represents the upper limit of the low frequency zone. - The mid-range area is bounded between high-frequencies and low-frequencies.
8. What are Tokenization and Text Normalization (they belong to the pre-processing steps)? - Given a sequence of characters (a text), tokenization is the task of chopping it up into pieces, called tokens (word?), e.g. disregarding certain characters (punctuation marks?) and maintaining certain characters (letters of the alphabet of a specific language?). Tokenization sets the boundaries of the items to be counted. - Normalization (or standardization) aims at identifying word-types as identical or different. → A correct way to tokenize and normalize the texts of a corpus does not exist. Deciding which kind of tokenization measure to select is quite challenging and depends on our own research aims, because some decisions can lead to severe loss of information and/or gross mistakes. According to the type of tokenization and normalization selected, some content information might get lost: sometimes, symbols, numbers and punctuation marks should be considered as part of the word, not as separators. When providing measures (e.g. TTR), the rules adopted during the tokenization and normalization phases must be clarified in detail for the sake of reproducibility of all operations carried out.
**10. What is Byte-pair encoding (BPE)?
12. Data structures A corpus can be represented by means of more complex data-structures. As opposed to the frequencies of a wordlist, which represent a simple list (vector), TDM and DTM are 2 data structures representing 2 - way matrices. - The TDM ( Term-Document Matrix ) is a contingency table (words x texts) that reports the occurrence of each term (= word) in each document (= text). It’s a 2-way matrix representing, on the rows, the frequency of a specific word in each text, and, on the columns, the frequency of each word in one specific text. → each column represents a document and each row a term. - The DTM ( Document-Term Matrix ) is a swapped version of the TDM. It’s a 2-way matrix representing, on the rows, the frequency of each word in one specific text, and, on the columns, the frequency of a specific word in each text. → each column represents a term and each row a document.
consideration: a) text/subcorpora size = relative frequency → If you have texts that have different dimensions, you have to take into account the relative frequency. b) word/feature popularity → To understand the popularity of a word in a text, that word should be compared to the number of occurrences of that word throughout the whole corpus.
𝑜𝑓 𝑤𝑜𝑟𝑑 i 𝑖𝑛 𝑡𝑒𝑥𝑡 j 𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑐𝑐𝑢𝑟𝑟𝑒𝑛𝑐𝑒𝑠 𝑜𝑓 𝑡𝑒𝑥𝑡 j (𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛 𝑜𝑓 𝑡𝑒𝑥𝑡 j)
𝑜𝑓 𝑤𝑜𝑟𝑑 i 𝑖𝑛 𝑡𝑒𝑥𝑡 j 𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑐𝑐𝑢𝑟𝑟𝑒𝑛𝑐𝑒𝑠 𝑜𝑓 𝑜𝑐𝑐𝑢𝑟𝑟𝑎𝑛𝑐𝑒𝑠 𝑜𝑓 𝑤𝑜𝑟𝑑 i 𝑖𝑛 𝑡ℎ𝑒 𝑐𝑜𝑟𝑝𝑢𝑠
13. What is Correspondence Analysis? Correspondence analysis of the words × texts matrix (lexical contingency table or TDM) is a popular, well-known, and classical tool in textual data analysis. - CA works in an exploratory perspective (EDA = Exploratory Data Analysis frame) and can be exploited to achieve a content mapping [of a set of texts] as it is useful to represent the system of relationships among texts, among words and between texts and words → CA contributes to highlighting patterns: by means of a mathematical procedure, the singular value decomposition (SVD , based on eigenvalues and eigenvectors), similarities and differences among words and texts’ lexical profiles are transformed into coordinates on a Cartesian plane. By exploiting the occurrences and the relative frequencies in the TDM, the CA provides a content mapping where texts and terms are positioned on the quadrants of a Cartesian plane. o CA is a special case of the Principal Component Analysis of the rows (word-types) and columns (texts/subcorpora) of a contingency table → In the simplest version, CA works on a 2-ways contingency table, where: - rows represent word-types, - columns represent texts, - cells represent the number of occurrences or frequencies of a specific word in a specific text → CA is aimed at transforming the frequencies (cells) into coordinates on a multidimensional Cartesian axis system, where the distances among texts and words represent their level of similarity: if frequencies are similar, the distance is low; if frequencies are very different, the distance is high. Texts and words with similar lexical profiles are close to each other on the plane. Two words with an identical profile will have no distance between them, that is, they will be represented on a graph as two overlapping points.
14. What is text clustering? - Text clustering is a term to indicate an unsupervised * document classification that aims at assigning a set of texts to a limited number of classes (or categories) → Text clustering is referred to the task [not a specific algorithm] of cluster analysis and is aimed at grouping similar texts to form consistent clusters and separating dissimilar texts into distinct clusters. - The most common procedures for text clustering are distance-based methods and include instructions to summarize linguistic features as simple quantitative measures and use them to recognize the degree of similarity (or dissimilarity) between texts. Text clustering procedures involve several choices concerning: a) the vocabulary of texts (in particular which and how many words should be considered);
15. What is Sentiment Analysis? Sentiment analysis (also referred to, in relevant literature, as opinion mining, web reputation or tone of voice) aims at extracting the emotional tone, opinions, or sentiments expressed in sentences and texts. - Sentiment analysis is widely used in social media monitoring, customer feedback analysis, product reviews (hotels reviews, restaurants reviews, movie reviews, services reviews, etc.), and market research. - The goal is to understand, for example, whether the overall “sentiment” is positive or negative (polarity analysis) → This specific process of sentiment analysis, aimed at identifying whether the sentiment expressed in a text is positive or negative (or neutral), is called polarity detection. The calculation of these basic sentiment scores (i.e. positive and negative scores) is the primary output of the sentiment analysis. These scores offer a quantitative representation of the overall sentiment expressed in a given text. - Sentiment analysis primarily relies on a lexicon-based approach, which represents a way to assign a word to one or more classes (e.g. the class of words that express “positivity”; the classes of words that express “fear”, “sadness”, “joy”, etc.). o Lexicon-based approaches for sentiment analysis refer to a selection of words based on an available classification, where each class is represented by a list of words (lexicon). On the basis of these predefined lists (lexicons), a “sentiment score” to words is assigned (the word “happy” might have a positive score, while the word “sad” might have a negative score). The scores are often derived from words occurrences (e.g. relative frequency of the class/category) → The overall sentiment of a text is the sum of the scores of the words it contains. - NRC lexicons, developed by the National Research Council (a non-profit research project in Canada) are widely used in sentiment analysis to assign sentiment scores and emotion-related scores to words. o The term “NRC score” refers to scores obtained using the NRC Word-Emotion Association (or NRC Emotion Lexicon) for sentiment analysis, which represents one of the most popular lexicon-based tools. The lexicon assigns scores to words for each emotion/sentiment. o The NRC (National Research Council) emotion lexicon includes eight primary emotions :
o Additionally, NRC scores provide a measure for two general sentiments :