CommencerCommencer gratuitement

Transcribing phone call excerpts

In this exercise, we'll transcribe the audio files we converted to .wav format to text using transcribe_audio().

Since there's lots of them and there could be more, we'll build a function create_test_list() which takes a list of filenames of audio files as input and goes through each file transcribing the text.

create_test_list() uses our transcribe_audio() function we created earlier and returns a list of strings containing the transcribed text from each audio file.

pre_purchase_wav_files and post_purchase_wav_files are lists of audio snippet filenames.

Cet exercice fait partie du cours

Spoken Language Processing in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

def create_text_list(folder):
  # Create empty list
  text_list = []
  
  # Go through each file
  for file in folder:
    # Make sure the file is .wav
    if file.endswith(".wav"):
      print(f"Transcribing file: {file}...")
      
      # Transcribe audio and append text to list
      text_list.append(____(file))   
  return ____

create_text_list(folder)
Modifier et exécuter le code