ufal / udpipe

UDPipe: Trainable pipeline for tokenizing, tagging, lemmatizing and parsing Universal Treebanks and other CoNLL-U files
Mozilla Public License 2.0
358 stars 75 forks source link

Minimum working example for Python #61

Closed ajdapretnar closed 6 years ago

ajdapretnar commented 6 years ago

This looks like a great tool, but I am struggling to get it working with Python. Could you provide a minimum working example?

I imagine sth like:

from ufal.udpipe import Tokenizer

data = open("mydata")
tokenize = Tokenizer()
new_data = tokenize(data)
print(new_data[:3])
martinpopel commented 6 years ago

See https://github.com/ufal/udpipe/blob/master/releases/pypi/test/test_udpipe.py and https://pypi.python.org/pypi/ufal.udpipe/1.2.0.1#run-udpipe

ajdapretnar commented 6 years ago

Thank you!