I have 2 English text corpora. One is people talking about topic "A" while other is people talking about topic "B".

From a language point of view - the way people express themselves on topic "A" is different from topic "B". I want to understand and analyze how is language of one corpus is similar/disimilar from the language in the other corpus (both qualitatively and quantitatively). I am aware of only the following techniques:

I am aware of only -

  1. word frequency counts
  2. KL divergence
  3. sentiment analysis

What other techniques are there in the literature ?


This sounds like a good task for a vector space model. Vector models represent corpora in high dimensional space. Words or sentences that are dissimilar in meaning are further apart in the vector space. There are many different methods for generating the space, but they all rest on the idea that similar-meaning words appear in similar contexts. Latent Semantic Analysis (LSA) is one method, word2vec is another.

I suggest training a word embedding on a much larger sample that doesn't include corpus A or corpus B

Then analyze then language used to contrast topics A and B with respect the the distribution of their language within the space.


Another technique that would be relevant for your comparative task is keyness analysis, which basically looks at words* which occur significantly more often in one group of texts than in another. The technique comes from the field of corpus linguistics, a field which has developed a number of techniques and tools for analysing large amounts of texts in both qualitative and quantitative ways.

Wikipedia has an introduction to corpus linguistics (https://en.wikipedia.org/wiki/Corpus_linguistics) and you can find a brief introduction to keyness analysis on the site for Wordsmith Tool, a corpus linguistics software (http://www.lexically.net/downloads/version5/HTML/index.html?keyness_definition.htm).

*note that keyness analysis can be done at the level of words, but also semantic groupings of words or POS categories. In the latter cases, it would involve identifying categories which occur significantly more often in one corpus than in another.


You could analyze the texts with topic modeling, using something like latent Dirichlet allocation. In this way, maybe you could assume sub topics of topic a, and a different set of subtopics for topic b, or something along those lines.

If you want to go the word embeddings path that Manfred mentioned, there are also implementations of doc2vec, which allows you to compare documents directly, rather than at the word level.

You could also try something simpler for a baseline analysis like TF-IDF, and with the vectors that it produces you can look at the cosine-similarity (or some other distance metric) between words or documents

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.