Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle files ending with lbj when running program from cog comp of Illinois #104

Open
wailoktam opened this issue Jun 29, 2017 · 7 comments

Comments

@wailoktam
Copy link

Hi, I have downloaded the source of one of your colleagues with some lbj files:

http://cogcomp.cs.illinois.edu/page/resource_view/107

and so I install lbjava from here. After finishing a maven install of lbjava, I am still stuck.

The source comes with the following script:
java -Xmx5G -XX:MaxPermSize=5G -cp $CLASSPATH:class LBJ2.Main -sourcepath src -gsp lbj -d class article.lbj
javac -classpath $CLASSPATH:class -sourcepath lbj:src -d class src/esl/*.java

The first line of the script goes well after I replace $CLASSPATH with the path to LBJ2.jar.

Now when running the second line, one of java source in "src/esl/*.java" fails because it contains a call to a function in "article.lbj"

May I know how to get the 2nd line to succeed? Currently, the $CLASSPATH of the 2nd line is exactly the same as the first line, pointing to LBJ2.jar

Any help would be appreciated.

@danyaljj
Copy link
Member

Could you clone the current project and use this one? Because the code on the website is outdated

@wailoktam
Copy link
Author

Do you mean I should not use lbj2.jar provided with the source in http://cogcomp.cs.illinois.edu/page/resource_view/107

So I point the class path to $HOME/lbjava/lbjava/target/classes ?

@wailoktam
Copy link
Author

Hi, I know it is not the proper place to ask about the source in http://cogcomp.cs.illinois.edu/page/resource_view/107

But if anyone of you know anything, I would be extremely grateful. The following gives me a lot of complaints about unknown symbols and missing classes

java -Xmx5G -XX:MaxPermSize=5G -cp /home/ubuntu/lbjava/lbjava/target/classes:/home/ubuntu/ACL2016Code/lbj/LBJ2Library.jar:/home/ubuntu/ACL2016Code/lbj/LBJChunk.jar:/home/ubuntu/ACL2016Code/lbj/LBJPOS.jar:/home/ubuntu/ACL2016Code/lbj/:class:/home/ubuntu/lbjava/lbjava/target/ LBJ2.Main -sourcepath src -gsp lbj -d class article.lbj

Compiling generated code
lbj/esl/PrepositionUnconfuse.java:39: error: cannot find symbol
    setEncoding(null);
    ^
  symbol:   method setEncoding(<null>)
  location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:63: error: cannot find symbol
      lcFilePath = new java.net.URL("file:" + modelPath);
      ^
  symbol:   variable lcFilePath
  location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:64: error: cannot find symbol
      lexFilePath = new java.net.URL("file:" + lexiconPath);
      ^
  symbol:   variable lexFilePath
  location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:73: error: cannot find symbol
      readModel(lcFilePath);
                ^
  symbol:   variable lcFilePath
  location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:74: error: cannot find symbol
      readLexiconOnDemand(lexFilePath);
                          ^
  symbol:   variable lexFilePath
  location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:111: error: no suitable method found for learn(int[],double[],int[],double[])
        super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]);
             ^
    method Learner.learn(Object) is not applicable
      (actual and formal argument lists differ in length)
    method Learner.learn(Object[]) is not applicable
      (actual and formal argument lists differ in length)
    method SparseNetworkLearner.learn(Object) is not applicable
      (actual and formal argument lists differ in length)
lbj/esl/PrepositionUnconfuse.java:159: error: cannot find symbol
        return super.featureValue((int[]) a[0], (double[]) a[1]);
                    ^
  symbol: method featureValue(int[],double[])
lbj/esl/PrepositionUnconfuse.java:163: error: cannot find symbol
    __result = super.featureValue(__example);
                    ^
  symbol: method featureValue(Object)
lbj/esl/PLabel.java:35: error: cannot find symbol
    return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length);
               ^
  symbol:   class DiscretePrimitiveStringFeature
  location: class PLabel
lbj/esl/headWordHeadPos.java:47: error: cannot find symbol
      __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0));
                              ^

I would be extremely grateful to any help.

@danyaljj
Copy link
Member

What I mean is, clone this project and follow the instructions on the readme?

@wailoktam
Copy link
Author

Hi, I have cloned this project and succeeded with compiling it with maven.

How do I get the lbj file in http://cogcomp.cs.illinois.edu/page/resource_view/107 to compile?

@danyaljj
Copy link
Member

Ah I see. Sorry misunderstood your problem. Let me take a look at this package and get back to you.

@wailoktam
Copy link
Author

Hi, thanks. This is the command I try to run:

java -Xmx5G -XX:MaxPermSize=5G -cp /home/ubuntu/ACL2016Code/lbj/LBJ2.jar:/home/ubuntu/ACL2016Code/lbj/LBJ2Library.jar:/home/ubuntu/ACL2016Code/lbj/LBJChunk.jar:/home/ubuntu/ACL2016Code/lbj/LBJPOS.jar:class /home/wailoktam/ubuntu/ACL2016Code/lbj/LBJ2/classify/ LBJ2.Main -sourcepath src -gsp lbj -d class article.lbj

I am getting the following errors:

Generating code for PrepositionUnconfuse
Compiling generated code

lbj/esl/PrepositionUnconfuse.java:39: error: cannot find symbol
setEncoding(null);
^
symbol: method setEncoding()
location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:63: error: cannot find symbol
lcFilePath = new java.net.URL("file:" + modelPath);
^
symbol: variable lcFilePath
location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:64: error: cannot find symbol
lexFilePath = new java.net.URL("file:" + lexiconPath);
^
symbol: variable lexFilePath
location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:73: error: cannot find symbol
readModel(lcFilePath);
^
symbol: variable lcFilePath
location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:74: error: cannot find symbol
readLexiconOnDemand(lexFilePath);
^
symbol: variable lexFilePath
location: class PrepositionUnconfuse
lbj/esl/PrepositionUnconfuse.java:111: error: no suitable method found for learn(int[],double[],int[],double[])
super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]);
^
method Learner.learn(Object) is not applicable
(actual and formal argument lists differ in length)
method Learner.learn(Object[]) is not applicable
(actual and formal argument lists differ in length)
method SparseNetworkLearner.learn(Object) is not applicable
(actual and formal argument lists differ in length)
lbj/esl/PrepositionUnconfuse.java:159: error: cannot find symbol
return super.featureValue((int[]) a[0], (double[]) a[1]);
^
symbol: method featureValue(int[],double[])
lbj/esl/PrepositionUnconfuse.java:163: error: cannot find symbol
__result = super.featureValue(__example);
^
symbol: method featureValue(Object)
lbj/esl/PLabel.java:35: error: cannot find symbol
return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length);
^
symbol: class DiscretePrimitiveStringFeature
location: class PLabel
lbj/esl/headWordHeadPos.java:47: error: cannot find symbol
__result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants