Elementary Dependency Matching

This module provides the implementation of Elementary Dependency Matching used by the edm subcommand, which is the recommended interface (see the Elementary Dependency Matching guide for more information). Only the compute() function is made available at this time.

delphin.edm.compute(golds, tests, name_weight=1.0, argument_weight=1.0, property_weight=1.0, constant_weight=1.0, top_weight=1.0, ignore_missing_gold=False, ignore_missing_test=False)[source]

Compute the precision, recall, and f-score for all pairs.

The golds and tests arguments are iterables of PyDelphin dependency representations, such as EDS or DMRS. The precision and recall are computed as follows:

  • Precision = matching_triples / test_triples

  • Recall = matching_triples / gold_triples

  • F-score = 2 * (Precision * Recall) / (Precision + Recall)

  • golds – gold semantic representations

  • tests – test semantic representations

  • name_weight – weight applied to the name score

  • argument_weight – weight applied to the argument score

  • property_weight – weight applied to the property score

  • constant_weight – weight applied to the constant score

  • top_weight – weight applied to the top score

  • ignore_missing_gold – if True, don’t count missing gold items as mismatches

  • ignore_missing_test – if True, don’t count missing test items as mismatches


A tuple of (precision, recall, f-score)