The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
No operator description object
Hi,
I have to write a Java-Application for my master-thesis where I want to apply a model (which I created before in the RM GUI as "output_type" binary) to some texts, but I got the error-message below. I use
rapidminer.jar (version 4.1) and rapidminer-text-4.1.jar, which I have in my classpath, but I have also tested it with the current CVS-Version. I don't understand the message because the code works fine with the wvtool-operators "StringTokenizer", etc. but not with the rapidminer-operators "ModelApplier" and "ModelLoader"??
Hope someone can give me an advise. I'm despaired because it's very important for me that it works.
******************************
[java] G May 24, 2008 11:35:21 AM: Loading operators from 'operators.xml'.
[java] G May 24, 2008 11:35:22 AM: Loading JDBC driver information from 'resources:jdbc_properties.xml'.
[java] Exception in thread "main" com.rapidminer.operator.OperatorCreationException: No operator description object given for 'ModelApplier'
[java] at com.rapidminer.tools.OperatorService.createOperator(OperatorService.java:465)
[java] at tagger.test.RapidMinerTextClassifier.<init>(Unknown Source)
[java] at tagger.test.RapidMinerTextClassifier.main(Unknown Source)
******************************
Greetings,
Danii
I have to write a Java-Application for my master-thesis where I want to apply a model (which I created before in the RM GUI as "output_type" binary) to some texts, but I got the error-message below. I use
rapidminer.jar (version 4.1) and rapidminer-text-4.1.jar, which I have in my classpath, but I have also tested it with the current CVS-Version. I don't understand the message because the code works fine with the wvtool-operators "StringTokenizer", etc. but not with the rapidminer-operators "ModelApplier" and "ModelLoader"??
Hope someone can give me an advise. I'm despaired because it's very important for me that it works.
******************************
[java] G May 24, 2008 11:35:21 AM: Loading operators from 'operators.xml'.
[java] G May 24, 2008 11:35:22 AM: Loading JDBC driver information from 'resources:jdbc_properties.xml'.
[java] Exception in thread "main" com.rapidminer.operator.OperatorCreationException: No operator description object given for 'ModelApplier'
[java] at com.rapidminer.tools.OperatorService.createOperator(OperatorService.java:465)
[java] at tagger.test.RapidMinerTextClassifier.<init>(Unknown Source)
[java] at tagger.test.RapidMinerTextClassifier.main(Unknown Source)
******************************
...
RapidMiner.init();
//RapidMiner.init(false, false, false, true);
OperatorChain wvtoolOperator = (OperatorChain) OperatorService.createOperator("SingleTextInput");
wvtoolOperator.setParameter("input_word_list", wordListFile.getAbsolutePath());
wvtoolOperator.addOperator(OperatorService.createOperator("StringTokenizer"));
wvtoolOperator.addOperator(OperatorService.createOperator("PorterStemmer"));
// Create the model applier and load the model into a field of the class
Operator modelApplier = OperatorService.createOperator("ModelApplier");
Operator modelLoader = OperatorService.createOperator("ModelLoader");
modelLoader.setParameter("model_file", modelFile.getAbsolutePath());
IOContainer container = modelLoader.apply(new IOContainer());
Model model = container.get(Model.class);
...
Greetings,
Danii
Tagged:
0
Answers
hmm, this looks indeed a bit strange. Since there could be a problem with the combination of the text plugin (please refer to http://rapid-i.com/rapidforum/index.php/topic,26.0.html ) I will try to check this during the next days and will write back as soon as possible. Thanks for sending in the detailed information.
Cheers,
Ingo
I had a look into this issue and I just tried to use RapidMiner together with the Text plugin myself in a fresh and new project. Here is what I have done:
- create a new project
- add a lib directory containing rapidminer.jar (Version: 4.1) and rapidminer-text-4.1.jar
- add the libraries to the classpath of the project
- create only a single class containing the following code: Please note that I used basically the same code as you but replaced the operator creation by the variant using the class name (does actually not make a difference but guarantees the availability of operators during compile time) and I used the new PARAMETER_... constants where possible. Please note also that you would have to adapt the plugin directory path.
We introduced a new plugin path which should ease project management for developers. Especially for the case where no plugin is used the only necessary line is "RapidMiner.init()" which should be much more convenient. Just for the sake of explanation why we introduced this change.
Please let me hear if this did the trick...
Cheers,
Ingo
Thank you for your prompt reply and also thank you for your efforts. Your code worked really fine!
But I don't know how to say, when I extend the code to apply the model to a test-example, this line caused an error:
IOContainer container = wvtoolOperator.apply(new IOContainer(model));
[java] Exception in thread "main" java.lang.NoSuchMethodError: com.rapidminer.operator.IOContainer.<init>(Lcom/rapidminer/operator/IOObject;)V
[java] at com.rapidminer.operator.TextInput.getTokenSequence(Unknown Source)
[java] at com.rapidminer.operator.TextInput.apply(Unknown Source)
[java] at com.rapidminer.operator.Operator.apply(Operator.java:656)
[java] at miner.test.TextTest.apply(TextTest.java:47)
[java] at miner.test.TextTest.main(TextTest.java:61)
[java] Java Result: 1 I don't want to be a nuisance but what have I done wrong this time? I’m very grateful for any help.
Greetings,
Danii
could it be that you access RapidMiner via CVS and have compiled the project yourself (and maybe build the file rapidminer.jar and added it to your project)?
I got the same error when I use a freshly compiled CVS version of RapidMiner together with the download version of the text plugin. Since we changed one of the constructors of IOContainer the plugin needs to be recompiled and used then. I have rebuild the plugin for you and it is stored at:
http://rapid-i.com/snapshot/rapidminer-text-4.1.jar
After re-compiling everything (RapidMiner and the plugin) your process works for me without any problems.
Hope that helps,
Ingo
Thank you again for your efforts. Your are right, this was the fault - now everything works.
Cheers,
Danii
great to hear. And don't worry: I made the same mistake
Cheers,
Ingo
I seem to be having a similar problem, but I haven't been able to get the same results by modifying your examples :-\
I get the "No operator description object" error when I run my code, but nothing shows when it's compiled... Here's the basic code:
I'm using both RM and text plugin 4.2, and I've added both .jar's to my buildpath, but I don't know what else to do ???
Thanks so much in advance to anyone who can help!
Eric
exchange the order of the following lines: to
You first have to set the properties and then initialize RapidMiner - the properties are read during initialization.
Cheers,
Ingo
I switched the order of the properties and initialization methods, but unfortunately I'm still getting the same runtime error. Is there something extra that has to be done with the operators.xml file?
Error Message: Thanks so much,
Eric
(Edit:)
There has to be something wrong with the way my rapidminer is using operators.xml. I've gone through the debug of my code and I end up inside OperatorService. The variable 'clazz' iterates through a list of all the operators, but not in the same order as the operators.xml file. When I trace the variables through the classes to find where it gets these operator names, I end up all the way back at the top (rapidminer.class) and I can't even find where the default is hardcoded.
I've even tried just adding the text plugin operators.xml file (from the plugin src) to the main operators.xml file, and a few different ways of initializing so that it looks for the operators.xml file in the right spot or looks for additional ones.
If you've read this far, I sincerely appreciate your time. Sorry for the lengthy post and edits, I'll keep working at it.
-Eric
Well, I finally got it to run, at least. After spending a large number of hours messing with the code, I found _'s in the file path to my plugin instead of spaces. The null pointer error was because my text plugins were pointing to classes that were in the text plugin, which wasn't being pointed to correctly.
Words cannot describe the emotions I'm going through right now, but if any could, they would probably include embarassment, disappointment, and a general sense of self loathing...
Anyways, for anyone else who's new to Java, don't use _ for spaces...
Cheers,
Eric
great news to hear about! So now the fun can begin and you can get deeper in your actual analysis tasks. And I totally understand your emotions - I am going through those at least once per month ;D
All the best,
Ingo
How can I solve the same problem for RM Plugin. I have implemented R-extension (I have jar-file inside lib/plugins). Now I would like to use OperatorChain (called DCTFragment) in another plugin: And I see: