class_docstr: A ready-to-use class for utterance-level classification (e.g, speaker-id,
  language-id, emotion recognition, keyword spotting, etc).
  
  The class assumes that an encoder called "embedding_model" and a model
  called "classifier" are defined in the yaml file. If you want to
  convert the predicted index into a corresponding text label, please
  provide the path of the label_encoder in a variable called 'lab_encoder_file'
  within the yaml.
  
  The class can be used either to run only the encoder (encode_batch()) to
  extract embeddings or to run a classification step (classify_batch()).
  ```
  
  Example
  -------
  >>> import torchaudio
  >>> from speechbrain.inference.classifiers import EncoderClassifier
  >>> # Model is downloaded from the speechbrain HuggingFace repo
  >>> tmpdir = getfixture("tmpdir")
  >>> classifier = EncoderClassifier.from_hparams(
  ...     source="speechbrain/spkrec-ecapa-voxceleb",
  ...     savedir=tmpdir,
  ... )
  >>> classifier.hparams.label_encoder.ignore_len()
  
  >>> # Compute embeddings
  >>> signal, fs = torchaudio.load("tests/samples/single-mic/example1.wav")
  >>> embeddings = classifier.encode_batch(signal)
  
  >>> # Classification
  >>> prediction = classifier.classify_batch(signal)
class_docstr_tok: ["A","ready-to-use","class","for","utterance-level","classification","(","e.g",",","speaker-id",",","language-id",",","emotion","recognition",",","keyword","spotting",",","etc",")",".","The","class","assumes","that","an","encoder","called","``","embedding_model","''","and","a","model","called","``","classifier","''","are","defined","in","the","yaml","file",".","If","you","want","to","convert","the","predicted","index","into","a","corresponding","text","label",",","please","provide","the","path","of","the","label_encoder","in","a","variable","called","'lab_encoder_file'","within","the","yaml",".","The","class","can","be","used","either","to","run","only","the","encoder","(","encode_batch","(",")",")","to","extract","embeddings","or","to","run","a","classification","step","(","classify_batch","(",")",")",".","``","`","Example","--","--","--","-",">",">",">","import","torchaudio",">",">",">","from","speechbrain.inference.classifiers","import","EncoderClassifier",">",">",">","#","Model","is","downloaded","from","the","speechbrain","HuggingFace","repo",">",">",">","tmpdir","=","getfixture","(","``","tmpdir","''",")",">",">",">","classifier","=","EncoderClassifier.from_hparams","(","...","source=","''","speechbrain\/spkrec-ecapa-voxceleb","''",",","...","savedir=tmpdir",",","...",")",">",">",">","classifier.hparams.label_encoder.ignore_len","(",")",">",">",">","#","Compute","embeddings",">",">",">","signal",",","fs","=","torchaudio.load","(","``","tests\/samples\/single-mic\/example1.wav","''",")",">",">",">","embeddings","=","classifier.encode_batch","(","signal",")",">",">",">","#","Classification",">",">",">","prediction","=","classifier.classify_batch","(","signal",")"]
docstr: Classifies the given audiofile into the given set of labels.
  
  Arguments
  ---------
  path : str
      Path to audio file to classify.
  
  Returns
  -------
  out_prob
      The log posterior probabilities of each class ([batch, N_class])
  score:
      It is the value of the log-posterior for the best class ([batch,])
  index
      The indexes of the best class ([batch,])
  text_lab:
      List with the text labels corresponding to the indexes.
      (label encoder should be provided).
docstr_tok: ["Classifies","the","given","audiofile","into","the","given","set","of","labels",".","Arguments","--","--","--","--","-","path",":","str","Path","to","audio","file","to","classify",".","Returns","--","--","--","-","out_prob","The","log","posterior","probabilities","of","each","class","(","[","batch",",","N_class","]",")","score",":","It","is","the","value","of","the","log-posterior","for","the","best","class","(","[","batch",",","]",")","index","The","indexes","of","the","best","class","(","[","batch",",","]",")","text_lab",":","List","with","the","text","labels","corresponding","to","the","indexes",".","(","label","encoder","should","be","provided",")","."]
code: def classify_file(self, path, **kwargs):
      """Classifies the given audiofile into the given set of labels.
  
      Arguments
      ---------
      path : str
          Path to audio file to classify.
  
      Returns
      -------
      out_prob
          The log posterior probabilities of each class ([batch, N_class])
      score:
          It is the value of the log-posterior for the best class ([batch,])
      index
          The indexes of the best class ([batch,])
      text_lab:
          List with the text labels corresponding to the indexes.
          (label encoder should be provided).
      """
      waveform = self.load_audio(path, **kwargs)
      # Fake a batch:
      batch = waveform.unsqueeze(0)
      rel_length = torch.tensor([1.0])
      emb = self.encode_batch(batch, rel_length)
      out_prob = self.mods.classifier(emb).squeeze(1)
      score, index = torch.max(out_prob, dim=-1)
      text_lab = self.hparams.label_encoder.decode_torch(index)
      return out_prob, score, index, text_lab
  
file_path: speechbrain/speechbrain/inference/classifiers.py
imports: import torch
  import torchaudio
  import speechbrain
  from speechbrain.utils.fetching import fetch
  from speechbrain.utils.data_utils import split_path
  from speechbrain.inference.interfaces import Pretrained
label_desc: Use image node_id 4 for calling the EncoderClassifier obj's underlying member method code with example usage: obj.classify_file(path) and returns: out_prob,  score,  index,  text_lab