-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
The XML parsing logic for labeled data currently produces empty values for any XML comment elements in the input. XML comments are handy for organizing labeled examples into different use cases within a single file. The same code also would produce empty elements if there were training examples with no tagged elements (for whatever reason).
These empty items cause the program to crash with an unhandled exception when the training process starts to iterate over the training examples specifically at 'training.trainModel' at line 22.
This could be resolved by simply ignoring comments and/or elements with no children in 'data_format_utils._strip_formatting' or 'data_format_utils.iter'. The code to skip these elements could look like:
for sequence_xml in self.xml:
# Skip comments
if isinstance(sequence_xml, etree._Comment):
continue
# Skip empty sequences
if len(sequence_xml) == 0:
continue
Metadata
Metadata
Assignees
Labels
No labels