Different result when calling the same process from RM and from IDE[SOLVED]
mmarag
New Altair Community Member
Hello to all,
i have created a RM process that reads a text document, process it with simple text mining operators (e.g. tokenize, transform cases, stopwords) and then loads a weight file and model file (i also tryied to add these as repositories, using retrieve) and classifies the document as positive or negative.
The same document is classified as negative (the right class when someone reads the content of the document) within RM but when called from inside the Java code in Netbeans (again the same process!) it is classified as positive
i am attaching a piece of code that calls the process. Any help is appreciated!
Manolis
i have created a RM process that reads a text document, process it with simple text mining operators (e.g. tokenize, transform cases, stopwords) and then loads a weight file and model file (i also tryied to add these as repositories, using retrieve) and classifies the document as positive or negative.
The same document is classified as negative (the right class when someone reads the content of the document) within RM but when called from inside the Java code in Netbeans (again the same process!) it is classified as positive
i am attaching a piece of code that calls the process. Any help is appreciated!
Manolis
File z=new File("C://Users//.....//Classify.rmp");
Process process1;
IOContainer ioResult1 = null;
try {
process1 = new Process(z);
ioResult1 = process1.run();
} catch (XMLException ex) {
System.out.println("problem with XML Rapidminer");
} catch (OperatorException ex) {
System.out.println("problem with Operator Rapidminer");
}
ExampleSet resultSet1=(ExampleSet)ioResult1.getElementAt(0);
Example example1=resultSet1.getExample(0);
Attribute opinion=example1.getAttributes().get("prediction(Class)");
String resultString1=example1.getValueAsString(opinion);
System.out.println(comment+"->"+resultString1);
0
Answers
-
Can you attach a minimal version of your process and a small amount of your data where this behaviour occurs?0
-
The problem is figured out and solved locally from netbeans. It seemed that Greek and Slovenian characters were not realized by Rapidminer when called from Java, a simple replace made the job. However, I think you people from RapidMiner have to check this issue for future cases..
Best regards
Manolis0 -
Hi,
when creating a process by supplying a File parameter, RapidMiner uses UTF-8 encoding to read the file. If your textfile uses a different encoding, problems like yours may arise.
Regards,
Marco0