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

ClassNotFoundException when producing dependency parsers #13

Open
Lucho0491 opened this issue Jun 2, 2020 · 1 comment
Open

ClassNotFoundException when producing dependency parsers #13

Lucho0491 opened this issue Jun 2, 2020 · 1 comment

Comments

@Lucho0491
Copy link

When I tried to run the cmd in the 'dependency_parse' function in preprocess_sst.py, an error occurred as follows:

Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.tagger.maxent.ExtractorNonAlphanumeric

I guess ExtractorNonAlphanumeric should exist in the corresponding directory in the stanford-parser.jar, but it is not the case actually. Can you help solve this issue? Many thanks.

@ttpro1995
Copy link
Owner

ttpro1995 commented Jun 2, 2020

Please make sure from terminal working directory, there are lib folder (https://github.com/ttpro1995/TreeLSTMSentiment/tree/master/lib)

In python code (https://github.com/ttpro1995/TreeLSTMSentiment/blob/master/scripts/preprocess-sst.py)

    # produce dependency parses
    classpath = ':'.join([
        lib_dir,
        os.path.join(lib_dir, 'stanford-parser/stanford-parser.jar'),
        os.path.join(lib_dir, 'stanford-parser/stanford-parser-3.5.1-models.jar')])
    for filepath in sent_paths:
        dependency_parse(filepath, cp=classpath, tokenize=False)

make sure it point to java lib (https://github.com/ttpro1995/TreeLSTMSentiment/tree/master/lib)

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