add raw math terms
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -86,7 +86,8 @@ class Utterance:
|
|
86 |
'aggregateUnitMeasure': self.aggregate_unit_measure,
|
87 |
'wordCount': self.word_count,
|
88 |
'numMathTerms': self.num_math_terms,
|
89 |
-
'mathTerms': self.math_terms
|
|
|
90 |
}
|
91 |
|
92 |
def __repr__(self):
|
@@ -406,10 +407,9 @@ def run_math_density(transcript):
|
|
406 |
# Update matched positions
|
407 |
matched_positions.update((match.start(), match.end()) for match in matches)
|
408 |
num_matches += len(matches)
|
409 |
-
print("match list: ", match_list)
|
410 |
-
print("matched positions: ", matched_positions)
|
411 |
utt.num_math_terms = num_matches
|
412 |
utt.math_terms = match_list
|
|
|
413 |
teacher_dict_list = []
|
414 |
student_dict_list = []
|
415 |
dict_list = []
|
|
|
86 |
'aggregateUnitMeasure': self.aggregate_unit_measure,
|
87 |
'wordCount': self.word_count,
|
88 |
'numMathTerms': self.num_math_terms,
|
89 |
+
'mathTerms': self.math_terms,
|
90 |
+
'mathTermsRaw': self.math_term_raw
|
91 |
}
|
92 |
|
93 |
def __repr__(self):
|
|
|
407 |
# Update matched positions
|
408 |
matched_positions.update((match.start(), match.end()) for match in matches)
|
409 |
num_matches += len(matches)
|
|
|
|
|
410 |
utt.num_math_terms = num_matches
|
411 |
utt.math_terms = match_list
|
412 |
+
utt.math_terms_raw = [text[start:end] for start, end in matched_positions]
|
413 |
teacher_dict_list = []
|
414 |
student_dict_list = []
|
415 |
dict_list = []
|