ProjetPP / PPP-QuestionParsing-Grammatical

Question Parsing module for the PPP using a grammatical approch
GNU Affero General Public License v3.0
33 stars 11 forks source link

Use version 3.5.1 of the Stanford Parser #119

Closed yhamoudi closed 9 years ago

yhamoudi commented 9 years ago

See http://nlp.stanford.edu/software/corenlp.shtml (bottom of the page)

Substantial NER and dependency parsing improvements

yhamoudi commented 9 years ago

I tried to modify https://github.com/ProjetPP/Scripts/blob/master/bootstrap_corenlp.sh but i obtain many errors...

progval commented 9 years ago
progval@ganymede:~/etudes/ens/ppp/deployment(master)$ /usr/bin/java -Xmx1g -cp stanford-corenlp-full-2015-01-30/stanford-corenlp-3.5.1.jar:stanford-corenlp-full-2015-01-30/stanford-corenlp-3.5.1-models.jar:stanford-corenlp-full-2015-01-30/xom.jar:stanford-corenlp-full-2015-01-30/joda-time.jar:stanford-corenlp-full-2015-01-30/jollyday.jar:stanford-corenlp-full-2015-01-30/ejml-0.23.jar edu.stanford.nlp.pipeline.StanfordCoreNLP -props /home/progval/.local/lib/python3.4/site-packages/corenlp/default.properties -parse.flags  -makeCopulaHead
Exception in thread "main" java.lang.UnsupportedClassVersionError: edu/stanford/nlp/pipeline/StanfordCoreNLP : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

Looks like it depends on Java 8. Which we already need for the FrenchParser anyway.

progval commented 9 years ago

Preliminary: https://bitbucket.org/ProgVal/corenlp-python/commits/67c626d27992297157dbfbe27c4b3837f6ca0a50

yhamoudi commented 9 years ago

Why did you copied bootstrap_corenlp.sh into the question parsing repository? We cannot leave it into Scripts/ ?

I've installed java 8 and changed boostrap_corenlp.sh (into Scripts/):

#!/bin/bash

USER_MODE="--user"
if [ $# -eq 1 ] && [ $1 == "--nouser" ]
then
    echo "No user mode."
    USER_MODE=""
fi

python3 -m pip install pexpect unidecode xmltodict jsonrpclib-pelix $USER_MODE

if [ ! -f corenlp-python ]
then
    echo "Cloning Valentin's modified corenlp-python library…"
    git clone https://bitbucket.org/ProgVal/corenlp-python.git
fi
echo "Installing it…"
cd corenlp-python
python3 setup.py install $USER_MODE
cd ..
if [ ! -f stanford-corenlp-full-2015-01-29.zip ]
then
    echo "Downloading CoreNLP (long: 221MB)…"
    wget http://nlp.stanford.edu/software/stanford-corenlp-full-2015-01-29.zip
fi
echo "Extracting CoreNLP…"
rm -rf stanford-corenlp-full-2015-01-29
unzip stanford-corenlp-full-2015-01-29.zip
echo "All seemed to work. Hold tight while we test it on a simple example (might take some time)."
CORENLP=stanford-corenlp-full-2015-01-30 python3 -c "print(repr(__import__('corenlp').StanfordCoreNLP().raw_parse('This is a sentence.')))"

Then i ran CORENLP="stanford-corenlp-full-2015-01-30" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp and all work :)

progval commented 9 years ago

Because I thought the new version of the StanfordParser was broke the integration. You can indeed put this script back into the Scripts repo.

yhamoudi commented 9 years ago

In dependencies.sh, i just need to uncomment the 2 first lines and replace CORENLP="stanford-corenlp-full-*" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp & by CORENLP="stanford-corenlp-full-2015-01-30" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp & ?

#git clone https://github.com/ProjetPP/Scripts.git
#cd Scripts
./bootstrap_corenlp.sh --nouser

export JAVA_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
if [ ! -f $JAVA_PATH ]
then
    export JAVA_PATH=/usr/lib/jvm/java-8-oracle/bin/java
fi
CORENLP="stanford-corenlp-full-*" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp &
progval commented 9 years ago

yes

On 16/02/2015 14:51, Yassine wrote:

In dependencies.sh, i just need to uncomment the 2 first lines and replace CORENLP="stanford-corenlp-full-*" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp & by CORENLP="stanford-corenlp-full-2015-01-30" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp & ?

#git clone https://github.com/ProjetPP/Scripts.git
#cd Scripts
./bootstrap_corenlp.sh --nouser

export JAVA_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
if [ ! -f $JAVA_PATH ]
then
    export JAVA_PATH=/usr/lib/jvm/java-8-oracle/bin/java
fi
CORENLP="stanford-corenlp-full-*" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp &

Reply to this email directly or view it on GitHub: https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical/issues/119#issuecomment-74510757

yhamoudi commented 9 years ago

Done.

Is there something else to do before merging the branch?

progval commented 9 years ago

Merged.

yhamoudi commented 9 years ago

I realize that you didn't merged the last version of update-corenlp branch. I think that none of my commits has been taken into account :(

progval commented 9 years ago

I did a squashed merge. See 8163002ac549e1a66f946337beee1aa16438f638.

yhamoudi commented 9 years ago

Yes, but it missed 2 commits (see https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical/pull/121), for instance, i removed the file bootstrap_corenlp.sh but it still exists in master