{"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/generating-medical-instructions-with","title":"Generating Medical Prescriptions with Conditional Transformer","arxiv_id":"2310.19727","date":"2023-10-30","proceeding":null,"authors":["Samuel Belkadi","Nicolo Micheletti","Lifeng Han","Warren Del-Pinto","Goran Nenadic"],"abstract":"Access to real-world medication prescriptions is essential for medical research and healthcare quality improvement. However, access to real medication prescriptions is often limited due to the sensitive nature of the information expressed. Additionally, manually labelling these instructions for training and fine-tuning Natural Language Processing (NLP) models can be tedious and expensive. We introduce a novel task-specific model architecture, Label-To-Text-Transformer (\\textbf{LT3}), tailored to generate synthetic medication prescriptions based on provided labels, such as a vocabulary list of medications and their attributes. LT3 is trained on a set of around 2K lines of medication prescriptions extracted from the MIMIC-III database, allowing the model to produce valuable synthetic medication prescriptions. We evaluate LT3's performance by contrasting it with a state-of-the-art Pre-trained Language Model (PLM), T5, analysing the quality and diversity of generated texts. We deploy the generated synthetic data to train the SpacyNER model for the Named Entity Recognition (NER) task over the n2c2-2018 dataset. The experiments show that the model trained on synthetic data can achieve a 96-98\\% F1 score at Label Recognition on Drug, Frequency, Route, Strength, and Form. LT3 codes and data will be shared at \\url{https://github.com/HECTA-UoM/Label-To-Text-Transformer}","url_abs":"https://arxiv.org/abs/2310.19727v2","url_pdf":"https://arxiv.org/pdf/2310.19727v2.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":"generating-medical-instructions-with","repo_url":"https://github.com/hecta-uom/label-to-text-transformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"2k","task_name":"2k"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"cg","task_name":"NER"},{"task_slug":"named-entity-recognition-1","task_name":"Named Entity Recognition"},{"task_slug":"named-entity-recognition-ner","task_name":"Named Entity Recognition (NER)"},{"task_slug":"named-entity-recognition","task_name":"named-entity-recognition"}],"methods":[{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"set","method_name":"SET"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.19727","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.19727"}},"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":"deterministic:regex_extraction","url":"https://github.com/HECTA-UoM/Label-To-Text-Transformer","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hecta-uom/label-to-text-transformer","reach":{"status":"ok"}}],"summary":{"ran":7,"ran_draft_wrong":3,"unverified":4},"by_repo_kind":{"official":{"samples":14,"ran":10,"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":14,"samples":[{"code_sha256_prefix":"d79f23e381bac349","entry":"Decoder","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d79f23e381bac349"}},{"code_sha256_prefix":"9a90009ebd92e479","entry":"DecoderLayer","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9a90009ebd92e479"}},{"code_sha256_prefix":"00b2d8f963115880","entry":"EncoderLayer","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"00b2d8f963115880"}},{"code_sha256_prefix":"c1c52814e8545858","entry":"MultiHeadAttention","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c1c52814e8545858"}},{"code_sha256_prefix":"5dd0e5c7ed12cd76","entry":"PositionalEncoding","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5dd0e5c7ed12cd76"}},{"code_sha256_prefix":"fcc2d8bf7194efb7","entry":"PositionwiseFeedForward","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fcc2d8bf7194efb7"}},{"code_sha256_prefix":"f55932fd8000cda8","entry":"ScaledDotProductAttention","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f55932fd8000cda8"}},{"code_sha256_prefix":"73080156d02a4f89","entry":"get_angles","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"73080156d02a4f89"}},{"code_sha256_prefix":"acb6f9b17a58ef36","entry":"get_lookahead_mask","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"acb6f9b17a58ef36"}},{"code_sha256_prefix":"733cd4727b4ed611","entry":"get_pad_mask","repo":"HECTA-UoM/Label-To-Text-Transformer","repo_kind":"official","path":"Models/EncDecTransformer/Modules.py","file_url":"https://github.com/HECTA-UoM/Label-To-Text-Transformer/blob/HEAD/Models/EncDecTransformer/Modules.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"733cd4727b4ed611"}},{"code_sha256_prefix":"c54d91337bee0490","entry":"Encoder","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c54d91337bee0490"}},{"code_sha256_prefix":"0e9edcc3a4e00d45","entry":"Transformer","repo":"hecta-uom/label-to-text-transformer","repo_kind":"official","path":"Models/EncDecTransformer/Models.py","file_url":"https://github.com/hecta-uom/label-to-text-transformer/blob/HEAD/Models/EncDecTransformer/Models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0e9edcc3a4e00d45"}},{"code_sha256_prefix":"84eaec28aee89722","entry":"load_and_preprocess_data","repo":"HECTA-UoM/Label-To-Text-Transformer","repo_kind":"official","path":"Modules/DataHelp.py","file_url":"https://github.com/HECTA-UoM/Label-To-Text-Transformer/blob/HEAD/Modules/DataHelp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"84eaec28aee89722"}},{"code_sha256_prefix":"2ffa5ef1b40e1a7e","entry":"preprocessing","repo":"HECTA-UoM/Label-To-Text-Transformer","repo_kind":"official","path":"Modules/DataHelp.py","file_url":"https://github.com/HECTA-UoM/Label-To-Text-Transformer/blob/HEAD/Modules/DataHelp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2ffa5ef1b40e1a7e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}