{"id":258050,"date":"2026-07-13T16:00:55","date_gmt":"2026-07-13T13:00:55","guid":{"rendered":"https:\/\/1kitap1.com\/en\/data-science-first-using-language-models-john-hawkins\/"},"modified":"2026-07-13T16:00:55","modified_gmt":"2026-07-13T13:00:55","slug":"data-science-first-using-language-models-john-hawkins","status":"publish","type":"post","link":"https:\/\/1kitap1.com\/en\/data-science-first-using-language-models-john-hawkins\/","title":{"rendered":"Data Science First Using Language Models &#8211; John Hawkins"},"content":{"rendered":"<figure style=\"text-align:center;margin:0 auto 1.5em;\"><img decoding=\"async\" src=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/eee89941ed61fc46.jpg\" alt=\" - Unknown book cover\" style=\"max-width:300px;width:100%;height:auto;box-shadow:0 4px 12px rgba(0,0,0,.25);border-radius:4px;\"\/><\/figure>\n<p>) experience: str = Field( description=&#8221;A summary of relevant work experience. &#8221; ) skills: str = Field( description=&#8221;A summary of key skills.&#8221; ) parser = JsonOutputParser(pydantic_object=SelectionCriteri a) The SelectionCriteria class is used to create a JsonOutputParser object, which we then use in defining the prompt to create formatting instructions to the model: from langchain_core.prompts import PromptTemplate prompt = PromptTemplate( template = &#8220;&#8221;&#8221; Your job is to extract selection criteria from a job c andidate&#8217;s resume. The complete text of the resume will be provid ed, you need to identify the parts of the resume that contain descript ions of their education, work experience and key skills.<\/p>\n<p>Each of these three elements should be summarized and returned in a separate variab les according to the instructions below. &#8212; Here is the resume for you to process: &#8212; {resume}. &#8212; {format_instructions} &#8220;&#8221;&#8221;, input_variables = [&#8220;resume&#8221;], partial_variables = { &#8220;format_instructions&#8221;:parser.get_format_instruction s() } ) In this example, we are using a simple zero-shot strategy, describing the task without providing examples.<\/p>\n<p>(If we find there are problems, we can construct some focused examples to mitigate them.) We create a function that will invoke a LangChain chain\u2014consisting of a model using this prompt\u2014and process it into a dictionary of the required values as follows: def extract_criteria(chain, resume): results = {} criteria = [&#8220;education&#8221;, &#8220;experience&#8221;, &#8220;skills&#8221;] try: response = chain.invoke({&#8220;resume&#8221;:resume}) for k in criteria: if k in response: results[k] = response[k] else: results[k] = &#8220;&#8221; except: for k in criteria: results[k] = &#8220;&#8221; return results We now have all the pieces required to create a script that will process our dataframe of resumes, extract the selection criteria, and create a new dataframe with them.<\/p>\n<blockquote>\n<p>Chapter 4: Semantic Vectors Case Study 4.1 Detecting AI-Generated Text Case Study 4.2 Topic Modeling Summary References Chapter 5: Insights and Interpretability Case Study 5.1 Analyzing Semantic Vectors Explaining Model Outputs Case Study 5.2 Explaining Semantic Vector Models Mechanistic Interpretability Summary References Chapter 6: Zero-Shot to Few-Shot Prompting Case Study 6.1 Comment Classification Case Study 6.2 Sorting Resumes by Selection Criteria Summary References Chapter 7: Labeling and Feature Engineering Case Study 7.1 Industry Vertical Classification Case Study 7.2 Student Essay Features Summary References Chapter 8: Synthetic Data Generation Case-Based Prompting Prompt Variation Iterated Auditing Case Study 8.1 Customer Complaint Routing Variables Custom Parser Next Steps Case Study 8.2 Translation of Idioms Sentence Pair Classification Summary References Chapter 9: Retrieval Applications Retrieval Augmented Generation Case Study 9.1 RAG for Recruiters Case Study 9.2 Retrieval Augmented Classification (RAC) Summary Reference Chapter 10: Code as Language Code Comprehension Case Study 10.1 Code Reviewer Code Generation Case Study 10.2 Code Revisions Summary References Chapter 11: Automated Analytics Task Decomposition Case Study 11.1 EDA Analyst Bot Reflection Summary References Chapter 12: Agentic AI Agents Language Models into Agents Tool Use Case Study 12.1 Data Query Engine Model Context Protocol Case Study 12.2 Dataset Research Agent Checks and Balances Agentic Use Cases Summary References Index End User License Agreement List of Illustrations Chapter 1 Figure 1.1: A simple statistical language model.<\/p>\n<p>Figure 1.2: The Word2Vec language model. Figure 1.3: The recurrent neural network. Figure 1.4: The recurrent encoder-decoder model for translation. Figure 1.5: The attention mechanism in recurrent models. Figure 1.6: The complete transformer neural network model. Figure 1.7: The self-attention mechanism. Figure 1.8: The encoder-only transformer model. Figure 1.9: The decoder-only transformer model. Figure 1.10: The InstructGPT fine-tuning process. Chapter 2 Figure 2.1: The concept of a vector database. Figure 2.2: A screenshot of the model card for DeepSeek R1 on Hugging Face Hub.<\/p>\n<p>Chapter 3 Figure 3.1: Example of an ROC plot to calculate AUC. Chapter 4 Figure 4.1: The elbow method. Figure 4.2: Topic distribution. Chapter 5 Figure 5.1: Visualizing principal components. Figure 5.2: Venn diagram of AI and human keywords. Figure 5.3: Feature importance comparison. Figure 5.4: SHAP violin plot. Figure 5.5: Mechanistic interpretability. Chapter 6 Figure 6.1: Histogram of selection criteria scores.<\/p>\n<p>Chapter 7 Figure 7.1: Category distributions in test articles. Figure 7.2: Readability and vocabulary metrics. Chapter 8 Figure 8.1: Complaint category distribution. Figure 8.2: Complaint variable comparison. Figure 8.3: Idiom Classifier Precision-Recall Curve. Chapter 9 Figure 9.1: Law article NAICS category distribution. Figure 9.2: Business article NAICS category distribution. Chapter 10 Figure 10.1: Test Jupyter Notebook with deliberate errors. Figure 10.2: Revised Jupyter Notebook with generated code revisions.<\/p>\n<p>Chapter 11 Figure 11.1: Example errors in the generated analytics notebook.<\/p>\n<\/blockquote>\n<p><em>This is a short excerpt from the opening of &ldquo;&rdquo; by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.<\/em><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/1kitap1.com\/en\/data-science-first-using-language-models-john-hawkins\/#Book_Information\" >Book Information<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/1kitap1.com\/en\/data-science-first-using-language-models-john-hawkins\/#Reading_Word_Statistics\" >Reading &amp; Word Statistics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/1kitap1.com\/en\/data-science-first-using-language-models-john-hawkins\/#Most_Frequent_Words\" >Most Frequent Words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/1kitap1.com\/en\/data-science-first-using-language-models-john-hawkins\/#PDF_Download\" >PDF Download<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Book_Information\"><\/span>Book Information<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Unique ID:<\/strong> eee89941ed61fc46<\/li>\n<li><strong>File Extension:<\/strong> .pdf<\/li>\n<li><strong>File Size:<\/strong> 6,749,740 bytes (6.437 MB)<\/li>\n<li><strong>Title:<\/strong> &#8211;<\/li>\n<li><strong>Author:<\/strong> Unknown<\/li>\n<li><strong>ISBN:<\/strong> 9781394390472, 9781394406432, 9781394390489, 9781394390496<\/li>\n<li><strong>Pages:<\/strong> 485<\/li>\n<li><strong>Language:<\/strong> English (en)<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Reading_Word_Statistics\"><\/span>Reading &amp; Word Statistics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Estimated Reading Time:<\/strong> 576.04 minutes<\/li>\n<li><strong>Total Words:<\/strong> 115,208<\/li>\n<li><strong>Total Characters:<\/strong> 789,794<\/li>\n<li><strong>Average Words per Page:<\/strong> 237.54<\/li>\n<li><strong>Average Characters per Page:<\/strong> 1628.44<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Most_Frequent_Words\"><\/span>Most Frequent Words<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>model (1324), data (920), text (691), models (653), code (630), language (534), use (469), dataset (317), case (313), process (311), import (301), file (286), prompt (272), using (271), used (263), need (256), output (249), test (242), set (232), one (228), name (226), function (222), application (221), create (218), results (214), study (212), print (205), chapter (200), response (191), generated (182), csv (182), list (178), content (178), new (175), return (175), input (169), example (165), also (164), vector (157), specific (154), str (154), task (153), get (152), following (152), semantic (150), words (150), many (148), multiple (147), two (147), key (145), description (145), first (144), shown (137), values (135), number (127), want (126), training (125), between (125), review (124), generate (124), block (122), def (122), features (120), embeddings (120), different (119), simple (118), datasets (118), potential (118), variables (117), human (116), category (116), however (116), examples (116), structure (116), problem (115), science (114), figure (114), like (113), outputs (112), field (112), word (111), system (111), python (111), embedding (111), json (111), work (110), business (109), functions (107), complete (106), package (106), build (105), see (105), script (104), result (104), api (104), keywords (103), learning (102), approach (102), analysis (101), idea (100).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"PDF_Download\"><\/span>PDF Download<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align:center;\"><a href=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/data-science-first-using-language-models-john-hawkins.pdf\" download rel=\"nofollow\" style=\"display:inline-block;background:#2271b1;color:#ffffff;padding:14px 36px;border-radius:6px;text-decoration:none;font-weight:bold;font-size:1.05em;\">&#11015;&#65039; PDF Download<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>) experience: str = Field( description=&#8221;A summary of relevant work experience. &#8221; ) skills: str = Field( description=&#8221;A summary of key skills.&#8221; ) parser = JsonOutputParser(pydantic_object=SelectionCriteri a) The SelectionCriteria class is used to create a JsonOutputParser object, which we then use in defining the prompt to create formatting instructions to the model: from langchain_core.prompts import [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":258048,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-258050","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-english"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/258050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/comments?post=258050"}],"version-history":[{"count":0,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/258050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media\/258048"}],"wp:attachment":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media?parent=258050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/categories?post=258050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/tags?post=258050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}