🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

[SOLVED] Operator Input Problem

User: "johan_CG"
New Altair Community Member
Updated by Jocelyn
Hello Everybody

As I explain in this post (http://rapid-i.com/rapidforum/index.php/topic,6340.0.html) I would like to filter documents using a list of word.
So I decided to create an operator doing the opposite of "Filter Stopwords (Dictionary)" by modifying the 74th line of StopwordFilterOperator.java

if (filter.isStopword(token.getToken()))
I removed the '!' in the if condition.
But my operator was in conflict with the real "Text Processing Operator".

So I modified the following files to avoid the conflict:
  • OperatorsStartword.xml
  • OperatorsDocStartword.xml
  • build.xml
I also renamed all occurrences of "Stopword" and "Text Processing" by "Startword" using the refactor function of eclipse.

Unfortunatly now I've got the following error in RapidMiner when I try to use my operator:

Expected Document but received Document.
???

Can somebody helps me please?
Many thanks in advance

Johan

Find more posts tagged with

Sort by:
1 - 10 of 101
    User: "aborg"
    New Altair Community Member
    Hi Johan, it seems you have Document classes loaded by different classloaders. I guess different plugins use different classloaders, but (maybe because of the third party dependencies) your extension tries to use the other classloader's Document class. I would try to make the original plugin a dependency of yours. Do you think this viable? (Otherwise you might delete the old and use only yours.)
    Hth, gabor
    User: "johan_CG"
    New Altair Community Member
    OP
    Hi Gabor

    Thank you for your reply.
    I'm very new in RapidMiner use so I'm not familiar with the classloaders and the dependencies management.
    Can you tell me where I may find the document classes or the java classe names?

    Thanks in advance
    Johan
    User: "johan_CG"
    New Altair Community Member
    OP
    Hi all

    Finally I adopted an other approach.
    I give up the idea of create my own extension and simply add my operator to the existing "Text Processing Extension" in only 3 steps.  8)
    Thank you Gabor for the idea  ;D

    Regards
    Johan
    User: "RaedMarji"
    New Altair Community Member
    Hello aborg, can you guide me on how to make the text plugin a dependency of my plugin?
    User: "aborg"
    New Altair Community Member
    Hello Raed,

    I am sorry I cannot. I have never done that before, it was just an idea. I hope someone else can help you or you find a solution.
    Cheers, gabor
    User: "RaedMarji"
    New Altair Community Member
    no worries aborg, I have already got my answer in this link if you are interested http://rapid-i.com/rapidforum/index.php/topic,6500.0.html :)
    User: "Noor"
    New Altair Community Member
    Hi johan_CG,

    I have developed a new FilterStopwords operator and successfully loaded it in RapidMiner, but when I try to run the process, I got the same error what you have got.

    Expected Document but received Document.

    Can you please elaborate how you have resolved this issue?

    Thanks!
    User: "Marco_Boeck"
    New Altair Community Member
    Hi,

    most likely the reason for this to happen is that an extension bundles the class files from all libs it requires into the extension jar file. So if you depend on the text extension, make sure it is available not as a .jar library but rather as a project itself. Otherwise you will end up with all class files of the text extension in your jar so when every extension is loaded by Studio, the class files of the text extension exist twice. And that generates exactly the error you are getting.

    Regards,
    Marco
    User: "Noor"
    New Altair Community Member
    Hello,

    Yes I have added the text mining extension as jar in the lib folder of my project. From where can I get the Text-Mining extension project?

    Thank you for your assistance Sir.

    Aniee
    User: "Marco_Boeck"
    New Altair Community Member