"Text Processing plugin in Java App"

ranerane MemberPosts:2Contributor I
edited June 2019 inHelp
I made a Java application that classifies the data inside an excel file. Here's a snippet of the code.

RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
ProcessEntry pEntry = null;
RepositoryManager.getInstance(null).addRepository(new LocalRepository("RMThesis", new File("Resources/TrendClass(70%)")));
if(cbAlgo.getSelectedItem() == "k-NN"){
RepositoryLocation location = new RepositoryLocation("//RMThesis/Apply Model (Oct Data)");
pEntry = (ProcessEntry) location.locateEntry();
RapidMiner.init();
JOptionPane.showMessageDialog(null, "Location set", "Message", JOptionPane.INFORMATION_MESSAGE);
}
else if(cbAlgo.getSelectedItem() == "SVM"){
RepositoryLocation location = new RepositoryLocation("//RMThesis/Apply Model (SVM)");
pEntry = (ProcessEntry) location.locateEntry();
RapidMiner.init();
}
else if(cbAlgo.getSelectedItem() == "Naive Bayes"){
RepositoryLocation location = new RepositoryLocation("//RMThesis/Apply Model (NB)");
pEntry = (ProcessEntry) location.locateEntry();
RapidMiner.init();
}
if(pEntry instanceof ProcessEntry)
{
String processXML = pEntry.retrieveXML();
Process myProcess = new Process(processXML);

Operator op = myProcess.getOperator("Read Excel");
op.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, selectedFile.getPath());

IOContainer ioResult = myProcess.run();
}

I already added the rmx_text-ANY-5.3.2.jar in my library to be able to use text processing but still i have this error. I hope someone can help me:(

Feb 22, 2014 8:45:04 PM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Feb 22, 2014 8:45:04 PM com.rapidminer.tools.I18N
INFO: Set locale to en.
Feb 22, 2014 8:45:04 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Property rapidminer.home is not set. Guessing.
Feb 22, 2014 8:45:04 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Trying parent directory of 'C:\Users\jeraymundo\Desktop\Prototype NEW\Prototype\Resources\launcher.jar'...gotcha!
Feb 22, 2014 8:45:04 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Trying parent directory of 'C:\Users\jeraymundo\Desktop\Prototype NEW\Prototype\Resources\rapidminer.jar'...gotcha!
Feb 22, 2014 8:45:05 PM com.rapidminer.tools.expression.parser.ExpressionParserFactory
INFO: Default version of expression parser registered successfully
Feb 22, 2014 8:45:06 PM com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.OperatorService init
INFO: Number of registered operator classes: 443; number of registered operator descriptions: 444; number of replacements: 403
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver com.mysql.jdbc.Driver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver org.postgresql.Driver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver net.sourceforge.jtds.jdbc.Driver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver org.hsqldb.jdbcDriver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver net.sourceforge.jtds.jdbc.Driver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver com.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
信息:JDBC驱动程序ca.ingres.jdbc.IngresDriver不是found. Probably the driver is not installed.
Feb 22, 2014 8:45:07 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver oracle.jdbc.driver.OracleDriver not found. Probably the driver is not installed.
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: The operator class 'text:data_to_documents' is unknown. Possibly you must install a plugin for operators of group 'text'.
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'select_attributes_and_weights' is unknown for operator 'Data to Documents (2)' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'specify_weights' of type list is unknown for operator 'Data to Documents (2)' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: The operator class 'text:process_documents' is unknown. Possibly you must install a plugin for operators of group 'text'.
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'create_word_vector' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'vector_creation' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'add_meta_information' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'keep_text' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'prune_method' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'prune_below_percent' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'prune_above_percent' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'prune_below_rank' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
信息:参数“prune_above_rank”是未知的for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter parseOperator
INFO: The parameter 'datamanagement' is unknown for operator 'Process Documents' (" dummy ")."
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: Operator 'dummy' may not have children. Ignoring.
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: The input port example set is unknown at operator Data to Documents (2).
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: The input port word list is unknown at operator Process Documents.
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: The output port documents is unknown at operator Data to Documents (2).
Feb 22, 2014 8:45:08 PM com.rapidminer.io.process.XMLImporter addMessage
INFO: The output port example set is unknown at operator Process Documents.
Feb 22, 2014 8:45:15 PM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Feb 22, 2014 8:45:15 PM com.rapidminer.Process run
INFO: Process starts
com.rapidminer.operator.UserError: The dummy operator Data to Documents (2) (replacing text:data_to_documents) cannot be executed.
at com.rapidminer.operator.DummyOperator.doWork(DummyOperator.java:88)
at com.rapidminer.operator.Operator.execute(Operator.java:866)
at com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
at com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:711)
at com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:375)
at com.rapidminer.operator.Operator.execute(Operator.java:866)

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University ProfessorPosts:1,984RM Engineering
    Hi,

    RapidMiner itself needs to know about the text processing extension, so declare a dependency in your build.xml and make sure the text extension is in the plugin folder of RapidMiner.
    Note: Call RapidMiner.init(); right after setting the execution mode as this is the first thing you need to do before using any other functionality of RapidMiner.

    Regards,
    Marco
  • ranerane MemberPosts:2Contributor I
    Thanks for the reply:)

    Can you be so kind and show me the syntax on how to declare the dependency in my build.xml?
  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University ProfessorPosts:1,984RM Engineering
    Hi,

    you can add the following line to your build.xml to depend on the text processing extension 5.2:


    If you are wondering how the value is defined, have a look at our marketplace here:http://marketplace.rapid-i.com/
    Then check the "product-id" for an extension, see here:http://marketplace.rapid-i.com/UpdateServer/faces/product_details.xhtml?productId=rmx_text

    Regards,
    Marco
Sign InorRegisterto comment.