Skip to main content

Deals with ExportXMLv2 format for annotated text

Project description

exmldoc is a library for loading .exml.xml files either produced by PyTree or by the ExportXMLv2 Java library and assorted tools. The EXML file format is one of the file formats used for the TüBa-D/Z treebank of German and offers the possibility to store multilayer linguistic annotations in a (mostly) human-readable format.

As long as you are working with small documents, usage is relatively simple: load a document with


import exmldoc from exmldoc.tree import Tree

doc = exmldoc.load(‘file.exml.xml’)

you can then (for example) enumerate all sentences with:

for sent in doc.get_objects_by_class(Tree):
print doc.words[sent.span[0]:sent.span[1]]

or access the token objects with

for sent in doc.get_objects_by_class(Tree):
for token in doc.w_objs[sent.span[0]:sent.span[1]]
print token.word,, token.lemma

You can change a document and then save it with


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for exmldoc, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size exmldoc-1.0.4.tar.gz (38.0 kB) File type Source Python version None Upload date Hashes View
Filename, size exmldoc-1.0.4-py2-none-any.whl (75.0 kB) File type Wheel Python version py2 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page