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
Invoking RapidMiner using a method call on a Java class on a Tomcat server
I am new to RapidMiner so I apologize upfront for my inexperience. I have written a web application in Flex/ActionScript that learners and educators can use to create a case formulation based on a given scenario. Their formulations are indented outlines of text that integrate knowledge with the particular observations in the scenario. I have used RapidMiner GUI to compare the two documents for similarity by entering each directly into its own create document operator which then serve as inputs to a single Process Documents operator, which is then connected to a Data to Similarity operator and this works fine.
I want to do the same using a remote method call to a java class on a Tomcat server and I cannot for the life of me (actually only 3 straight days) figure out how to set this up.
Flex applications can make a remote call with parameters to a java class on the Tomcat server and invoke a method in that class. I am trying configure this method so it will receive two large strings, the learner’s formulation and the educator’s formulation which I have shortened below to save space, and then run RapidMiner using the DocumentCompare.rmp listed below. When completed I need it to return an object back to Flex that contains the result. I need help with setting up the method and knowing where on the Tomcat server that I should put the DocumentCompare.rmp file so RapidMiner can find it. Thank you in advance for any help that you can offer.
I want to do the same using a remote method call to a java class on a Tomcat server and I cannot for the life of me (actually only 3 straight days) figure out how to set this up.
Flex applications can make a remote call with parameters to a java class on the Tomcat server and invoke a method in that class. I am trying configure this method so it will receive two large strings, the learner’s formulation and the educator’s formulation which I have shortened below to save space, and then run RapidMiner using the DocumentCompare.rmp listed below. When completed I need it to return an object back to Flex that contains the result. I need help with setting up the method and knowing where on the Tomcat server that I should put the DocumentCompare.rmp file so RapidMiner can find it. Thank you in advance for any help that you can offer.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
<process expanded="true" height="581" width="872">
<operator activated="true" class="text:create_document" compatibility="5.2.004" expanded="true" height="60" name="Create Document" width="90" x="112" y="75">
<parameter key="text" value="Rochelle (used with permission from Dr. Tracy Eells) Problem List Patient-related factors depression anxiety mood instability poor anger management poor sleep headaches social isolation "/>
<parameter key="add label" value="true"/>
<parameter key="label_value" value="ReferenceFormulation"/>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.2.004" expanded="true" height="60" name="Create Document (2)" width="90" x="101" y="301">
<parameter key="text" value="Rochelle (used with permission from Dr. Tracy Eells) Problem List Patient-related factors depression anxiety mood instability poor anger management poor sleep headaches social isolation possible limited motivation or ability to come to treatment dependency mood problems exacerbated by uncontrolled diabetes Environment-related factors financial strain possible impending housing problem possible infidelity chemically dependent husband Temporal dimension Distal grief due to death of son grief due to past rape history of suicidal ideation and threatened attempts Proximal possible infidelity Diagnosis (provisional) Axis I (296.90) Mood disorder not otherwise specified "/>
<parameter key="add label" value="true"/>
<parameter key="label_value" value="SubmittedFormulation"/>
</operator>
<operator activated="true" class="text:process_documents" compatibility="5.2.004" expanded="true" height="112" name="Process Documents" width="90" x="313" y="165">
<parameter key="vector_creation" value="Term Occurrences"/>
<parameter key="prune_below_absolute" value="2"/>
<parameter key="prune_above_absolute" value="99"/>
<process expanded="true" height="599" width="891">
<operator activated="true" class="text:tokenize" compatibility="5.2.004" expanded="true" height="60" name="Tokenize" width="90" x="179" y="30"/>
<operator activated="true" class="text:transform_cases" compatibility="5.2.004" expanded="true" height="60" name="Transform Cases" width="90" x="315" y="28"/>
<operator activated="true" class="text:filter_stopwords_english" compatibility="5.2.004" expanded="true" height="60" name="Filter Stopwords (English)" width="90" x="442" y="26"/>
<operator activated="true" class="text:filter_by_length" compatibility="5.2.004" expanded="true" height="60" name="Filter Tokens (by Length)" width="90" x="600" y="26">
<parameter key="min_chars" value="2"/>
<parameter key="max_chars" value="99"/>
</operator>
<connect from_port="document" to_op="Tokenize" to_port="document"/>
<connect from_op="Tokenize" from_port="document" to_op="Transform Cases" to_port="document"/>
<connect from_op="Transform Cases" from_port="document" to_op="Filter Stopwords (English)" to_port="document"/>
<connect from_op="Filter Stopwords (English)" from_port="document" to_op="Filter Tokens (by Length)" to_port="document"/>
<connect from_op="Filter Tokens (by Length)" from_port="document" to_port="document 1"/>
<portSpacing port="source_document" spacing="0"/>
<portSpacing port="sink_document 1" spacing="0"/>
<portSpacing port="sink_document 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="data_to_similarity" compatibility="5.2.008" expanded="true" height="76" name="Data to Similarity" width="90" x="514" y="165">
<parameter key="measure_types" value="NumericalMeasures"/>
<parameter key="numerical_measure" value="CosineSimilarity"/>
</operator>
<connect from_op="Create Document" from_port="output" to_op="Process Documents" to_port="documents 1"/>
<connect from_op="Create Document (2)" from_port="output" to_op="Process Documents" to_port="documents 2"/>
<connect from_op="Process Documents" from_port="example set" to_op="Data to Similarity" to_port="example set"/>
<connect from_op="Data to Similarity" from_port="similarity" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
[ /code]
0
Answers
it is certainly possible to implement it somehow on your own, but I would strongly suggest to have a look at our RapidAnalytics server. It is capable of providing access to RapidMiner processes as a webservice, which is exactly what you want to do, if I understand you correctly.
Happy Mining!
Marius
I want to have a Flex/ActionScript program make a remote method call to a Java class on a server that starts RapidMiner without a gui, runs the rmp file by substituting the two string variables that are arguments in the call, and then returns the result back to the calling program. The user of the Flex/ActionScript front-end should have no clue that RapidMIner exists. The user just has an application with two strings and a button that says, "Compare". They click it, and the call is made to the server and the result is returned to the application which displays the result in a window. The rmp file is in my previous post.
I have stumbled around with the following Java class and rapidMinerCompare method, but I could be way off track. I think the resultExample is running, though I don't know how get at the results to return them back to the Flex/ActionScript program that made the remote method call. Returning "finished" is temporary to let me know that the method ran. The goal is to return the results of the run.
An example of how the call does work is if I call the sayHello(String name) method with sayHello("Rick"), the string that is returned to the program is "Hello Rick!"
Is what I am trying to do even possible on a Tomcat server?
Thank you again,
Rick
If this is not sufficient, please leave me a small note here. However I think anything else would be a bit like reinventing the wheel.
Best, Marius
Best, Marius