YASMEEN matching engine

From D4Science Wiki
Revision as of 20:06, 27 October 2013 by Fabio.fiorellato (Talk | contribs) (Normalized (stemmed) species name matchlet configuration)

Jump to: navigation, search

"Yet Another Species Matching Execution ENgine" - Matching engine CLI tool

Purposes

The YASMEEN matching engine is the command line (CLI) tool that implements the MATCH DATA and PRODUCE MATCHING RESULTS steps in the YASMEEN data flow.

It takes a parsed input data file as input, a set of TAF files as reference data, a set of matchlets configuration options and identifies matching between input and reference data entries, producing results in a format specified by the user.

Command line

java -jar YASMINE-engine-<version>.jar <options>

This CLI tool can be launched with the '-h' option to get a report of the available options:

java -jar YASMINE-engine-<version>.jar -h

Will give:

usage:
 -dontSkipHeader          Set this option if the parsed input data file doesn't start with a CSV header row
 -h                       Print this message
 -hfm                     Instructs the system to halt the current data process at the first valid matching (i.e. a matching
                          with an overall score higher than the minimum set)
 -inFile <arg>            Path to a text file containing the parsed input data (one per line)
 -law <arg>               Sets the different lexical algorithms weight for matchers that do perform lexical comparisons. The
                          syntax of this parameter is: <lev>:<sndx>:<trig>, with <lev> being the weight of the calculated
                          Levenshtein similarity, <sndx> being the weight of the calculated soundex comparison and <trig> being
                          the weight of the calculated trigram similarity. To enable Levenshtein similarity only, use -law
                          100:0:0. Conversely, to enable soundex only you should use: -law 0:100:0, to enable trigrams only you
                          should use -law 0:0:100 and to enable an equal mix of all three, you should use -law 100:100:100.
                          Valid values for each of these three weights are in the range [0, 100]
 -man                     Enables the authority name matching
 -mant <arg>              Sets the authority name matching results minimum score threshold (0.0, 1.0]
 -manw <arg>              Sets the authority name matching weight (0.0, n]
 -may                     Enables the authority year matching
 -mayt <arg>              Sets the authority year matching results minimum score threshold (0.0, 1.0]
 -mayw <arg>              Sets the authority year matching weight (0.0, n]
 -mc <arg>                Sets the maximum number of matching candidates for each entry [1, n]
 -mftm                    Enables the FuzzyTaxamatch matching
 -mftmt <arg>             Sets the FuzzyTaxamatch matching results minimum score threshold (0.0, 1.0]
 -mftmw <arg>             Sets the FuzzyTaxamatch matching weight (0.0, n]
 -mgn                     Enables the genus name matching
 -mgnt <arg>              Sets the genus name matching results minimum score threshold (0.0, 1.0]
 -mgnw <arg>              Sets the genus name matching weight (0.0, n]
 -mNgn                    Enables the normalized genus name matching
 -mNgnt <arg>             Sets the normalized genus name matching results minimum score threshold (0.0, 1.0]
 -mNgnw <arg>             Sets the normalized genus name matching weight (0.0, n]
 -mNsn                    Enables the normalized species name matching
 -mNsnt <arg>             Sets the normalized species name matching results minimum score threshold (0.0, 1.0]
 -mNsnw <arg>             Sets the normalized species name matching weight (0.0, n]
 -mSn                     Enables the scientific name matching
 -msn                     Enables the species name matching
 -msnt <arg>              Sets the species name matching results minimum score threshold (0.0, 1.0]
 -mSnt <arg>              Sets the scientific name matching results minimum score threshold (0.0, 1.0]
 -msnw <arg>              Sets the species name matching weight (0.0, n]
 -mSnw <arg>              Sets the scientific name matching weight (0.0, n]
 -mst <arg>               Sets the matching results minimum score threshold (0.0, 1.0]
 -mt                      If enabled, target data will be materialized in-memory before actually launching the process [
                          EXPERIMENTAL FEATURE ]
 -mtm                     Enables the Taxamatch matching
 -mtmw <arg>              Sets the Taxamatch matching weight (0.0, n]
 -outFile <arg>           Results will be written to this file. When not set defaults to standard output.
 -ps                      If the -pt option is enabled, each thread will be assigned a fraction of the input source data to
                          process against the target data [ EXPERIMENTAL FEATURE ]
 -pt <arg>                Specifies the number of threads for parallel execution. It can either be an absolute number (e.g. -pt
                          4 - use 4 parallel threads) or a relative number with respect to the number of cores (e.g. -pt 4.5x -
                          use a number of thread that is 4.5 times the number of available cores) [ EXPERIMENTAL FEATURE ]
 -refData <arg>           Specify coordinates for a reference data source. These are in the form: <PROVIDER ID>@<TAXA SOURCE
                          URL>(,<VERNACULAR NAMES SOURCE URL>)
 -report                  Results are emitted in human-readable format
 -verbose                 Enables emitting some (very) verbose messages during the process
 -wait                    Request to wait for users hitting ENTER before starting the process
 -xml                     Results will be emitted in XML format
 -xslTemplate <arg>       Specifies an embedded transformation template for the XML output among { stripped, simple, csv,
                          csvNoHeader }
 -xslTemplateFile <arg>   Apply the given XSL stylesheet to the XML output before emitting the results

