Skip to content

Commit 64630ce

Browse files
committed
test: test filter_expr in dependency parsing evaluation
1 parent 3237ec7 commit 64630ce

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

edsnlp/metrics/dep_parsing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def dependency_parsing_metric(
1717
The examples to score, either a tuple of (golds, preds) or a list of
1818
spacy.training.Example objects
1919
filter_expr : Optional[str]
20-
The filter expression to use to filter the documents
20+
The filter expression to use to filter the documents. The expression
21+
should be a valid Python test and uses the variable `doc` to refer to
22+
the reference (gold) document.
2123
2224
Returns
2325
-------

tests/training/dep_parser_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ scorer:
2323
speed: false
2424
dep:
2525
'@metrics': "eds.dep_parsing"
26+
filter_expr: "doc.text != ''"
2627

2728
# 🎛️ OPTIMIZER
2829
optimizer:

0 commit comments

Comments
 (0)