An LPMN query provides a text processing pipeline that consists of language tools and defines their order and parameters. It is written in JSON notation. A list of tools is available here.
JSON is a textual data format. In LPMN, it stores information on the text processing pipeline using language tools and is used in the form of an array, i.e. a list of ordered values. Each list is written in square brackets according to the pattern:
['tool1','tool2','tool3']
It means that the text is processed first by tool1, then by tool2, and finally by tool3.
Some tools allow for a detailed definition of processing parameters. To define a tool with parameters, you should use a notation in the form of a JSON object. An object is a set of values consisting of {key : value} pairs. Each pair must be enclosed in curly brackets according to the pattern:
{'tool':{'parameter':'value'}}
If you use multiple tools, the processing tools order should be as follows:
['tool1','tool2',{'tool3':{'parameter':'value'}},'tool4']
for example: ['any2txt','morphodita',{'liner2':{'model':'n82'}}]
Note:
Examples of LPMN queries for Clarin services can be found in the corresponding sections of the documentation.
Some tools e.g. TermoPL require input data in the form of a directory containing .xml files in CCL format. To indicate the passing of the query result as a directory, a nested list should be used, i.e., tools preceding TermoPL and generating output data in the form of a directory should be enclosed in a square bracket, for example:
[['any2txt',{'postagger':{'lang':'pl','output':'ccl'}}],'termopl']
The program will process the input data sequentially through the tools:
lang
= pl
, output
= ccl
.Then, the output data from the above part of the pipeline will be packed into a directory and passed to the TermoPL tool.
In Linux, an LPMN query can be written in the same way as in Windows, but in addition, the entire query must be placed in quotation marks, for example:
"['any2txt','morphodita',{'liner2':{'model':'n82'}}]"
The original notation and information about working in Linux are available in the document LPMN Client. Users Guide in chapter [4] LPMN CLI Tool in Linux.
(C) CLARIN-PL