code: def test_partial_annotation(en_tokenizer):
      pred_doc = en_tokenizer("a b c d e")
      pred_doc[0].tag_ = "A"
      pred_doc[0].pos_ = "X"
      pred_doc[0].set_morph("Feat=Val")
      pred_doc[0].dep_ = "dep"
  
      # unannotated reference
      ref_doc = en_tokenizer("a b c d e")
      ref_doc.has_unknown_spaces = True
      example = Example(pred_doc, ref_doc)
      scorer = Scorer()
      scores = scorer.score([example])
      for key in scores:
          # cats doesn't have an unset state
          if key.startswith("cats"):
              continue
          assert scores[key] is None
  
      # partially annotated reference, not overlapping with predicted annotation
      ref_doc = en_tokenizer("a b c d e")
      ref_doc.has_unknown_spaces = True
      ref_doc[1].tag_ = "A"
      ref_doc[1].pos_ = "X"
      ref_doc[1].set_morph("Feat=Val")
      ref_doc[1].dep_ = "dep"
      example = Example(pred_doc, ref_doc)
      scorer = Scorer()
      scores = scorer.score([example])
      assert scores["token_acc"] is None
      assert scores["tag_acc"] == 0.0
      assert scores["pos_acc"] == 0.0
      assert scores["morph_acc"] == 0.0
      assert scores["dep_uas"] == 1.0
      assert scores["dep_las"] == 0.0
      assert scores["sents_f"] is None
  
      # partially annotated reference, overlapping with predicted annotation
      ref_doc = en_tokenizer("a b c d e")
      ref_doc.has_unknown_spaces = True
      ref_doc[0].tag_ = "A"
      ref_doc[0].pos_ = "X"
      ref_doc[1].set_morph("Feat=Val")
      ref_doc[1].dep_ = "dep"
      example = Example(pred_doc, ref_doc)
      scorer = Scorer()
      scores = scorer.score([example])
      assert scores["token_acc"] is None
      assert scores["tag_acc"] == 1.0
      assert scores["pos_acc"] == 1.0
      assert scores["morph_acc"] == 0.0
      assert scores["dep_uas"] == 1.0
      assert scores["dep_las"] == 0.0
      assert scores["sents_f"] is None
  
file_path: spacy/spacy/tests/test_scorer.py
imports: import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal
  from pytest import approx
  from spacy.lang.en import English
  from spacy.scorer import PRFScore, ROCAUCScore, Scorer, _roc_auc_score, _roc_curve
  from spacy.tokens import Doc, Span
  from spacy.training import Example
  from spacy.training.iob_utils import offsets_to_biluo_tags
label_desc: Use image node_id 8 for calling a global function with example usage: test_partial_annotation(en_tokenizer) without return types