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 get “basic dependencies” or "enhancedDependencies" with the option “-outputFormat text” #1339

Closed
JasmineChen123 opened this issue Feb 18, 2023 · 5 comments

Comments

@JasmineChen123
Copy link

I am using this command to get the dependency parsing result of sentence.

java -Xmx8g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,parse  \
-tokenize.whitespace true  -tokenize.keepeol true  -tokenize.language English -ssplit.eolonly  true \
-outputFormat text  < test.en > test.en.out

When I set the "-outputFormat text ", I only get enhanced plus plus dependencies result, like:
root(ROOT-0, ask-5)
advmod(ask-5, However-1)
punct(ask-5, ,-2)
nsubj(ask-5, I-3)
nsubj(ask-5', I-3)
nsubj(ask-5'', I-3)
nsubj(ask-5''', I-3)
nsubj(ask-5'''', I-3)
nsubj(ask-5''''', I-3)
nsubj(ask-5'''''', I-3)
aux(ask-5, would-4)
conj:or(ask-5, ask-5')
conj:or(ask-5, ask-5'')
conj:or(ask-5, ask-5''')
conj:and(ask-5, ask-5'''')
conj:and(ask-5, ask-5''''')
conj:and(ask-5, ask-5'''''')

But I need basic dependencies or enhancedDependencies result.
How can I get “basic dependencies” or "enhancedDependencies" with the option “-outputFormat text”?

@AngledLuffa
Copy link
Contributor

Great question. Actually, that feature currently doesn't exist in the text format. Bad news is that apparently I was the one who wrote it, so I'm on the hook for adding such a feature

@AngledLuffa
Copy link
Contributor

As of the next release (which we expect in a couple weeks), this will work:

java edu.stanford.nlp.pipeline.StanfordCoreNLP -outputFormat text -annotators "tokenize,pos,lemma,ner,depparse" -output.dependencyType basic

if you want it sooner than that, you can download & compile our dev branch

@JasmineChen123
Copy link
Author

As of the next release (which we expect in a couple weeks), this will work:

java edu.stanford.nlp.pipeline.StanfordCoreNLP -outputFormat text -annotators "tokenize,pos,lemma,ner,depparse" -output.dependencyType basic

if you want it sooner than that, you can download & compile our dev branch

Sorry my English is poor. Does it mean that I can use this command after I compile the dev branch now rather than waiting util a couple of weeks later?

@AngledLuffa
Copy link
Contributor

Does it mean that I can use this command after I compile the dev branch now rather than waiting util a couple of weeks later?

Yes, that's the intent.

@JasmineChen123
Copy link
Author

As of the next release (which we expect in a couple weeks), this will work:

java edu.stanford.nlp.pipeline.StanfordCoreNLP -outputFormat text -annotators "tokenize,pos,lemma,ner,depparse" -output.dependencyType basic

if you want it sooner than that, you can download & compile our dev branch

Thanks a lot. After compiling with command 'ant', it works.

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

No branches or pull requests

2 participants