4

I try to run ParallelTopicModel class from mallet, i'm using NetBeans to compile it, but when i run the code i get this error statement:

Couldn't open cc.mallet.util.MalletLogger resources/logging.properties file. Perhaps the 'resources' directories weren't copied into the 'class' directory.

I haven't change any code anyway, still use the original from the class:

public static void main (String[] args) {
    try {
        InstanceList training = InstanceList.load (new File(args[0]));

        int numTopics = args.length > 1 ? Integer.parseInt(args[1]) : 200;

        ParallelTopicModel lda = new ParallelTopicModel (numTopics, 50.0, 0.01);
        lda.printLogLikelihood = true;
        lda.setTopicDisplay(50, 7);
        lda.addInstances(training);

        lda.setNumThreads(Integer.parseInt(args[2]));
        lda.estimate();
        logger.info("printing state");
        lda.printState(new File("state.gz"));
        logger.info("finished printing");

    } catch (Exception e) {
        e.printStackTrace();
    }
}

I am very new to mallet, so I don't know what's that mean, and how can I fix it? Any help would be appreciated.

ric
  • 627
  • 1
  • 12
  • 23
  • Have you tried acting on the suggestion presented in the error message? *"Perhaps the 'resources' directories weren't copied into the 'class' directory."* – compor Dec 17 '17 at 16:22

1 Answers1

0

Mallet is looking for a Java property java.util.logging.config.file. If it doesn't find it, it looks for the resources/logging.properties file, and if it doesn't find that it throws the error you saw.

The default Mallet logging file is at https://github.com/mimno/Mallet/blob/master/src/cc/mallet/util/resources/logging.properties.

You'll need to consult NetBeans documentation for how to set the Java property.

David Mimno
  • 1,836
  • 7
  • 7