回复: Stanford Parser online
For English Text:
Under DOS, go to the directory where the parser is located, then type the line below:
lexparser.bat input.txt >output.txt
Then, enter to get your result.
For processing Chinese texts
Firstly, you need segement the input text (search ICTCLAS in this forum if you don't have). That is, convert 今天真热。to 今天 真 热 。
Then save the segmented text in GB format (not UTF-8, which is used for the GUI/windows version).
Next, creat a bat file by copying and pasting the following lines (between the equal signs in blue) to your notepad, and save it with a name of lexparserCh.bat to the same folder where your parser program is:
=============================
@echo off
:: Runs the Chinese PCFG parser on one or more files, printing trees only
:: usage: lexparser fileToparse
java -server -mx800m -cp "stanford-parser.jar;" edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat "penn,typedDependenciesCollapsed" chineseFactored.ser.gz %1
=============================
Finally, go to the directory where the parser is located, and type the line below:
lexparserCh.bat inputCh.txt >outputCh.txt
Then, enter to get your result.
how can I process a text and output the result?
thank you.
For English Text:
Under DOS, go to the directory where the parser is located, then type the line below:
lexparser.bat input.txt >output.txt
Then, enter to get your result.
For processing Chinese texts
Firstly, you need segement the input text (search ICTCLAS in this forum if you don't have). That is, convert 今天真热。to 今天 真 热 。
Then save the segmented text in GB format (not UTF-8, which is used for the GUI/windows version).
Next, creat a bat file by copying and pasting the following lines (between the equal signs in blue) to your notepad, and save it with a name of lexparserCh.bat to the same folder where your parser program is:
=============================
@echo off
:: Runs the Chinese PCFG parser on one or more files, printing trees only
:: usage: lexparser fileToparse
java -server -mx800m -cp "stanford-parser.jar;" edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat "penn,typedDependenciesCollapsed" chineseFactored.ser.gz %1
=============================
Finally, go to the directory where the parser is located, and type the line below:
lexparserCh.bat inputCh.txt >outputCh.txt
Then, enter to get your result.