Stanford Parser and NLTK

后端 未结 18 2573
既然无缘
既然无缘 2020-11-22 01:32

Is it possible to use Stanford Parser in NLTK? (I am not talking about Stanford POS.)

18条回答
  •  Happy的楠姐
    2020-11-22 02:13

    If I remember well, the Stanford parser is a java library, therefore you must have a Java interpreter running on your server/computer.

    I used it once a server, combined with a php script. The script used php's exec() function to make a command-line call to the parser like so:

     /pathTo/resultFile 2>/dev/null" );
    
    ?>
    

    I don't remember all the details of this command, it basically opened the fileToParse, parsed it, and wrote the output in the resultFile. PHP would then open the result file for further use.

    The end of the command directs the parser's verbose to NULL, to prevent unnecessary command line information from disturbing the script.

    I don't know much about Python, but there might be a way to make command line calls.

    It might not be the exact route you were hoping for, but hopefully it'll give you some inspiration. Best of luck.

提交回复
热议问题