code: def add_entity(dict_dir):
      """
      把实体字典加载到jieba里，
      实体作为分词后的词，
      实体标记作为词性
      """
  
      dics = csv.reader(
          open(
              os.path.join(os.getcwd(), dict_dir), "r", encoding="utf8"
          )
      )
  
      for row in dics:
          if len(row) == 2:
              jieba.add_word(row[0].strip(), tag=row[1].strip())
  
              """ 保证由多个词组成的实体词，不被切分开 """
              jieba.suggest_freq(row[0].strip())
  
file_path: DeepKE/example/ner/prepare-data/prepare_weaksupervised_data.py
imports: import os
  import random
  import jieba.posseg
  import jieba
  import csv
  import argparse
label_desc: Use image node_id 1 for calling a global function with example usage: add_entity(dict_dir) without return types