Skip to content

Commit

Permalink
Tokenizer fix (#234)
Browse files Browse the repository at this point in the history
Co-authored-by: Arkadiusz Kwasigroch <arkadiusz.kwasigroch@hpi.de>
  • Loading branch information
akwasigroch and Arkadiusz Kwasigroch authored Feb 21, 2025
1 parent 985b9b3 commit a956059
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/femr/models/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ def convert_statistics_to_msgpack(
if start_val == end_val:
continue

entry = {
"type": "numeric",
"code_string": code,
"val_start": start_val,
"val_end": end_val,
"weight": weight * math.log(weight) + (1 - weight) * math.log(1 - weight),
}
vocab.append(entry)
entry = {
"type": "numeric",
"code_string": code,
"val_start": start_val,
"val_end": end_val,
"weight": weight * math.log(weight) + (1 - weight) * math.log(1 - weight),
}
vocab.append(entry)
else:
assert ontology
for code, weight in statistics["code_counts"].items():
Expand Down

0 comments on commit a956059

Please sign in to comment.