0

We are currently using the NNDEP parser in Stanford parser to process Chinese data, expecting to obtain useful syntax trees. Below is what we used to set the parameters:

java -cp "./*" edu.stanford.nlp.parser.nndep.DependencyParser -language chinese -model edu/stanford/nlp/models/parser/nndep/CTB_CoNLL_params.txt.gz -tagger.model edu/stanford/nlp/models/pos-tagger/chinese-distsim/chinese-distsim.tagger -escaper edu.stanford.nlp.trees.international.pennchinese.ChineseEscaper -textFile INPUT_FILE

However, the output is not as same as the grammar relations described in the paper Discriminative reordering with Chinese grammatical relations features. If we have two sentences: 1. 我把他打了, 2. 我打了他, the result we obtained is as following:

   SUB(把-2, 我-1)
   root(ROOT-0, 把-2)
   SUB(打了。-4, 他-3)
   VMOD(把-2, 打了。-4)


   SUB(打了-2, 我-1)
   root(ROOT-0, 打了-2)
   OBJ(打了-2, 他。-3)

which is similar to the result outputted from the default English parser.

We referred to the manual and read the source code, and we could not find any clue. Therefore, could anyone please let us know how to set the right parameter to process Chinese data in a right way? Many thanks!

2
  • Hi, could you please provide me with an example Chinese sentence and the parse you were hoping to see, and I'll look into this further! Thanks! Oct 27, 2015 at 23:25
  • @stanfordNLPHelp thank you for the response. If we have a sentence like '我打了他', we expect to have a result as ‘NSUBJ(打了-2, 我-1) root(ROOT-0, 打了-2) DOBJ(打了-2, 他。-3)’ in accordance with the Chinese Grammatical Relations in the paper Discriminative reordering with Chinese grammatical relations features
    – acepor
    Oct 29, 2015 at 7:04

1 Answer 1

0

This command will generate the dependencies referenced in that paper:

java -Xmx6g -cp "*:." -Xmx2g edu.stanford.nlp.pipeline.StanfordCoreNLP -file sample_chinese_text.txt -props StanfordCoreNLP-chinese.properties -outputFormat text -parse.originalDependencies

The key is using the "parse" annotator instead of "depparse".

Note: StanfordCoreNLP-chinese.properties can be found in the stanford-corenlp-3.5.2-models-chinese.jar or stanford-chinese-corenlp-2015-04-20-models.jar if you want to exam the settings

Note: We distribute some more models that work with the "parse" annotator, and they can be found in stanford-parser-3.5.2-models.jar on Maven or the models jar distributed with the standard parser:

http://nlp.stanford.edu/software/lex-parser.shtml

The issue here is that the NN dependency parser does not output the Stanford Dependencies for Chinese referenced in the paper you are referring to, the NN dependency parser uses a different type of dependencies

Here are some relevant papers that discuss what the NN dependency parser creates:

http://cs.stanford.edu/~danqi/papers/emnlp2014.pdf

http://stp.lingfil.uu.se/nodalida/2007/pdf/NODALIDA16.pdf

2
  • Thank you very much! Actually, we tried the parser in the CoreNLP package before, and the parsing speed of the parser cannot match our expectation. That's why we changed to the NN dependency parser. Therefore, the current question is, if we still want to use the NN parser, can we train the model with the Chinese Grammatical Relations by ourselves? Or do we need to change the code of the NN parser to satisfy our need? Thanks.
    – acepor
    Oct 30, 2015 at 4:52
  • You should be able to train your own model if you put the data in CoNLL format ; there are some details provided at this link: nlp.stanford.edu/software/nndep.shtml Oct 30, 2015 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.