@@ -190,7 +190,7 @@ def _get_reason_not_deid(cls, cat: CAT) -> str:
190190 return ""
191191
192192
193- def match_rules (rules : List [Tuple [str , str ]], texts : List [str ], cat : CAT ):
193+ def match_rules (rules : List [Tuple [str , str ]], texts : List [str ], cat : CAT ) -> List [ List [ Dict ]] :
194194 """Match a set of rules - pat / cui combos as post processing labels.
195195
196196 Uses a cat DeID model for pretty name mapping.
@@ -210,6 +210,9 @@ def match_rules(rules: List[Tuple[str, str]], texts: List[str], cat: CAT):
210210 'My phone number is 1234567890',
211211 ]
212212 >>> matches = match_rules(rules, texts, cat)
213+
214+ Returns:
215+ List[List[Dict]]: List of lists of predictions from `match_rules`
213216 """
214217 # Iterate through each text and pattern combination
215218 rule_matches_per_text = []
@@ -235,7 +238,7 @@ def match_rules(rules: List[Tuple[str, str]], texts: List[str], cat: CAT):
235238
236239def merge_preds (model_preds_by_text : List [List [Dict ]],
237240 rule_matches_per_text : List [List [Dict ]],
238- accept_preds : bool = True ):
241+ accept_preds : bool = True ) -> List [ List [ Dict ]] :
239242 """Merge predictions from rule based and deID model predictions.
240243
241244 Args:
@@ -267,6 +270,9 @@ def merge_preds(model_preds_by_text: List[List[Dict]],
267270 ]
268271 ]
269272 >>> merged_preds = merge_preds(model_preds_by_text, rule_matches_by_text)
273+
274+ Returns:
275+ List[List[Dict]]: List of lists of predictions from `merge_preds`
270276 """
271277 all_preds = []
272278 if accept_preds :
0 commit comments