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
Integration of Process Documents operator
Hello
i'm trying to use a process documents operator in a java application, the previous operators deliver data to the input ports correctly but i can't obtain any processed data from it.
Here is the code i used to initialize and operate it
Andrea
i'm trying to use a process documents operator in a java application, the previous operators deliver data to the input ports correctly but i can't obtain any processed data from it.
Here is the code i used to initialize and operate it
I'll apreciate any intervention able to reduce my enormous newbieness, thanks to everyone.
processer = OperatorService.createOperator("process_documents");
processer.setEnabled(true);
processer.setParameter("vector_creation", "Term Occurrences");
processer.setParameter("create_word_vector", "true");
processer.setParameter("add_meta_information", "true");
processer.setParameter("keep_text", "false");
// this section is repeated several times in the actual code
filter.getOutputPorts().getPortByIndex(0).connectTo(processer.getInputPorts().getPortByIndex(incounter));
filter.doWork();
processer.getInputPorts().getPortByIndex(incounter).receive(filter.getOutputPorts().getPortByIndex(0).getAnyDataOrNull());
//end of loop
processer.getOutputPorts().getPortByIndex(1).connectTo(transformer.getInputPorts().getPortByIndex(0));
processer.doWork();
Andrea
0
Answers
The answer depends on what you are trying to do, if you want to make an operator that you can integrate with the RM IDE then you need to either take a look at the source of an existing extension, or buy the white paper. If that is what you want to do then you will see that you need to explicitly deliver output to the ports, like this... If on the other hand you want to embed RM in another application then you can barbarise the code as you see fit.
Good luck!
i'm trying to embed RM in another application, but the operator i'm using (process documents, from the text processing extension) doesn't seem to be working correctly, instead of delivering to the output port a word vector obtained from the documents i feed it, i obtain only an empty vector.
I think that i'm missing some initialization step so it actually doesn't process anything, but i can't figure out which one...
Barbaric code is something i produce with a decent bit of enthusiasm, but when my abuses stop giving acceptable results i tend to go back to the experts begging for some advice
As I remember it the 'process documents' operator needs inner operators to do the dirty work, like tokenizing and stemming; if you make a process in RM where there are no inner operators, you guessed it... zippo comes back. For example, if I run the following I get some data back ( just by connecting the inner input to the inner output directly, so just passing through ). whereas when that inner operator is not connected for pass through nothing comes back, i.e when it is like this... Which I guess means you might be better off calling the inner operator directly?
Again, thanks for the assistance and for the quick answers
to add operators to so called super operators, use the following code fragment. Anyway I would suggest taking a look at the API documentation, from where this could have been comprehended.
Greetings,
Sebastian