code: def index_fields(self, vocab: Vocabulary) -> None:
          
          if not self.indexed:
              self.indexed = True
              for field in self.fields.values():
                  field.index(vocab)
docs: Indexes all fields in this ``Instance`` using the provided ``Vocabulary``.
          This `mutates` the current object, it does not return a new ``Instance``.
          A ``DataIterator`` will call this on each pass through a dataset; we use the ``indexed``
          flag to make sure that indexing only happens once.
  
          This means that if for some reason you modify your vocabulary after you've
          indexed your instances, you might get unexpected behavior.