Introducing Information Retrieval for Biomedical Informatics Students (2021)

Abstract: Introducing biomedical informatics (BMI) students to natural language processing (NLP) requires balancing technical depth with practical know-how to address application-focused needs. We developed a set of three activities introducing introductory BMI students to information retrieval with NLP, covering document representation strategies and language models from TF-IDF to BERT. These activities provide students with hands-on experience targeted towards common use cases, and introduce fundamental components of NLP workflows for a wide variety of applications.

## introduction natural language processing (nlp) technologies have become a fundamental tool for biomedical informatics (bmi) research, with uses ranging from mining new protein-protein interactions from scientific literature to recommending medications in clinical care. in most cases, however, the research question at hand is a biological or clinical one, and nlp tools are used off-the-shelf or lightly adapted rather than being the focus of research and development. when introducing bmi students to nlp, instructors must therefore navigate a balance between the computational and linguistic insights behind why nlp technologies work the way they do, and practical know-how for the application-focused settings where most students will go on to use nlp. we developed a set of three activities designed to expose introductory bmi students to the fundamentals of nlp and provide hands-on experience with nlp techniques. these activities were designed for use in the foundations of biomedical informatics i course at the university of pittsburgh, a survey course which introduces students to core methods and topics in biomedical informatics. the course is required for all students in the biomedical informatics training program; students have a range of experience in computer science, and no background in artificial intelligence or nlp is required. the sequence of activities, implemented as jupyter notebooks, comprise a single assignment focused on information retrieval, a common use case for nlp in all areas of bmi research. the assignment followed lectures focused on information retrieval, word embeddings, and language models (presented online in fall 2020). §2 gives an overview of the three activities, and we note directions for further refinement of the activities in §3. ## assignment details our set of three activities was designed with two primary learning goals in mind: our jupyter notebooks provide a sequence of code samples to analyze and execute, combined with background questions to assess understanding of the computational and linguistic insights behind the nlp technologies students are using. notebook 1: fundamentals of document analysis. in this notebook, students were first introduced to basic preprocessing tasks in nlp workflows such as tokenization, stemming, casing, and stop-word removal. using a corpus from the natural language toolkit (nltk) @xcite , the notebook demonstrated two indexing techniques -inverted indexing and creation of a weighted document-term matrix using term frequency-inverse document frequency (tf-idf). students then implemented a synthetic information retrieval task involving a collection of 12 documents mapped to 20 queries as a reference set. the students evaluated the information retrieval system with synthetic results for two queries comprising numeric values for each document in the query. students measured system performance using trec evaluation measures including recall, precision, interpolated precision-recall average, and mean average precision. the evaluation measures were implemented using the pytrec_eval library (van gysel and de rijke, 2018). notebook 2: introduction to word embeddings. in this notebook, students were introduced to word embeddings as a text representation tool for nlp. the students first created embeddings using singular value decomposition (svd) of a cooccurrence matrix using the corpus from notebook 1. this established the idea of capturing semantic similarity in texts as opposed to a tradition bag-ofwords model. the notebook then used pretrained word2vec embeddings @xcite to demonstrate a more refined approach of svd. the students were able to visualize both the embedding approaches in the notebook. this was particularly important as most students did not have prior experience with embeddings and plotting the word embeddings can lead to greater insight into the variable semantic similarity that embedding representations provide over lexical features. notebook 3: introduction to bert and clin-icalbert. as all the activities are designed for introductory students, youtube tutorials were used to provide background on neural networks and design decisions in language models for students with minimal background in nlp. students were introduced to nlp workflows and language models using the transformers library. transformers is an open-source library developed by hugging face that provides a collection of pretrained models and general-purpose architectures for natural language processing @xcite , based on the transformer architecture @xcite . this includes bert @xcite and clinical-bert @xcite , which are used in this notebook to implement named entity recognition and medical language inference tasks. the notebook guided the students through a medical language inference task to infer knowledge from clinical texts. language inference in medicine is an important application of nlp as clinical notes such as those containing past medical history of a patient contain vital information that is utilized by clinicians to draw useful inferences @xcite . the task also introduced bmi students to challenges unique to applying nlp on clinical texts such as domainspecific vocabulary, diversity in abbreviations, content structure, and named entity recognition with clinical jargon. the students used the mednli @xcite dataset created from mimic iii @xcite clinical notes for this task. building on knowledge from the previous notebooks, they implemented workflows to compare the performance of bert and clinicalbert models for prediction of labels in clinical texts. the students were encouraged to understand the importance of domain representation in pretraining data and the process of fine-tuning nlp models for domain-specific language. ## discussion we designed three activities to demonstrate fundamental concepts and workflows for application of nlp to introductory bmi students. while the scope of nlp in the biomedical field is much larger than one assignment, we developed the activities to provide students with a modular workflow of components that are applicable to other nlp applications besides information retrieval; i.e., text preprocessing, indexing, execution, and evaluation. one practical challenge for clinically-focused exercises is the limited availability of benchmark datasets. most clinical datasets require data use agreements and individual training requirements that are cumbersome for a classroom setting.thus, the first two notebooks use the nltk corpus which is a popular dataset for introducing nlp concepts without the challenges present in clinical datasets. while mimic @xcite is a valuable, relatively accessible source for clinical text, available annotations for it are limited. students can thus be introduced to fine-tuning of language models for the specifics of medical language, but instructors must anticipate challenges in providing train/test splits for supervised machine learning. we further take advantage of popular pre-built libraries (like transformers) so that students can focus on the application rather than constructing neural networks. in an application-focused setting, technical knowledge of neural nlp systems is less necessary, but users of those systems still need to understand what kinds of regularities they rely on and when they may be unreliable. the activities are thus designed to reflect the perspective of the practical challenges that students will face when working in biomedical nlp. finally, one important area we are investigating as we refine and extend these teaching materials is the ethical considerations of biomedical ai technologies. the intersection of medical and ai ethics poses several challenging questions for designing, training, and applying ai technologies in the biomedical setting @xcite , and sensitive information often described in medical text presents further ethical questions for nlp systems @xcite . thus, determining what bmi students have a responsibility to understand about the nlp tools they use, and how we most effectively teach that information in limited course time, is key to broadening the responsible use of nlp in bmi research. all materials presented in this paper are available from https://github.com/dbmi-pitt/ bioinf_teachingnlp .