output-topic-docs gives empty .txt file in Mallet - cmd

I want to run a model in Mallet and need the topic-docs output, which gives the most prominent documents for each topic. This is necessary for interpreting the less clear topics correctly. But Mallet keeps on giving me empty txt files.
This is the command I use:
bin\mallet train-topics --input cleandata1000.mallet --num-topics 250 --num-iterations 3000 --optimize-interval 50 --optimize-burn-in 50 --output-topic-keys 1000-300-3000-50-topic-keys.txt --output-topic-docs 1000-300-1000-50-topic-docs.txt --num-top-docs 20 --output-doc-topics 1000-300-1000-50-doc-topics.txt --doc-topics-threshold 0.01 --xml-topic-phrase-report 1000-300-1000-50-topic-phrase.xml --output-state 1000-300-1000-50-state.gz --use-symmetric-alpha true
Does anyone know what the cause could be?
Edit in response to David Mimno's 4 Nov comment:
The same thing happens with different data (where the docs have a different lenght).
I just ran some other models with Mallet's test data. Peculiar: This trial gave no output at all (so the "en-topic-docs.txt" did not get made).
bin\mallet train-topics --input en.mallet --num-topics 5 --output-topic-docs en-topic-docs.txt
When I ask for the topic keys as output, both files are made, but the en-topic-docs.txt is empty.
bin\mallet train-topics --input en.mallet --num-topics 5 --output-topic-keys en-topic-keys.txt --output-topic-docs en-topic-docs.txt
My bad: there is a recurring error message:
Exception in thread "main" java.lang.ClassCastException: class java.net.URI cannot be cast to class java.lang.String (java.net.URI and java.lang.String are in module java.base of loader 'bootstrap')
at cc.mallet.topics.ParallelTopicModel.printTopicDocuments(ParallelTopicModel.java:1773)
at cc.mallet.topics.tui.TopicTrainer.main(TopicTrainer.java:281)
I don't know what this might mean.
Thank you for any help, you are saving my PhD :)

I was able to fix this by using the latest release on github (202108) instead of MALLET 2.0.8. Now it works like a charm.
Instructions for using the developmental release: http://mallet.cs.umass.edu/download.php
Thank you for the pointers, David Mimno!

Related

Parameter unassigned error in OMNeT++ and INET examples on installation

I have installed OMNeT++ 5.6.2 and added the INET 4.2.1 framework.
I followed the setup instructions as per the doc given and compiled and did make.
On running ./aloha I seem to encounter parameter unassigned error as follows :
Setting up Cmdenv...
Loading NED files from .: 4
Preparing for running configuration General, run #0...
Assigned runID=General-0-20201227-14:11:08-9189
Setting up network "Aloha"...
<!> Error: The simulation wanted to ask a question, set cmdenv-interactive=true to allow it: "Enter parameter 'Aloha.host[0].iaTime' (unassigned):" -- in module (aloha::Host) Aloha.host[0] (id=3), during network setup
End.
Even on running a different example from INET, from examples, adhoc, seem to get a similar error as follows :
Preparing for running configuration General, run #0...
Assigned runID=General-0-20201223-00:37:38-95889
Setting up network "Net80211"...
<!> Error: The simulation wanted to ask a question, set cmdenv-interactive=true to allow it: "Enter parameter 'Net80211.numHosts' (unassigned):" -- in module (omnetpp::cModule) Net80211 (id=1), during network setup
End.
Simulation terminated with exit code: 1
I did set cmdenv-intercative=true in the config file and yet the error does not go away.
Please do let me know if you need any additional information. Any help, direction or pointer to some resources would be greatly appreciated and will be really really helpful.
You need to set "cmdenv-intercative=true" for the [General] section.

Error in task sequence failure: "Incorrect function: Error 00000001; Source: Windows"

I am receiving the above error when running the task sequence and it is failing on the step that is in the picture I provided. Does anyone have any ideas on why? I know the error is very generic, and I have tried several things to address it - I checked the box to disable 64-bit, I made sure that the package containing the batch file was referenced in that step, etc. Any suggestions would be greatly appreciated, I am very much a noob when it comes to SCCM. Thank you.
Could you post the SMSTS.log saved in C:\Windows\CCM ?
It should contain the reason why this is failing
While looking at your TS, It could be that using a working folder with UNC paths fail the TS because CMD does not support running UNC paths out of the box.
Try adding cmd /c at the start of the Command Line field. It's quirky, but has often fixed my issues.

