def request_endpoint(audio, speech_config, output_directory, lexical):
    'Request the speech service endpoint\n    Args:\n        audio: Input data frame\n        speech_config: Choice between scoring and \n        output_folder: LUIS app ID\n        case: LUIS subscription key\n        lexical: Minimum confidence score for LUIS result, between 0.00 and 1.00\n    Returns:\n        df: Scoring data frame with predicted intents and scores\n    Raises:\n        ConnectionError: If file is not found\n    '
    audio_config = speechsdk.audio.AudioConfig(filename=audio)
    speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
    result = speech_recognizer.recognize_once()
    filename = audio[(audio.rindex('\\') + 1):]
    text = process_recognition(result, filename, output_directory, lexical)
    return (text, filename)
Request the speech service endpoint
Args:
    audio: Input data frame
    speech_config: Choice between scoring and 
    output_folder: LUIS app ID
    case: LUIS subscription key
    lexical: Minimum confidence score for LUIS result, between 0.00 and 1.00
Returns:
    df: Scoring data frame with predicted intents and scores
Raises:
    ConnectionError: If file is not found
def request_endpoint(audio, speech_config, output_directory, lexical):
    'Request the speech service endpoint\n    Args:\n        audio: Input data frame\n        speech_config: Choice between scoring and \n        output_folder: LUIS app ID\n        case: LUIS subscription key\n        lexical: Minimum confidence score for LUIS result, between 0.00 and 1.00\n    Returns:\n        df: Scoring data frame with predicted intents and scores\n    Raises:\n        ConnectionError: If file is not found\n    '
    audio_config = speechsdk.audio.AudioConfig(filename=audio)
    speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
    result = speech_recognizer.recognize_once()
    filename = audio[(audio.rindex('\\') + 1):]
    text = process_recognition(result, filename, output_directory, lexical)
    return (text, filename)