We’ve come across a little coding problem when building a Java pipeline to process our texts with the MATE tools. In the current version of the MATE source (as of the writing of this post, revision 234), the dependency parser at
is2.parser.Parser can only be called by its
main() method for every single document, which also means that the parsing model has to be loaded for every document. With a few million texts to be processed, this would take ages… Unfortunately, the central
out() method of the class [source], which does most of the work and is called after the model has once been loaded, is set to private access, i.e. our Java pipeline cannot access it. Interestingly, the equivalent methods in the lemmatizer and tagger classes are
public. As a fix, we checked out the MATE source and set the method to
public so that we could use it in our pipeline. We are not sure why the MATE developers decided to set the method to
private, but as we see no gain in this and given the public access for the central methods in the other classes, we believe this was not done on purpose.
We encountered similar problems the method
is2.parser.Pipe.nextInstance() [source] and the fields
is2.mtag.Tagger.params [source]. As in the first case with is2.parser.Parser.out(), we set the method/fields to
public in order to use them.
Our pipeline/MATE wrapper now works fine, and we only have to load each model once for all processed files!