{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/accurate-and-well-calibrated-icd-code","title":"Accurate and Well-Calibrated ICD Code Assignment Through Attention Over Diverse Label Embeddings","arxiv_id":"2402.03172","date":"2024-02-05","proceeding":null,"authors":["Gonçalo Gomes","Isabel Coutinho","Bruno Martins"],"abstract":"Although the International Classification of Diseases (ICD) has been adopted worldwide, manually assigning ICD codes to clinical text is time-consuming, error-prone, and expensive, motivating the development of automated approaches. This paper describes a novel approach for automated ICD coding, combining several ideas from previous related work. We specifically employ a strong Transformer-based model as a text encoder and, to handle lengthy clinical narratives, we explored either (a) adapting the base encoder model into a Longformer, or (b) dividing the text into chunks and processing each chunk independently. The representations produced by the encoder are combined with a label embedding mechanism that explores diverse ICD code synonyms. Experiments with different splits of the MIMIC-III dataset show that the proposed approach outperforms the current state-of-the-art models in ICD coding, with the label embeddings significantly contributing to the good performance. Our approach also leads to properly calibrated classification results, which can effectively inform downstream tasks such as quantification.","url_abs":"https://arxiv.org/abs/2402.03172v1","url_pdf":"https://arxiv.org/pdf/2402.03172v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"accurate-and-well-calibrated-icd-code","repo_url":"https://github.com/gecgomes/icd_coding_msam","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"adamw","method_name":"AdamW"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"base","method_name":"BASE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"longformer","method_name":"Longformer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.03172","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.03172"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gecgomes/icd_coding_msam","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7},"by_repo_kind":{"official":{"samples":7,"ran":7,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"f1f98245b321a6a1","entry":"calculate_total_score","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/helper_funcs.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/helper_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f1f98245b321a6a1"}},{"code_sha256_prefix":"5194faebf573a9a9","entry":"create_instances_dict","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/helper_funcs.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/helper_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5194faebf573a9a9"}},{"code_sha256_prefix":"a8b2ef209164ac11","entry":"create_labels_dict","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/helper_funcs.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/helper_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a8b2ef209164ac11"}},{"code_sha256_prefix":"8e06017f02a98e0f","entry":"get_mimiciii_notes","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/utils_edin.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/utils_edin.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8e06017f02a98e0f"}},{"code_sha256_prefix":"6bfb3a3a58728e8f","entry":"iterative_stratification","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/stratify.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/stratify.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6bfb3a3a58728e8f"}},{"code_sha256_prefix":"3ed9f9a840e4cabb","entry":"make_version_dir","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/utils_edin.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/utils_edin.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3ed9f9a840e4cabb"}},{"code_sha256_prefix":"70834a46f93a4007","entry":"unique","repo":"gecgomes/icd_coding_msam","repo_kind":"official","path":"MIMIC-III-Preprocess/Helpers/utils_edin.py","file_url":"https://github.com/gecgomes/icd_coding_msam/blob/HEAD/MIMIC-III-Preprocess/Helpers/utils_edin.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70834a46f93a4007"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}