0
$\begingroup$

Say I have a document and I want to assign all (or most) of the words to pre-assigned topics. So I could take a random selection of words and manually assign them to the appropriate topics, then I want an algorithm to assign the remaining words to the appropriate topics based on how closely they occur to the manually assigned phrases.

Is there an algorithm or technique that does this? I've looked into topic modelling and word2vec and they seem to assign 'topics' in some arbitrary space without any room for manual training and designation of topics.

$\endgroup$
3
  • 1
    $\begingroup$ It's just a matter of adding an appropriate regularization term to ensure related terms have similar embeddings. It's especially easy if you use the matrix factorization model. In any case, you'll have to write some code, but it should not be that hard. Welcome to DataScience.SE! $\endgroup$
    – Emre
    Commented Jul 1, 2016 at 7:42
  • $\begingroup$ @Emre what do you mean by "add an appropriate regularization term to ensure related terms have similar embeddings"? I understand regularization and I also understand matrix factorization, but I don't understand how you're referring to them in this context. I'm also not sure what you mean by "embeddings" either. $\endgroup$
    – Ryan Zotti
    Commented Jul 1, 2016 at 20:58
  • $\begingroup$ When you find a matrix factorized topic model, you need to add a term to the objective function to constrain or encourage the document vectors to have the desired property. There is usually a regularization term for sparsity or energy. LJB would simply need another regularization term. The document vector is the embedding of the document in the topic space. For more on language embeddings look up word2vec. $\endgroup$
    – Emre
    Commented Jul 1, 2016 at 21:03

2 Answers 2

1
$\begingroup$

Latent Dirichlet allocation (LDA) is a generative statistical model that allows sets of observations to be explained by unobserved groups that explain why some parts of the data are similar. LDA does exactly the same thing you wanted to do.

$\endgroup$
0
$\begingroup$

There are techniques like singular value decomposition (SDV) and principal components analysis (PCA) that when applied to many documents (or many sentences in your case if you have only one document) can produce vectors of words that occur together. These vectors would then represent the topics.

SVD and PCA are commonly used text analysis techniques that have been shown to be capable of identifying different sections/topics of newspapers (e.g., sports, finance, world, etc) when applied to many news articles.

$\endgroup$

Your Answer

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

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