alex.components.hub package

Submodules

alex.components.hub.ahub module

alex.components.hub.aio module

alex.components.hub.asr module

class alex.components.hub.asr.ASR(cfg, commands, audio_in, asr_hypotheses_out, close_event)[source]

Bases: multiprocessing.process.Process

ASR recognizes input audio and returns an N-best list hypothesis or a confusion network.

Recognition starts with the “speech_start()” command in the input audio stream and ends with the “speech_end()” command.

When the “speech_end()” command is received, the component asks responsible ASR module to return hypotheses and sends them to the output.

This component is a wrapper around multiple recognition engines which handles inter-process communication.

Attributes:
asr – the ASR object itself
process_pending_commands()[source]

Process all pending commands.

Available commands:

stop() - stop processing and exit the process flush() - flush input buffers.

Now it only flushes the input connection.

Returns True iff the process should terminate.

read_audio_write_asr_hypotheses()[source]
recv_input_locally()[source]

Copy all input from input connections into local queue objects.

This will prevent blocking the senders.

run()[source]

alex.components.hub.calldb module

class alex.components.hub.calldb.CallDB(cfg, file_name, period=86400)[source]

Bases: object

Implements logging of all interesting call stats. It can be used for customization of the SDS, e.g. for novice or expert users.

close_database(db)[source]
get_uri_stats(remote_uri)[source]
log()[source]
log_uri(remote_uri)[source]
open_database()[source]
read_database()[source]
release_database()[source]
track_confirmed_call(remote_uri)[source]
track_disconnected_call(remote_uri)[source]

alex.components.hub.dm module

class alex.components.hub.dm.DM(cfg, commands, slu_hypotheses_in, dialogue_act_out, close_event)[source]

Bases: multiprocessing.process.Process

DM accepts N-best list hypothesis or a confusion network generated by an SLU component. The result of this component is an output dialogue act.

When the component receives an SLU hypothesis then it immediately responds with an dialogue act.

This component is a wrapper around multiple dialogue managers which handles multiprocessing communication.

epilogue()[source]

Gives the user last information before hanging up.

:return the name of the activity or None

epilogue_final_apology()[source]
epilogue_final_code()[source]
epilogue_final_question()[source]
process_pending_commands()[source]

Process all pending commands.

Available commands:

stop() - stop processing and exit the process flush() - flush input buffers.

Now it only flushes the input connection.

Return True if the process should terminate.

read_slu_hypotheses_write_dialogue_act()[source]
run()[source]
test_code_server_connection()[source]

this opens a test connection to our code server, content of the response is not important if our server is down this call will fail and the vm will crash. this is more sensible to CF people, otherwise CF contributor would do the job without getting paid.

alex.components.hub.exceptions module

exception alex.components.hub.exceptions.VoipIOException[source]

Bases: alex.AlexException

alex.components.hub.hub module

class alex.components.hub.hub.Hub(cfg)[source]

Bases: object

Common functionality for the hubs.

hub_type = 'Hub'
init_readline()[source]

Initialize the readline functionality to enable console history.

write_readline()[source]

alex.components.hub.messages module

class alex.components.hub.messages.ASRHyp(hyp, source=None, target=None, fname=None)[source]

Bases: alex.components.hub.messages.Message

class alex.components.hub.messages.Command(command, source=None, target=None)[source]

Bases: alex.components.hub.messages.Message

class alex.components.hub.messages.DMDA(da, source=None, target=None)[source]

Bases: alex.components.hub.messages.Message

class alex.components.hub.messages.Frame(payload, source=None, target=None)[source]

Bases: alex.components.hub.messages.Message

class alex.components.hub.messages.Message(source, target)[source]

Bases: alex.utils.mproc.InstanceID

Abstract class which implements basic functionality for messages passed between components in the alex.

get_time_str()[source]

Return current time in dashed ISO-like format.

class alex.components.hub.messages.SLUHyp(hyp, asr_hyp=None, source=None, target=None)[source]

Bases: alex.components.hub.messages.Message

class alex.components.hub.messages.TTSText(text, source=None, target=None)[source]

Bases: alex.components.hub.messages.Message

alex.components.hub.nlg module

class alex.components.hub.nlg.NLG(cfg, commands, dialogue_act_in, text_out, close_event)[source]

Bases: multiprocessing.process.Process

The NLG component receives a dialogue act generated by the dialogue manager and then it converts the act into the text.

This component is a wrapper around multiple NLG components which handles multiprocessing communication.

process_da(da)[source]
process_pending_commands()[source]

Process all pending commands.

Available commands:

stop() - stop processing and exit the process flush() - flush input buffers.

Now it only flushes the input connection.

Return True if the process should terminate.

read_dialogue_act_write_text()[source]
run()[source]

alex.components.hub.slu module

class alex.components.hub.slu.SLU(cfg, commands, asr_hypotheses_in, slu_hypotheses_out, close_event)[source]

Bases: multiprocessing.process.Process

The SLU component receives ASR hypotheses and converts them into hypotheses about the meaning of the input in the form of dialogue acts.

This component is a wrapper around multiple SLU components which handles inter-process communication.

process_pending_commands()[source]

Process all pending commands.

Available commands:

stop() - stop processing and exit the process flush() - flush input buffers.

Now it only flushes the input connection.

Return True if the process should terminate.

read_asr_hypotheses_write_slu_hypotheses()[source]
run()[source]

alex.components.hub.tts module

alex.components.hub.vad module

alex.components.hub.vio module

alex.components.hub.webio module

Module contents