def add_numeric_values_to_questions(interaction): """Adds numeric value spans to all questions.""" for question in interaction.questions: question.text = text_utils.normalize_for_match(question.original_text) question.annotations.CopyFrom( interaction_pb2.NumericValueSpans( spans=number_utils.parse_text(question.text)))
def _get_spans(text_proto): return list( text_format.Parse(text_proto, interaction_pb2.NumericValueSpans()).spans)