Function WriteTopicsMult

[ SM ] = WriteTopicsMult( WPM , BETAM , WOM ) writes the most likely entities (e.g. words, authors) per topic to a cell array of strings SM. The difference with function WriteTopics is that for each topics, the distributions over multiple entities are calculated

Note that WPM is a cell array of matrices and BETAM is an array of hyperparameter constants

Each entry of WPM is a sparse W x T count matrix such that WPM{k}(i,j) contains the number of times entity i of type k has been assigned to topic j. BETA(k) is the relevant hyperparameter used in the Gibbs sampling routine. WOM is a cell structure of strings such that WOM{k}{i} contains the ith entity string of type k.

[ SM ] = WriteTopics( WPM , BETAM , WOM , K , E , M , FILENAME ) writes the K most likely entities per topic to a text file FILENAME with M columns. E is a threshold on the topic listings in SM. Only entities that do not exceed this cumulative probability are listed.

WriteTopicsMult( WPM , BETAM , WOM , K , E , M , FILENAME ) writes the K most likely entities per topic without producing a cell array of strings

[ SM ] = WriteTopicsMult( WPM , BETAM , WOM ) uses default values K=5 and E=1

Example

   load 'atsingle_nips'
   load 'words_nips'
   load 'authors_nips'
   WPM{1} = WP; WPM{2} = AT;
   BETAM(1)=BETA; BETAM(2) = ALPHA;
   WOM{1}=WO; WOM{2}=AN;
   [ SM ] = WriteTopicsMult( WPM , BETAM , WOM );
   SM{1}(1:10)
   SM{2}(1:10)

will list the most likely words and authors for the first 10 topics

   WriteTopicsMult( WPM , BETAM , WOM , 10 , 1.0 , 4 ,
   'topics_nips.txt' )

will write 10 most likely words and authors per topic to a four column text file