percyliang / sempre

Semantic Parser with Execution
Other
828 stars 301 forks source link

SEMPRE with Java 17? #228

Open therealansh opened 2 years ago

therealansh commented 2 years ago

Hey, so I tried building Sempre with Java 17 for REGEL project but I am having trouble. Firstly, I am using Java 17 and IntelliJ Idea as the IDE. Starting from, building I did the dependencies pull (./pull-dependencies ...) and they installed perfectly. Altho, once I start building regex for semparse I run into multiple errors of

error: package org.omg.PortableInterceptor does not exist

but since they are not used anywhere I simply solved it by commenting it. And once I again run it, I face an error of ClassNotFoundException.

Grammar.readjava.lang.RuntimeException: java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.sketch.UnarySketchFn

At first, I thought this might be a Java 17 issue but I guess Java is backward compatible and could work with java 1.8? (correct me if I am wrong?) .

Steps to reproduce

  1. Clone REGEL
    cd sempre/ 
    ./pull-dependencies core \                                                                     
    ./pull-dependencies corenlp \
    ./pull-dependencies tables \
    ./pull-dependencies freebase
    cd ..
    python3 synthesize_benchmark.py    

This might throw an error of file not found its because sempre couldn't finish up the subprocess. But for forwards steps it produces the necessary file. For more logs you can try:

cd sempre/
python3 py_scripts/test.py --dataset _tmp --model_dir pretrained_models/pretrained_so --topk 25

This is the command that throws an error. Hoping to find a way out Thanks in advance

therealansh commented 2 years ago

I have opened an issue at REGEL as well #14 this highlights most of the errors I run into.

ppasupat commented 2 years ago

edu.stanford.nlp.sempre.sketch.UnarySketchFn looks like a custom class implemented in REGEL and is not in the original SEMPRE.

In REGEL's sempre/py_scripts/test.sh, could you try replacing the ant regex line with

ant core tables sketch regex

The current command (ant regex) does not have the sketch target and thus does not compile files in the sketch subpackage.