And below is the error message:
java.io.IOException: Cannot run program "C:\Learning to Rank": CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at com.server.LTRModel.trainModel(LTRModel.java:129)
at com.server.ResumeSearchAppMain.main(ResumeSearchAppMain.java:44)
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 3 more</init>
Even giving the everyone group full permissions to the "Learning to Rank" folder hasn't helped
Last edit: Kwabena Mensa-Bonsu 2016-08-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not really familiar with the Java ProcessBuilder class. Have you properly defined the input/output streams (i.e. are they really coming/going where you think?). Does the program file have execute permissions?
Why not try using the RankLib classes themselves to run your program? The Evaluator class will take a bunch of strings that define the arguments and values you want.
Take a look at the RankLib test program EvaluatorTest.java in RankLib/test/ciir/umass/edu/eval/. You should be able to easily modify the arguments for your own purposes and run it using appropriate RankLib classes instead of via external Java ProcessBuilder.
For more complete ideas on how to run a custom RankLib implementation, look at the Evaluator.java code in RankLib/src/ciir/umass/edu/eval/. Just keep the options you want from that program source for your own use.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1.Igettheerror"Could not find or load main class ciir.umass.edu.learning.Evaluator"whenItrytorunthefollowingcommand>java-jarRankLib-2.3.jar-help.AmIwronginthinkingallyouallRankLibjarfilesarecommandlineapplications?2.Ialsogottheerror"Unknown command-line parameter: ciir.umass.edu.eval.Analyzer"whenItriedtoefollowingcommand>java-jarRankLib-2.1-patched.jarciir.umass.edu.eval.Analyzer-alloutput/-basebaseline.ndcg.txt>analysis.txt.Istheparameternotsupportedonversion2.1.3.Whatistheminimumnumberofquery-documentpairrequiredtoproperlytrainandbuildanLTRmodel?4.Yougetanxnumberofmodelswhenyourunanx-foldcrossvalidation.IstheideatocomparethemodelsandchoosethebestfortheLTRmodel?5.IplantousethecommandlinetotrainmymodelusingRankLib-2.1-patched.jarbutprogrammaticallyloadthemodelandcreatedatapointstore-rankmyunseendocumentsusingRankLib-2.3.jar' s sourcecode.RankLib-2.1-patched.jar does not seem to support datapoints hence the reason for the different versions. Will that work?6.Isawinoneofthepoststhatthelatestversionis2.5.CanImixandmatch–buildthemodelusingthecommandlinebutcallthemodelprogrammatically?Andifyes,canIgetthedownloadlink?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you wish to run RankLib to build a model, save it, then load it and run it again on some training/test data, you can do that directly using the jar file (which invokes the Evaluator) without the need to write any of your own code.
You then load your saved model and run it on more data to test how it does.
Be sure RankLib.jar is on your classpath or explicitly define where it is when you run it.
You can get the list of RankLib parameters by typing the java command with the -help parameter or no parameters at all.
java -jar /home/mylibs/Ranklib.jar
Use RankLib to build and save a ranking model (say LambdaMART) splitting the training data into 80% for training and 20% for testing using default training metric.
Although k-fold cross validation can produce a model for each fold defined, it's really just a way to more thoroughly randomize the training process to better eliminate the possibility of producing a model that under or over fits the data.
You should use the latest release which is RankLib-2.7. I would avoid mixing RankLib versions. Just use one version for everything you want to do.
Hi Stephen,
I am not able to download the souce file using the lin below.can you please check it again for me?
svn checkout --username=myusername \
svn+ssh://myusername@svn.code.sf.net/p/lemur/code/RankLib/trunk \
RankLib-2.7
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to use the model to re-rank Lucene results but want to implement the above command using Java.I've started with the code below but not sure how to extract the score and assign it to my POJO
Hello,
I need help running RankLib in Java.Here is the code:
String javapath = "C:\Learning to Rank";
String traindata = "C:\Learning to Rank\MQ2008\Fold1\train.txt";
int ranker = 4;
String modelsStore = "C:\Learning to Rank\models";
ProcessBuilder pb = new ProcessBuilder(javapath,"-jar","RankLib-2.1-patched.jar",
"-train " + traindata,"-ranker " + ranker,"-kcv 5", "-kcvmd " + modelsStore ,
"-kcvmn ca","-metric2t NDCG@10","-metric2T ERR@10");
try {
And below is the error message:
java.io.IOException: Cannot run program "C:\Learning to Rank": CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at com.server.LTRModel.trainModel(LTRModel.java:129)
at com.server.ResumeSearchAppMain.main(ResumeSearchAppMain.java:44)
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 3 more</init>
Even giving the everyone group full permissions to the "Learning to Rank" folder hasn't helped
Last edit: Kwabena Mensa-Bonsu 2016-08-11
I'm not really familiar with the Java ProcessBuilder class. Have you properly defined the input/output streams (i.e. are they really coming/going where you think?). Does the program file have execute permissions?
Why not try using the RankLib classes themselves to run your program? The Evaluator class will take a bunch of strings that define the arguments and values you want.
Take a look at the RankLib test program EvaluatorTest.java in RankLib/test/ciir/umass/edu/eval/. You should be able to easily modify the arguments for your own purposes and run it using appropriate RankLib classes instead of via external Java ProcessBuilder.
For more complete ideas on how to run a custom RankLib implementation, look at the Evaluator.java code in RankLib/src/ciir/umass/edu/eval/. Just keep the options you want from that program source for your own use.
Thank you very much for your quick response as usual.Will let you know if I have further questions
Hi Stephen,
I have a few questions for you
Not entirely certain what you are trying to do.
If you wish to run RankLib to build a model, save it, then load it and run it again on some training/test data, you can do that directly using the jar file (which invokes the Evaluator) without the need to write any of your own code.
You then load your saved model and run it on more data to test how it does.
Be sure RankLib.jar is on your classpath or explicitly define where it is when you run it.
You can get the list of RankLib parameters by typing the java command with the -help parameter or no parameters at all.
Use RankLib to build and save a ranking model (say LambdaMART) splitting the training data into 80% for training and 20% for testing using default training metric.
Then load the model and run it on some more data to see how it did.
Although k-fold cross validation can produce a model for each fold defined, it's really just a way to more thoroughly randomize the training process to better eliminate the possibility of producing a model that under or over fits the data.
You should use the latest release which is RankLib-2.7. I would avoid mixing RankLib versions. Just use one version for everything you want to do.
If you are going to customize RankLib for your own purposes, checkout the sources from SourceForge using SVN:
You'll need Maven to build the sources.
Hi Stephen,
I am not able to download the souce file using the lin below.can you please check it again for me?
svn checkout --username=myusername \
svn+ssh://myusername@svn.code.sf.net/p/lemur/code/RankLib/trunk \
RankLib-2.7
It keeps asking for the password and then eventually throws up an error saying the path is incorrect
You need to use the read only (RO) instruction:
svn checkout svn://svn.code.sf.net/p/lemur/code/RankLib/trunk RankLib-2.7
Thank you
Hello,
Can someone please show mw how to implement the follwoiwing example in Java
java -jar bin/RankLib.jar -load mymodel.txt -rank MQ2008/Fold1/test.txt -score myscorefile.txt
I want to use the model to re-rank Lucene results but want to implement the above command using Java.I've started with the code below but not sure how to extract the score and assign it to my POJO