code: def fill_vocab(vocab, dataset):
      entity_num = 0
      for instance in dataset:
          for entity in instance["ner"]:
              vocab.add_label(entity["type"])
          entity_num += len(instance["ner"])
      return entity_num
  
imports: import json
  import torch
  from torch.utils.data import Dataset
  from torch.nn.utils.rnn import pad_sequence
  import numpy
  import prettytable
  from tqdm import tqdm
  from transformers import AutoTokenizer
  import os
  from deepke.name_entity_re.standard.tools import *
  import requests
  from typing import List
  from .utils import convert_index_to_text
label_desc: Use image node_id 3 for calling a global function with example usage: fill_vocab(vocab, dataset) and returns: entity_num