code: def test_serialized(pipeline):
      """
      Brief test of the serialized format
  
      Checks that NER entities are correctly set.
      Also checks that constituency & sentiment are set on the sentences.
      """
      text = "John Bauer works at Stanford"
      doc = pipeline(text)
      assert len(doc.ents) == 2
      serialized = doc.to_serialized()
      doc2 = Document.from_serialized(serialized)
      assert len(doc2.sentences) == 1
      assert len(doc2.ents) == 2
      assert (
          doc.sentences[0].constituency
          == doc2.sentences[0].constituency
      )
      assert doc.sentences[0].sentiment == doc2.sentences[0].sentiment
  
file_path: stanza/stanza/tests/common/test_doc.py
imports: import pytest
  import stanza
  from stanza.tests import *
  from stanza.models.common.doc import Document, ID, TEXT, NER, CONSTITUENCY, SENTIMENT
label_desc: Use image node_id 11 for calling a global function with example usage: test_serialized(pipeline) without return types