General command line options

-h

Help

This option requires no arguments, and - when set - will print the help message and exit (no matching process will be performed)

-wait

Wait User Interaction

This option requires no argument and - when set - will force the engine to wait for user pressing the ENTER key before actually launching the process. It is not enabled by default.

-verbose

Enable Verbose Logging

This option requires no argument and - when set - will instruct the engine to produce extremely verbose output during the computation.

Input file command line options

-inFile

Specify Parsed Input Data File [ mandatory ]

Specifies the path to the input file (in parsed input data format) containing the data to match against the specified (via the -refData option) reference data sets.

-dontSkipHeader

Don't Skip Parsed Input Data Header

This option requires no argument and - when enabled - will tell the engine that the input data file does not contain a header row. This makes sense only when the parsed input data file has been produced with the -noHeader option enabled in the input data parser tool.

This option is disabled by default, thus the input data file header will be skipped.

Reference data command line options

-refData

Specify Reference Data Coordinates [ mandatory ]

Specifies the coordinates for a reference data source. These are in the form:

<PROVIDER ID>@<TAXA TAF URL>(,<VERNACULAR NAMES TAF URL>)
  • The <PROVIDER ID> part is mandatory: it is a user-specified identifier (e.g. ASFIS, FISHBASE, OBIS) that provides context to the reference data.
  • The <TAXA TAF URL> part is also mandatory, while the <VERNACULAR NAMES TAF URL> part is optional (there's no current matchlet that works on vernacular names for the time being).

This option can be repeated multiple times on the command line, once for every reference data source to use.

Please note: the file:// protocol needs to be used to reference local TAF files.

Placeholders expansion

In the TAF file URLs you can also use placeholders that will be expanded to their corresponding values.

These are:

{providerId}

that will be replaced with the actual <PROVIDER ID> as specified by the reference data option value [ works with any URL protocol ]

{cd}

that will be replaced with the current directory (according to the OS-specific filesystem path format) [ works with 'file://' URLs only ]

-mt

Materialize Reference Data

This option requires no argument and - when set - will instruct the matching engine to materialize reference data sets (specified via the -refData option) in memory.

In-memory materialization happens just before the actual matching process start and takes a time proportional to the number (and size) of specified reference data sets. It also requires proper Java heap dimensioning via the -Xms and -Xmx command line options, especially for larger data sets. In turn, it will produce relevant increases in the matching engine efficiency.

By default, the matching engine starts with the -mt option not enabled, thus it will stream reference data on request and have an extremely small additional memory footprint (albeit at the expense of efficiency).

Matching execution configuration options

-pt

Use Multiple Parallel Threads [ optional ]

Specifies the number of parallel threads to use during process execution: its value can either be an absolute number of threads (e.g. -pt 4) or a multiple of the number of CPU cores available on the host machine (e.g. -pt 1.5x).

Known parallel execution process models suggest that the maximum number of parallel threads should not be bigger than twice the number of CPU cores. Conversely, a bigger number of parallel threads will produce no actual benefits in efficiency.

By default, the process execution will use a single thread unless the -pt option is set.

-ps

Parallelize Sources

This option requires no value and can be set only in combination with the -pt option.

By default, when the -pt option is enabled, reference data are split in a number of non-overlapping subsets and each is processed by a separate thread against the whole set of input data.

Conversely, when this option is also enabled, it's the input data set (the sources) that gets split in non-overlapping subsets and each of these is in turn processed by a separate thread against the whole set of reference data.

Matching process configuration options

-mst

Minimum Score Threshold [ optional ]

This option sets the minimum overall score that an input data / reference data pair matching must have in order to appear in the output.

It requires a value in the range (0.0, 1.0] and - when not set - defaults to 0.5.

The overall score of an input data / reference data pair matching is the weighted score of all the configured (and triggered) matchlets applied to that same input data / reference data pair.

-mc

Maximum Candidates [ optional ]

Specifies the maximum number of matching candidates (reference data occurrences) that each input data can have in the matching result.

Generally speaking, depending on the minimum overall score threshold (see the -mst option), an input data might match with many a reference data with different overall scores: this option will restrict the number of identified matching candidates to be at most the specified value, retaining the matching candidates that produce the higher overall scores.

It can be set to a non negative integer value, whereas 0 has the special meaning of don't restrict the maximum number of matching candidates (all matching with a score higher than the minimum overall score threshold will be retained in the output).

When not set, defaults to 0 (unrestricted).

-hafm

Halt At First Matching

This option requires no value and - when set - will instruct the matching engine to halt an input data comparison process as soon as a valid matching (i.e. a matching with a score higher than or equal to the minimum overall score threshold - see the -mst option) is found.

When enabled, this options can speed up the matching process albeit at the cost of producing sub-optimal results.

Moreover, it will produce at most one matching candidate per each input data and thus can be enabled only when the -mc option is not set or set to a value of 1.

Matchlets configuration options

-law

Lexical Algorithms Weights [ optional ]

This option has an impact on the way in which scores are calculated by matchlets that work on string-like values (lexical matchlets). Each of these matchlets compare strings extracted from the input data with analogous strings extracted from the reference data (e.g. input vs. reference scientific names) and yields a score that depends on the results of this comparison.

A lexical matchlet's score is the weighted combination of different string-similarity measurements taken - with different algorithms - on the same pair of compared strings, namely:

  • the Levenshtein / edit similarity
  • the Soundex similarity
  • the Trigrams similarity

This option, set at matching process level, can instruct each lexical matchlet to return a weighted combination of these similarity measurements as the final matchlet's score.

It is specified as a colon-separated sequence of integer values in the range [0..100] with this meaning:

<Levenshtein similarity weight>:<Soundex similarity weight>:<Trigrams similarity weight>

Thus, a value of:

100:20:80

does actually mean that each lexical matchlet's score will be a composition of: 50% Levenshtein similarity score (that is 100 / ( 100 + 20 + 80), 10% Soundex similarity score (that is 20 / ( 100 + 20 + 80 )) and 40% Trigrams similarity score (that is 80 / ( 100 + 20 + 80 )).

Setting a specific lexical algorithm weight to zero means that the lexical matchlets score will not depend on that particular algorithm (e.g. -law 100:0:0 will disable Soundex and Trigrams similarity, while -law 0:100:100 will disable Levenshtein similarity and give Soundex and Trigrams similarity the same weight).

By default, the lexical algorithms weight are set to:

70:30:0

i.e. Levenshtein similarity will account for 70% of the lexical matchlets' score and Soundex similarity for the remaining 30%.

Scientific name matchlet configuration

-mSn

Enable Scientific Name Matchlet

Optional.

This option requires no value and - when set - enables the scientific name matchlet with default weight and threshold configurations if these are not explicitly set via the -mSnw and -mSnt options.

-mSnw

Scientific Name Matchlet Weight

Optional.

Specifies the scientific name matchlet weight as an integer value in the range (0 .. N].

It can be set only in combination with the -mSn option and defaults to 200 when not explicitly set.

-mSnt

Scientific Name Matchlet Minimum Score Threshold

Optional.

Specifies the scientific name matchlet minimum score threshold as value in the range [0.0 .. 1.0].

It can be set only in combination with the -mSn option and defaults to 0.5. when not explicitly set.

The matchlet minimum score threshold will have impact on the matchlet's specific score, setting it to zero when it is lower than the specified threshold.

Genus name matchlet configuration

-mgn

Enable Genus Name Matchlet

Optional.

This option requires no value and - when set - enables the genus name matchlet with default weight and threshold configurations if these are not explicitly set via the -mgnw and -mgnt options.

-mgnw

Genus Name Matchlet Weight

Optional.

Specifies the genus name matchlet weight as an integer value in the range (0 .. N].

It can be set only in combination with the -mgn option and defaults to 50 when not explicitly set.

-mgnt

Genus Name Matchlet Minimum Score Threshold

Optional.

Specifies the genus name matchlet minimum score threshold as value in the range [0.0 .. 1.0].

It can be set only in combination with the -mgn option and defaults to 0.7. when not explicitly set.

The matchlet minimum score threshold will have impact on the matchlet's specific score, setting it to zero when it is lower than the specified threshold.

Normalized (stemmed) genus name matchlet configuration

-mNgn

Enable Normalized Genus Name Matchlet

Optional.

This option requires no value and - when set - enables the normalized genus name matchlet with default weight and threshold configurations if these are not explicitly set via the -mNgnw and -mNgnt options.

-mNgnw

Normalized Genus Name Matchlet Weight

Optional.

Specifies the normalized genus name matchlet weight as an integer value in the range (0 .. N].

It can be set only in combination with the -mNgn option and defaults to 50 when not explicitly set.

-mNgnt

Normalized Genus Name Matchlet Minimum Score Threshold

Optional.

Specifies the normalized genus name matchlet minimum score threshold as value in the range [0.0 .. 1.0].

It can be set only in combination with the -mNgn option and defaults to 0.7. when not explicitly set.

The matchlet minimum score threshold will have impact on the matchlet's specific score, setting it to zero when it is lower than the specified threshold.

Species name matchlet configuration

-msn

Enable Species Name Matchlet

Optional.

This option requires no value and - when set - enables the species name matchlet with default weight and threshold configurations if these are not explicitly set via the -msnw and -msnt options.

-msnw

Species Name Matchlet Weight

Optional.

Specifies the species name matchlet weight as an integer value in the range (0 .. N].

It can be set only in combination with the -msn option and defaults to 50 when not explicitly set.

-msnt

Species Name Matchlet Minimum Score Threshold

Optional.

Specifies the species name matchlet minimum score threshold as value in the range [0.0 .. 1.0].

It can be set only in combination with the -msn option and defaults to 0.4. when not explicitly set.

The matchlet minimum score threshold will have impact on the matchlet's specific score, setting it to zero when it is lower than the specified threshold.

Normalized (stemmed) species name matchlet configuration

-mNsn

Enable Normalized Species Name Matchlet

Optional.

This option requires no value and - when set - enables the normalized species name matchlet with default weight and threshold configurations if these are not explicitly set via the -mNsnw and -mNsnt options.

-mNsnw

Normalized Species Name Matchlet Weight

Optional.

Specifies the normalized species name matchlet weight as an integer value in the range (0 .. N].

It can be set only in combination with the -mNsn option and defaults to 50 when not explicitly set.

-mNsnt

Normalized Species Name Matchlet Minimum Score Threshold

Optional.

Specifies the normalized species name matchlet minimum score threshold as value in the range [0.0 .. 1.0].

It can be set only in combination with the -mNsn option and defaults to 0.4. when not explicitly set.

The matchlet minimum score threshold will have impact on the matchlet's specific score, setting it to zero when it is lower than the specified threshold.

Author name name matchlet configuration

-man
-manw
-mant

Author year matchlet configuration

-may
-mayw
-mayt

FuzzyTaxamatch matchlet configuration

-mftm
-mftmw
-mftmt

Taxamatch matchlet configuration

-mtm
-mtmw

Output file command line options

-outFile

Output format command line options

-report

-xml

-xslTemplate

-xslTemplateFile

Usage examples

Appendix

Download

You can download the YASMEEN matching engine through one of this URLs: