0
$\begingroup$

As far as I understand it, LDA works by assuming that a corpus was written by a set of topics ands words corresponding to that topic by a specific distribution. I'm however not enterely sure what the output of the LDA process is and more importantly, how one can (for example) model a corpus of political speeches to their sentiments.

$\endgroup$

2 Answers 2

1
$\begingroup$

LDA is a unsupervised technique which identifies the set of words that compromise of a topic. This is done by assuming that there is a generator that generates the sentences using the words. To simplify the assumptions on the number of topics are made which ideally has to be learnt from the data.

The output of LDA is the words that represent a topic and probability of a sentence/ text observation being a mixture of the N topics we initially assumed.

We will get a 1xN row vector for each text observation that has probability of it containing topic n (which is one of the N topics)

$\endgroup$
2
  • $\begingroup$ And then how can it be used to analyse sentiments? $\endgroup$ Jun 6, 2019 at 9:54
  • 1
    $\begingroup$ Sentiment can be extracted in 2 ways. Either by using just the words. There are corpus of words and their sentiments available. We could use it to come up with a sentiment score based on the words in each topic and then for the document weighing it probably by their probabilities (could work I haven't tried). This is the approach if we plan to use only LDA for sentiment extraction. The other alternative is to tag some corpus as positive negative and neutral and use it to build a sentiment classifier using word features and LDA features together $\endgroup$ Jun 6, 2019 at 12:05
0
$\begingroup$

Mahesh's answer is correct, but to be more specific:

In the lexicon-based sentiment analysis you start with a lexicon of words (a dictionary, a set of words) for each "sentiment" and you usually do some sort of counting - how many times the words from a given set showed up in a given document/paragraph/sentence. That is a supervised approach, in which you need to define the lexicons first.

LDA is an unsupervised approach - you start with just your data (and some additional elements such as priors and the number of topics you expect to find - but this can be data-driven as well) and the algorithm will try to identify the topics. Topics here are distributions over your vocabulary - if you're talking about cars you probably use a different distribution of words than if you're talking about quantum physics. Then each document is a mixture of topics - you have document specific distribution over topics that determines what topics the words in that document "come from". The trick here is that you could potentially end up with topics that have interpretation similar to sentiments - e.g. a "disappointed" topic, or "happy" topic (you look at the distribution over words and provide interpretation for a given topic). Such approach has the advantage of not having to define the lexicons by yourself, it's much more data-driven. That being said, you might end up with topics that do not fit what you're looking for. The solution here would be to use semi-supervised approach, such as in GuidedLDA (also called SeededLDA).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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