Building RXTX with --disable-locks

I need to build RXTX (http://rxtx.qbang.org/wiki/index.php/Main_Page) for a 64 bit platform with --disable-locks. ( the target platform is a Ubuntu Snappy platform so there is a problem with the permissions and lock files).
The .configure --disable-locks and make seemed to run ok.
I got a new .jar file and librxtxSerial.so as a result.
However when I installed them, I get the following error :
java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
Is there something else I need to do?
Are there other object files I need to copy over.
Thanks in advance.
I solved the problem myself.
The problem was that the configure script was not expecting a java version higher than 1.5 as shown here in t he extract :
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*)
#fix_parameters $JPATH/jre/lib/javax.comm.properties
CLASSPATH=".:\$(TOP):\$(TOP)/src:"find $JPATH/ -name RXTXcomm.jar |head -n1
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"jre/lib/ext"
So the paths were not being set up correctly for me.
I changed it to
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*|1.7*)
Then it worked ok.

Resurrecting old PLT-Scheme project (pre-1999)

I'm trying to resurrect an old (1999 or earlier) project written in Scheme (PLT-Scheme, using the mzscheme interpreter (?) commandline tool). To make the matters worse, I don't know Scheme, or Lisp (in fact, I want to learn, but that's another story).
I have the source code of the project at:
github.com/akavel/sherman
Now, when running the code, it bails out with an error message like below:
Sherman runtime version 0.5
Hosted on MzScheme version 52, Copyright (c) 1995-98 PLT (Matthew Flatt)
reference to undefined identifier: list->block
(I've tried PLT-Scheme versions 52, 53, 103, 103p1. Earlier versions don't allow mzscheme -L option, which is referenced in the sherman.bat script used in the project. Later versions also have some more serious problems with the code or options.)
The difficulty is, that from what I see, list->block actually is defined - see: collects/sherman/BLOCK.SS line 48. So, what is wrong?
To run the code, I perform the following steps:
Download PLT-Scheme v. 103p1 (from the old versions download page - first closing the "PLT Scheme is now Racket" banner) - for Windows, use: mz-103p1-bin-i386-win32.zip.
Unzip (e.g. to directory c:\PLT).
Copy c:\sherman\collects\sherman directory with contents to: c:\PLT\collects\sherman (where c:\sherman contains the contents of the github repository).
Run cmd.exe, then cd c:\sherman.
set PATH=c:\PLT;%PATH%
sherman.bat run trivial.s
this command is in fact, from what I understand, equivalent to:
(require-library "runtime.ss" "sherman")
(parameterize ((current-namespace sherman-namespace)) (load "trivial.s"))
(current-namespace sherman-namespace)
After that, I get the error as described above (MzScheme version would be reported as 103p1 or whatever).
Could you help me solve the problem?
EDIT 2: SOLVED!
To whom it may concern, I've added a fully fledged "How to use this project" instruction on the project page, detailing the solution to the problem thanks to soegaard's help.
In short:
copy trivial.s trivial.rs
rem (the above is workaround for problems with 'r2s.exe < trivial.r > trivial.rs')
sherman.bat compile trivial.rs
sherman.bat run trivial.zo
rem (or: sherman.bat run trivial.ss)
Not an answer, but a few notes too big for a comment.
1. Sanity Check
The error message says list->block is undefined.
Make sure that the code in block.ss is run, by
inserting (display "block.ss is loaded!") in block.ss
just to make sure, the code is run.
2. Random Thoughts
The file blocks.ss begins with:
(require-library "functios.ss")
(require-library "synrule.ss")
(require-library "stream.ss" "sherman")
The file "sherman/stream.ss" is in the repository,
but where is "synrule.ss" and "functios.ss" ?
Ah... This code is old! Here is a description of
how require-library worked. It lists functios.ss
and synrule.ss as part of MzLib.
http://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node158.htm
Let's check out how require-library worked:
When require-library is used to load a file, the library name and the
resulting value(s) are recored in a table associated with the current
namespace. If require-library is evaluated for a library that is
already registered in the current namespace's load table, then the
library is not loaded again; the result(s) recorded in the load table
is returned, instead.
So when the code in block.ss is run, the names are stored in a namespace. If the current namespace is the wrong one, when the code in block.ss is evaluated, it would explain you error message of list->block being undefined.

What could cause the error message 'Target "1" does not exist in the project "xxx".' running Ant on Windows?

I'm using ant.bat (in Ant 1.7.1) to build the all target in a build.xml file, on Windows 2003 Server. (I've substituted "xxx" in the error message for the project name in that file.)
It builds successfully, but then ends with:
2009-06-10 17:26:03 | all:
2009-06-10 17:26:03 |
2009-06-10 17:26:03 | BUILD FAILED
2009-06-10 17:26:03 | Target "1" does not exist in the project "xxx".
...and returns with a non-zero error code.
I've searched build.xml unsuccessfully for anything that might lead to this error. (There is no target "1", of course, nor any dependencies that might resolve "1".)
I'm hoping someone out there might recall seeing this. I don't expect anyone to debug the XML for me, but a Google search turned up http://simile.mit.edu/mail/ReadMsg?listId=9&msgId=2735, which contains "I found an email thread on this problem and will
retry.". I wish I could find that thread.
Update - here's the command-line:
D:/build/toolchain/noarch/ant-1.7.1/bin/ant.bat all -DBRANCH_NAME="main" -DBUILD_NUMBER="66675" -DCHANGE_NUMBER="1061789" -DGOBUILD_AUTO_COMPONENTS= -DGOBUILD_OFFICIAL_BUILD=1 -DGOBUILD_VICLIB_ROOT=d:/build/ob/bora-66675/compcache//viclib/ob-65655/windows -DGOBUILD_VIMBASE_ROOT=d:/build/ob/bora-66675/compcache//vimbase/ob-64494/windows -DOBJDIR="beta" -DPRODUCT_BUILD_NUMBER="82" -DPUBLISH_DIR="d:/build/ob/bora-66675/publish" -DRELTYPE="beta" -DREMOTE_COPY_SCRIPT="D:/build/toolchain/win32/python-2.5/python.exe D:/build/gobuild/script/gobuildc.py bora-66675"'
Hopefully it's of some help.
Do you have any targets that depend on "1"? Perhaps due to a typo?
<target name="SomeTarget" depends="1">
....
</target>
Update: You explained (paraphrased) that the error message was a result of the (partial) command-line
-DGOBUILD_AUTO_COMPONENTS= -DGOBUILD_OFFICIAL_BUILD=1
Although there's a space between those two define statements, it's being treated like this:
-DGOBUILD_AUTO_COMPONENTS=-DGOBUILD_OFFICIAL_BUILD=1
because something is expected to follow '='. And it appears that the second '=' is being treated as a whitespace, perhaps because ANT is confused. I would not expect that. The correct way to do what you want to do is:
-DGOBUILD_AUTO_COMPONENTS="" -DGOBUILD_OFFICIAL_BUILD=1
That way, something follows the equals sign and ANT won't get confused.
could you add the commandline you are using. it could be that ant agrees with you that there is no target '1' but that it believes you are passing one in.
This posting helped me resolve this error and wanted to share my version of the problem.
Target "listener" does not exist in the project "null".
ANT will use an environment variable ANT_ARGS if it is set. I was using the -listener option and set this option in my Windows envvar, ANT_ARGS. When I pasted the options into the Env Var:
-listener org.apache.tools.ant.listener.Log4jListener -lib D:\apache-ant-1.7.1\lib
I was missing the 'minus' sign in front of the 'listener' option.
This is similar to the problem above, but was hidden by the fact that I used the envvar ANT_ARGS.
Ya goose :-) You changed the project to "xxx" in the heading but left it as "vireporting" in the error output.
So the cat's out of the bag. You may as well make our life easier and post the XML since our ability to help you (psychic debugging) is greatly limited. If you want, sanitize the XML you post (better than you sanitized the original, hopefully).
And your comment ('There is no target "1"') makes sense since that's what ant is telling you. What you may have done is inadvertently created a dependency on that non-existent target.
It turns out this error message is the result of "-DGOBUILD_AUTO_COMPONENTS= -DGOBUILD_OFFICIAL_BUILD=1" in the command-line. I guess having nothing after the '=' in that -D option confuses Ant. (As an experiment, I changed "-DGOBUILD_OFFICIAL_BUILD=1" to "-DGOBUILD_OFFICIAL_BUILD=2" in this programmatically-generated command-line and the error message changed to "Target "2" does not exist in the project "xxx".")
Removing "-DGOBUILD_AUTO_COMPONENTS=" eliminated the build failure.
If someone can clearly explain why Ant emits such a strange error message in this case (or perhaps why it's not strange if one looks at it correctly), I'll accept your answer.

Resources