code: def preprocess_word_level_input(self, inp):
      # Pypinyin can't solve polyphonic words
      text_raw = (
          inp["text"]
          .replace("最长", "最常")
          .replace("长睫毛", "常睫毛")
          .replace("那么长", "那么常")
          .replace("多长", "多常")
          .replace("很长", "很常")
      )  # We hope someone could provide a better g2p module for us by opening pull requests.
  
      # lyric
      pinyins = lazy_pinyin(text_raw, strict=False)
      ph_per_word_lst = [
          self.pinyin2phs[pinyin.strip()]
          for pinyin in pinyins
          if pinyin.strip() in self.pinyin2phs
      ]
  
      # Note
      note_per_word_lst = [
          x.strip() for x in inp["notes"].split("|") if x.strip() != ""
      ]
      mididur_per_word_lst = [
          x.strip()
          for x in inp["notes_duration"].split("|")
          if x.strip() != ""
      ]
  
      if (
          len(note_per_word_lst)
          == len(ph_per_word_lst)
          == len(mididur_per_word_lst)
      ):
          print("Pass word-notes check.")
      else:
          print(
              "The number of words does't match the number of notes' windows. ",
              "You should split the note(s) for each word by | mark.",
          )
          print(
              ph_per_word_lst, note_per_word_lst, mididur_per_word_lst
          )
          print(
              len(ph_per_word_lst),
              len(note_per_word_lst),
              len(mididur_per_word_lst),
          )
          return None
  
      note_lst = []
      ph_lst = []
      midi_dur_lst = []
      is_slur = []
      for idx, ph_per_word in enumerate(ph_per_word_lst):
          # for phs in one word:
          # single ph like ['ai']  or multiple phs like ['n', 'i']
          ph_in_this_word = ph_per_word.split()
  
          # for notes in one word:
          # single note like ['D4'] or multiple notes like ['D4', 'E4'] which means a 'slur' here.
          note_in_this_word = note_per_word_lst[idx].split()
          midi_dur_in_this_word = mididur_per_word_lst[idx].split()
          # process for the model input
          # Step 1.
          #  Deal with note of 'not slur' case or the first note of 'slur' case
          #  j        ie
          #  F#4/Gb4  F#4/Gb4
          #  0        0
          for ph in ph_in_this_word:
              ph_lst.append(ph)
              note_lst.append(note_in_this_word[0])
              midi_dur_lst.append(midi_dur_in_this_word[0])
              is_slur.append(0)
          # step 2.
          #  Deal with the 2nd, 3rd... notes of 'slur' case
          #  j        ie         ie
          #  F#4/Gb4  F#4/Gb4    C#4/Db4
          #  0        0          1
          # is_slur = True, we should repeat the YUNMU to match the 2nd, 3rd... notes.
          if len(note_in_this_word) > 1:
              for idx in range(1, len(note_in_this_word)):
                  ph_lst.append(ph_in_this_word[-1])
                  note_lst.append(note_in_this_word[idx])
                  midi_dur_lst.append(midi_dur_in_this_word[idx])
                  is_slur.append(1)
      ph_seq = " ".join(ph_lst)
  
      if len(ph_lst) == len(note_lst) == len(midi_dur_lst):
          print(len(ph_lst), len(note_lst), len(midi_dur_lst))
          print("Pass word-notes check.")
      else:
          print(
              "The number of words does't match the number of notes' windows. ",
              "You should split the note(s) for each word by | mark.",
          )
          return None
      return ph_seq, note_lst, midi_dur_lst, is_slur
  
imports: import os
  from collections import deque
  import librosa
  import numpy
  import onnxruntime
  from pypinyin import lazy_pinyin
  from tqdm import tqdm
  from .inference.svs.opencpop.map import cpop_pinyin2ph_func
  from .utils.hparams import hparams
  from .utils.text_encoder import TokenTextEncoder
label_desc: Use image node_id 7 for calling the Infer obj's underlying member method code with example usage: obj.preprocess_word_level_input(inp) and returns: ph_seq,  note_lst,  midi_dur_lst,  is_slur, None, None