alex.applications.PublicTransportInfoCS package¶
Subpackages¶
- alex.applications.PublicTransportInfoCS.data package
- Submodules
- alex.applications.PublicTransportInfoCS.data.add_cities_to_stops module
- alex.applications.PublicTransportInfoCS.data.autopath module
- alex.applications.PublicTransportInfoCS.data.convert_idos_stops module
- alex.applications.PublicTransportInfoCS.data.database module
- alex.applications.PublicTransportInfoCS.data.download_data module
- alex.applications.PublicTransportInfoCS.data.expand_stops module
- alex.applications.PublicTransportInfoCS.data.get_cities_location module
- alex.applications.PublicTransportInfoCS.data.ontology module
- Module contents
- alex.applications.PublicTransportInfoCS.hclg package
- alex.applications.PublicTransportInfoCS.slu package
- Subpackages
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier package
- Submodules
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier.autopath module
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier.download_models module
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier.test_bootstrap_trn module
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier.test_trn module
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier.train module
- Module contents
- alex.applications.PublicTransportInfoCS.slu.dainnclassifier package
- Submodules
- alex.applications.PublicTransportInfoCS.slu.dainnclassifier.autopath module
- alex.applications.PublicTransportInfoCS.slu.dainnclassifier.download_models module
- alex.applications.PublicTransportInfoCS.slu.dainnclassifier.test_bootstrap_trn module
- alex.applications.PublicTransportInfoCS.slu.dainnclassifier.test_trn module
- Module contents
- alex.applications.PublicTransportInfoCS.slu.dailogregclassifier package
- Submodules
- alex.applications.PublicTransportInfoCS.slu.add_to_bootstrap module
- alex.applications.PublicTransportInfoCS.slu.autopath module
- alex.applications.PublicTransportInfoCS.slu.consolidate_keyfiles module
- alex.applications.PublicTransportInfoCS.slu.gen_bootstrap module
- alex.applications.PublicTransportInfoCS.slu.gen_uniq module
- alex.applications.PublicTransportInfoCS.slu.prepare_data module
- alex.applications.PublicTransportInfoCS.slu.prepare_hdc_sem_from_trn module
- alex.applications.PublicTransportInfoCS.slu.test_bootstrap_hdc module
- alex.applications.PublicTransportInfoCS.slu.test_hdc module
- alex.applications.PublicTransportInfoCS.slu.test_hdc_utt_dict module
- Module contents
- Subpackages
Submodules¶
alex.applications.PublicTransportInfoCS.autopath module¶
self cloning, automatic path configuration
copy this into any subdirectory of pypy from which scripts need to be run, typically all of the test subdirs. The idea is that any such script simply issues
import autopath
and this will make sure that the parent directory containing “pypy” is in sys.path.
If you modify the master “autopath.py” version (in pypy/tool/autopath.py) you can directly run it which will copy itself on all autopath.py files it finds under the pypy root directory.
This module always provides these attributes:
pypydir pypy root directory path this_dir directory where this autopath.py resides
alex.applications.PublicTransportInfoCS.crws_enums module¶
Various enums, semi-automatically adapted from the CHAPS CRWS enum list written in C#.
Comments come originally from the CRWS description and are in Czech.
-
alex.applications.PublicTransportInfoCS.crws_enums.
BEDS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
CLIENTEXCEPTION_CODE
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
COMBFLAGS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
COOR
¶ alias of
Enum
-
class
alex.applications.PublicTransportInfoCS.crws_enums.
CRCONST
[source]¶ -
DELAY_CD
= 'CD:'¶
-
DELAY_INTERN
= 'X{0}_{1}:'¶
-
DELAY_INTERN_EXT
= 'Y{0}_{1}:'¶
-
DELAY_TELMAX1
= 'TELMAX1:'¶
-
DELAY_ZSR
= 'ZSR:'¶
-
EXCEPTIONEXCLUSION_CD
= 'CD:'¶
-
-
alex.applications.PublicTransportInfoCS.crws_enums.
DELTAMAX
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
DEP_TABLE
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
EXFUNCTIONRESULT
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
FCS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
LISTID
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
OBJECT_STATUS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
REG
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
REMMASK
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
ROUTE_FLAGS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
SEARCHMODE
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
ST
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
SVCSTATE
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TIMETABLE_FLAGS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TRCAT
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TRSUBCAT
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TTDETAILS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TTERR
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TTGP
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TTINFODETAILS
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
TTLANG
¶ alias of
Enum
-
alex.applications.PublicTransportInfoCS.crws_enums.
VF
¶ alias of
Enum
alex.applications.PublicTransportInfoCS.cs_morpho module¶
alex.applications.PublicTransportInfoCS.directions module¶
alex.applications.PublicTransportInfoCS.exceptions module¶
-
exception
alex.applications.PublicTransportInfoCS.exceptions.
PTICSHDCPolicyException
[source]¶ Bases:
alex.components.dm.exceptions.DialoguePolicyException
alex.applications.PublicTransportInfoCS.hdc_policy module¶
alex.applications.PublicTransportInfoCS.hdc_slu module¶
-
class
alex.applications.PublicTransportInfoCS.hdc_slu.
DAIBuilder
(utterance, abutterance_lenghts=None)[source]¶ Bases:
object
Builds DialogueActItems with proper alignment to corresponding utterance words. When words are successfully matched using DAIBuilder, their indices in the utterance are added to alignment set of the DAI as a side-effect.
-
build
(act_type=None, slot=None, value=None)[source]¶ Produce DialogueActItem based on arguments and alignment from this DAIBuilder state.
-
ending_phrases_in
(phrases)[source]¶ Returns True if the utterance ends with one of the phrases
Parameters: phrases – a list of phrases to search for Return type: bool
-
-
class
alex.applications.PublicTransportInfoCS.hdc_slu.
PTICSHDCSLU
(preprocessing, cfg)[source]¶ Bases:
alex.components.slu.base.SLUInterface
-
abstract_utterance
(utterance)[source]¶ Return a list of possible abstractions of the utterance.
Parameters: utterance – an Utterance instance Returns: a list of abstracted utterance, form, value, category label tuples
-
handle_false_abstractions
(abutterance)[source]¶ Revert false positive alarms of abstraction
Parameters: abutterance – the abstracted utterance Returns: the abstracted utterance without false positive abstractions
-
parse_1_best
(obs, verbose=False, *args, **kwargs)[source]¶ Parse an utterance into a dialogue act.
:rtype DialogueActConfusionNetwork
-
parse_ampm
(abutterance, cn)[source]¶ Detects the ampm in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_city
(abutterance, cn)[source]¶ Detects stops in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_date_rel
(abutterance, cn)[source]¶ Detects the relative date in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_meta
(utterance, abutt_lenghts, cn)[source]¶ Detects all dialogue acts which do not generalise its slot values using CLDB.
- NOTE: Use DAIBuilder (‘dai’ variable) to match words and build DialogueActItem,
- so that the DAI is aligned to corresponding words. If matched words are not supposed to be aligned, use PTICSHDCSLU matching method instead. Make sure to list negative conditions first, so the following positive conditions are not added to alignment, when they shouldn’t. E.g.: (not any_phrase_in(u, [‘dobrý den’, ‘dobrý večer’]) and dai.any_word_in(“dobrý”))
Parameters: - utterance – the input utterance
- cn – The output dialogue act item confusion network.
Returns: None
-
parse_non_speech_events
(utterance, cn)[source]¶ Processes non-speech events in the input utterance.
Parameters: - utterance – the input utterance
- cn – The output dialogue act item confusion network.
Returns: None
-
parse_number
(abutterance)[source]¶ Detect a number in the input abstract utterance
Number words that form time expression are collapsed into a single TIME category word. Recognized time expressions (where FRAC, HOUR and MIN stands for fraction, hour and minute numbers respectively):
- FRAC [na] HOUR
- FRAC hodin*
- HOUR a FRAC hodin*
- HOUR hodin* a MIN minut*
- HOUR hodin* MIN
- HOUR hodin*
- HOUR [0]MIN
- MIN minut*
Words of NUMBER category are assumed to be in format parsable to int or float
Parameters: abutterance (Utterance) – the input abstract utterance.
-
parse_stop
(abutterance, cn)[source]¶ Detects stops in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_task
(abutterance, cn)[source]¶ Detects the task in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_time
(abutterance, cn)[source]¶ Detects the time in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_train_name
(abutterance, cn)[source]¶ Detects the train name in the input abstract utterance.
Parameters: - abutterance –
- cn –
-
parse_vehicle
(abutterance, cn)[source]¶ Detects the vehicle (transport type) in the input abstract utterance.
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
-
parse_waypoint
(abutterance, cn, wp_id, wp_slot_suffix, phr_wp_types, phr_in=None)[source]¶ Detects stops or cities in the input abstract utterance (called through parse_city or parse_stop).
Parameters: - abutterance – the input abstract utterance.
- cn – The output dialogue act item confusion network.
- wp_id – waypoint slot category label (e.g. “STOP=”, “CITY=”)
- wp_slot_suffix – waypoint slot suffix (e.g. “stop”, “city”)
- phr_wp_types – set of phrases for each waypoint type
- phr_in – phrases for ‘in’ waypoint type
-
-
alex.applications.PublicTransportInfoCS.hdc_slu.
ending_phrases_in
(utterance, phrases)[source]¶ Returns True if the utterance ends with one of the phrases
Parameters: - utterance – The utterance to search in
- phrases – a list of phrases to search for
Return type: bool
-
alex.applications.PublicTransportInfoCS.hdc_slu.
first_phrase_span
(utterance, phrases)[source]¶ Returns the span (start, end+1) of the first phrase from the given list that is found in the utterance. Returns (-1, -1) if no phrase is found.
Parameters: - utterance – The utterance to search in
- phrases – a list of phrases to be tried (in the given order)
Return type: tuple
alex.applications.PublicTransportInfoCS.platform_info module¶
-
class
alex.applications.PublicTransportInfoCS.platform_info.
CRWSPlatformInfo
(crws_response, finder)[source]¶ Bases:
object
-
station_name_splitter
= <_sre.SRE_Pattern object>¶
-