rsennrich / ParZu

The Zurich Dependency Parser for German
https://pub.cl.uzh.ch/demo/parzu/
GNU General Public License v2.0
81 stars 19 forks source link

Using the python module #13

Closed inventorix closed 5 years ago

inventorix commented 6 years ago

Hello,

i am trying to use Parzu from my python programm. Unfortunately I cannot find an explanation how to use the python module. How does the method call look like? Is there anything special to do. Thanks in advance.

rsennrich commented 6 years ago

apologies that this is currently under-documented. You can import parzu.py as a module and then run the main() function. A small word of warning: parzu.py glues together several calls to Python, Perl and swi-prolog programs, and as there is currently no server mode (see issue #6), every call to the function will re-initialize these programs.

rsennrich@xxx:/data/ParZu$ python

import parzu options = parzu.process_arguments() parzu.main(options, open('infile'), open('outfile', 'w'))