The aim of this work is to implement a parallel algorithm for a topic modeling problem, that is the problem of discovering the topics shared between documents in a collection. The MCMC algorithm Sub-Cluster HDP Sampler for the Hierarchical Dirichlet Process mixture model, a Bayesian nonparametric model, is suitable to this purpose. The code is written in C++ language and is parallelized with the OpenMP library. In order to keep the same flexibility of the model in the implementation, template programming and inheritance techniques are employed. In this way, it is easy to extend the code for a different application. A specialized class for topic modeling is developed, so as to analyse a posteriori the algorithm's results. A further original contribution is the parallelization of the least-square clustering method, which allows to find the optimal clustering in the Markov chain. An interface between the C++ code and the R software is needed for the posterior analysis. To check the good behaviour of the implementation, several tests on simulated datasets were carried out. The efficiency of the Sub-Cluster HDP Sampler is assesed by comparing it with the variational method Collapsed variational inference for HDP. Finally, the model and the algorithm are applied to two real cases. The estimated topics are compared with those generated by the R package lda, which implements the Latent Dirichlet Allocation model.
In questa tesi è stato implementato un algoritmo parallelo per un problema di topic modeling, cioè il problema di riconoscere gli argomenti condivisi in una collezione di documenti. L'algoritmo MCMC implementato è il Sub-Cluster HDP Sampler per il modello Hierarchical Dirichlet Process mixture, un modello bayesiano non-parametrico. Il codice è stato scritto nel linguaggio C++, mentre per la parallelizzazione è stata usata la libreria OpenMP. Per mantenere nell'implementazione la flessibilità del modello Hierarchical Dirichlet Process mixture, sono state impiegate le tecniche della programmazione template e dell'ereditarietà. In questo modo, si facilita una futura estensione del codice per applicazioni diverse. E' stata inoltre creata una classe per l'analisi a posteriori dei risultati dell'algoritmo, specifica per il topic modeling. Un ulteriore elemento di originalità è la parallelizzazione del metodo least-square clustering, che permette di selezionare la partizione dei dati ottima tra quelle simulate. Il codice in C++ è stato interfacciato al software R per l'analisi delle inferenze a posteriori. Per controllare il buon funzionamento dell'implementazione, sono state eseguite diverse prove con dataset simulati dal modello stesso. Per valutare l'efficienza, l'algoritmo MCMC Sub-Cluster HDP Sampler è stato confrontato con il metodo variazionale Collapsed variational inference for HDP. Infine, modello e algoritmo sono stati applicati a due casi reali. I topic stimati sono stati confrontati con quelli prodotti dal pacchetto R lda, che implementa invece il modello LDA.
Implementazione parallela del modello HDP-mixture per applicazioni al topic modeling
PARISI, DEBORA;PEREGO, STEFANIA
2015/2016
Abstract
The aim of this work is to implement a parallel algorithm for a topic modeling problem, that is the problem of discovering the topics shared between documents in a collection. The MCMC algorithm Sub-Cluster HDP Sampler for the Hierarchical Dirichlet Process mixture model, a Bayesian nonparametric model, is suitable to this purpose. The code is written in C++ language and is parallelized with the OpenMP library. In order to keep the same flexibility of the model in the implementation, template programming and inheritance techniques are employed. In this way, it is easy to extend the code for a different application. A specialized class for topic modeling is developed, so as to analyse a posteriori the algorithm's results. A further original contribution is the parallelization of the least-square clustering method, which allows to find the optimal clustering in the Markov chain. An interface between the C++ code and the R software is needed for the posterior analysis. To check the good behaviour of the implementation, several tests on simulated datasets were carried out. The efficiency of the Sub-Cluster HDP Sampler is assesed by comparing it with the variational method Collapsed variational inference for HDP. Finally, the model and the algorithm are applied to two real cases. The estimated topics are compared with those generated by the R package lda, which implements the Latent Dirichlet Allocation model.File | Dimensione | Formato | |
---|---|---|---|
Tesi.pdf
accessibile in internet per tutti
Descrizione: Testo della tesi
Dimensione
3.97 MB
Formato
Adobe PDF
|
3.97 MB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/131853