docstr: Generate semantic array from text.
  
  Args:
      text: text to be turned into audio
      history_prompt: history choice for audio cloning
      temp: generation temperature (1.0 more diverse, 0.0 more conservative)
  
  Returns:
      numpy semantic array to be fed into `semantic_to_waveform`
docstr_tok: ["Generate","semantic","array","from","text",".","Args",":","text",":","text","to","be","turned","into","audio","history_prompt",":","history","choice","for","audio","cloning","temp",":","generation","temperature","(","1.0","more","diverse",",","0.0","more","conservative",")","Returns",":","numpy","semantic","array","to","be","fed","into","`","semantic_to_waveform","`"]
code: def text_to_semantic(
      self,
      text: str,
      history_prompt: Optional[str] = None,
      temp: float = 0.7,
      base=None,
      allow_early_stop=True,
      **kwargs,
  ):
      """Generate semantic array from text.
  
      Args:
          text: text to be turned into audio
          history_prompt: history choice for audio cloning
          temp: generation temperature (1.0 more diverse, 0.0 more conservative)
  
      Returns:
          numpy semantic array to be fed into `semantic_to_waveform`
      """
      x_semantic = generate_text_semantic(
          text,
          self,
          history_prompt=history_prompt,
          temp=temp,
          base=base,
          allow_early_stop=allow_early_stop,
          **kwargs,
      )
      return x_semantic
  
imports: import os
  from dataclasses import dataclass
  from typing import Optional
  import numpy
  from coqpit import Coqpit
  from encodec import EncodecModel
  from transformers import BertTokenizer
  from TTS.tts.layers.bark.inference_funcs import codec_decode, generate_coarse, generate_fine, generate_text_semantic, generate_voice, load_voice
  from TTS.tts.layers.bark.load_model import load_model
  from TTS.tts.layers.bark.model import GPT
  from TTS.tts.layers.bark.model_fine import FineGPT
  from TTS.tts.models.base_tts import BaseTTS
label_desc: Use image node_id 5 for calling the Bark obj's underlying member method code with example usage: obj.text_to_semantic(text, history_prompt, temp, base, allow_early_stop) and returns: x_semantic