py MMAX 2: Deep Access to MMAX 2 Projects from Python (2020)

Abstract: pyMMAX2 is an API for processing MMAX2 stand-off annotation data in Python. It provides a lightweight basis for the development of code which opens up the Java- and XML-based ecosystem of MMAX2 for more recent, Python-based NLP and data science methods. While pyMMAX2 is pure Python, and most functionality is implemented from scratch, the API re-uses the complex implementation of the essential business logic for MMAX2 annotation schemes by interfacing with the original MMAX2 Java libraries. pyMMAX2 is available for download at http://github.com/nlpAThits/pyMMAX2 .

## the pymmaxapi in a nutshell in mmax2 parlance, the term basedata is used for tokenized text, which is the basis of every annotation project. annotations for (potentially non-contiguous) sequences of basedata elements exist in the form of markable objects, which refer to the ids of their underlying basedata elements by means of their span attribute, and which contain the actual annotations in the form of attribute-value pairs. markables are organized in named markable levels, each of which can be dedicated to representing a particular (linguistic or other) phenomenon. for each markable level, there is a so-called annotation scheme which defines the attributes and permissible values resp. value combinations that can be assigned to markables on that level. mmax2 basedata, markables, and annotation schemes are all stored as xml files. for each mmax2 project, references to these files are stored in a .mmax file and a common paths.xml foot_2 file. access to a mmax2 project is established through a single discourse object, which serves as the single entry point from which all related data can be accessed. with the exception of the annotation schemes (cf. section 2.2), pymmax2 implements all of the abovementioned objects (and several more) straightforwardly in pure python, making use of tried and tested libraries like beautiful soup. this approach results in compact, fast, and easily extensible code. in general, the philosophy of pymmax2 is to offer lightweight python objects with transparent functionality as a foundation for the development of more advanced annotation processing functionality.