Search code examples
nlpstanford-nlp

Activate makeCopulaHead in Stanford CoreNLP parser


I want to use Stanford CoreNLP Parser to parse a sentence with the flag "makeCopulaHead" activated.

In my file input.txt, I have the following sentence:

I am tall.

The objective is to not have a copula relation (cop) in the output dependency tree.

I tried:

java -cp "*" -mx8g edu.stanford.nlp.pipeline.StanfordCoreNLP -makeCopulaHead -file input.txt 

The .xml file contains cop relation :(

I also tried (a bug with xml-output: https://mailman.stanford.edu/pipermail/java-nlp-user/2013-January/002959.html ?):

java -cp "*" -mx8g edu.stanford.nlp.pipeline.StanfordCoreNLP -makeCopulaHead -file input.txt -outputFormat text 

But it's the same thing...


Solution

  • I've finally found out the solution, the correct line is:

    java -cp "*" -mx8g edu.stanford.nlp.pipeline.StanfordCoreNLP -parse.flags " -makeCopulaHead" -file input.txt 
    

    Don't forget the space in " -makeCopulaHead".