PSL - Topic Modeling

73 views
Skip to first unread message

Fabian Kohrs

unread,
May 12, 2021, 3:14:56 PM5/12/21
to PSL Users
Hi,

I would like to use the implementation for Latent Topic Networks as described in the paper "Latent Topic Networks: A Versatile Probabilistic Programming Framework for Topic Models" (https://linqs.soe.ucsc.edu/node/259). Unfortunately the implementation in the psl-experimental Git  seems to be not working as for now (https://github.com/linqs/psl-experimental/blob/master/psl-ltn/src/main/java/org/linqs/psl/experimental/application/topicmodel/LatentTopicNetwork.java).  It is not included in the Read-Me file under the provided modules and there seem to be some import issues in the maven project. Does anybody have any ideas how to fix those? Also, could it be possible that those issues occurred when the LTN-Framework was moved from the core module to the experimental Git? 

I am thankful for any responses!

Alexander Miller

unread,
May 12, 2021, 9:36:37 PM5/12/21
to PSL Users
Hi,

You're right, it looks like there are some import issues with the most recent version of psl-ltn.

It depends on an older version of PSL (2.0.0), so in order to compile it you need to build version 2.0.0 of PSL, version 1.0.0 of psl-utils, and version 1.0.0 of psl-experimental.

I made a pull request to update psl-experimental's README here.

Try that out and let me know if any issues come up.

Best,
Alex

Fabian Kohrs

unread,
May 17, 2021, 2:30:31 PM5/17/21
to PSL Users
Thank you for the quick reply! 

Shouldn't be the  2.0.0 version  of PSL be sufficent, since psl-ltn was still included in the psl-core module to this point? 

I am having trouble to understand how to execute the implementation. 

When typing: java -cp ./target/classes:$(cat classpath.out) $org.linqs.psl.experimental.application.topicmodel.LatentTopicNetwork   
I get the error: main class not found 

Which does makes sense,  since there is no main class included. Am I missing something?

Best,
Fabian 

Fabian Kohrs

unread,
May 17, 2021, 2:43:43 PM5/17/21
to PSL Users
*main method not main class

Alexander Miller

unread,
May 18, 2021, 1:15:03 PM5/18/21
to PSL Users
You are right, PSL version 2.0.0 does still have support for LTN.

Since LTN is a weight learning method (and not a standalone application), it can't just be invoked. It needs to be used through PSL's Java (or Groovy) interface.

A potentially useful example of an application using PSL's Groovy interface can be found here: https://github.com/linqs/psl-examples/blob/2.1.0/kgi/groovy/src/main/java/org/linqs/psl/examples/kgi/Run.groovy. On line 185, they invoke the weight learning method MaxLikelihoodMPE, but you can use the LTN weight learning method LatentTopicNetworkMaxPseudoLikelihood.

Note that this example is written for PSL version 2.1.0, so you may need to make some adjustments for your own code.

Best,
Alex
Reply all
Reply to author
Forward
0 new messages