{
  "source_file": "0930",
  "source_platform": "Dev.to",
  "author": "Priyesh Dave",
  "title_listed": "Day 8: Named Entity Recognition (NER) Fundamentals",
  "keywords": "",
  "domain": "文本处理",
  "content_type": "技术教程",
  "is_paid_flag": "否",
  "url": "https://dev.to/priyeshdave6/day-8-named-entity-recognition-ner-fundamentals-ko7",
  "publish_date": "2026-09-01",
  "corpus_stage": "",
  "notes": "",
  "id": "c4d2badacf55",
  "collected_at": "2026-10-02T13:50:20",
  "title": "Day 8: Named Entity Recognition (NER) Fundamentals - DEV Community",
  "body_markdown": "Previously, on Day 7:\nExplained part-of-speech (POS) tagging, its importance in NLP, different approaches to tagging, common tagsets, and typical challenges such as ambiguity and unknown words.\nWhat is Named Entity Recognition (NER)?\nNamed Entity Recognition (NER) is a key task in natural language processing (NLP). Its job is to automatically find and label “named entities” in text.\nA\nnamed entity\nis a word or phrase referring to a specific person, place, organization, date, value, or other real-world item. These are usually proper nouns or names, such as “London,” “Microsoft,” or “January 1, 2022.” NER systems identify these spans of text and label what kind of entity each one is.\nSome common categories for entities (called\nentity types\n) include:\nPerson\n(names of people)\nOrganization\n(companies, agencies, institutions)\nLocation\n(cities, landmarks, continents)\nDate/Time\n(calendar dates, clock times)\nMonetary values\n(prices, amounts of money)\nPercentages\n(percent numbers)\nNER is important because most of the useful information in text involves knowing\nwhat\nis mentioned, not just\nwhich words\nappear. For example, extracting all company names, people, or places from a document lets you answer questions and organize information in ways that raw text cannot.\nHow NER Fits with Other NLP Tasks\nNER is one building block among others in NLP. It focuses on extracting “things” mentioned in text, rather than analyzing grammar.\nTokenization\nsplits text into words and symbols. For example, “Mr. Smith went to Paris.” becomes\n[Mr., ., Smith, went, to, Paris, .]\n.\nPart-of-Speech (POS) Tagging\nlabels words as nouns, verbs, etc. (Reminder: We covered this yesterday. For example, “went” is a verb, “Paris” is a noun.)\nChunking\ngroups words into phrases like “the tall building.” This captures structure, but doesn’t tell you what kind of thing the phrase is.\nNER builds on these steps. It looks at the tokens and phrases to find meaningful real-world entities, and labels their type (person, place, organization, etc.). For instance, “Steve Jobs” is a noun phrase—but NER identifies it specifically as a PERSON entity.\nCommon Entity Types in NER\nMost NER tools use a handful of carefully chosen types:\nPerson (PERSON):\nSpecific people or fictional characters\nExample:\n“Barack Obama”, “Harry Potter”\nOrganization (ORG):\nCompanies, groups, or institutions\nExample:\n“Google”, “United Nations”\nLocation (LOC):\nPhysical places (cities, mountains, rivers)\nExample:\n“Mount Everest”, “Nile River”\nGeo-Political Entity (GPE):\nCountries, states, cities\nExample:\n“France”, “California”\nDate (DATE):\nDates or ranges\nExample:\n“April 10, 2022”, “last Friday”\nTime (TIME):\nTimes or durations\nExample:\n“8:00 PM”, “two hours”\nMoney (MONEY):\nMonetary amounts\nExample:\n“$100”, “fifty euros”\nPercent (PERCENT):\nPercentages\nExample:\n“10%”, “half of the people”\nDifferent tools or datasets might include more or fewer categories, but these are the most common.\nHow NER Systems Work\nNER systems have developed over time, moving from simple pattern matching to advanced machine learning:\nRule-Based NER\nuses hand-coded patterns. For example, it might look for “Mr. [Capitalized Word]” to find personal names. This is limited and doesn’t adapt well.\nDictionary or Lookup-Based NER\nchecks for matches against lists of known entities, like cities or company names. This is fast, but misses new or misspelled names.\nStatistical Models\nlike Hidden Markov Models (HMMs) or Conditional Random Fields (CRFs) learn from labeled examples. These can spot patterns in contexts rather than just matching strings exactly.\nNeural NER\nuses neural networks, including models like BERT. These systems learn from large datasets and can generalize to names and phrases they have never seen before.\nIn every approach, NER takes a chunk of text and returns a list of entity spans, with a label for each one.\nFor example, with the sentence “Tim Cook runs Apple in Cupertino.” an NER system might return:\n“Tim Cook” (PERSON)\n“Apple” (ORG)\n“Cupertino” (GPE)\nNER Input and Output\nBefore NER processes text, it’s usually prepared in a couple of steps:\nThe text is split into sentences.\nEach sentence is split into tokens (words or punctuation marks).\nNER usually labels each token using the\nBIO\ntag format (also called\nIOB\n):\nB-XXX:\nBeginning of an entity of type XXX (like B-PERSON)\nI-XXX:\nInside an entity of type XXX\nO:\nOutside any named entity\nExample with the sentence:\n“Steve Jobs founded Apple in California.”\nToken\nTag\nSteve\nB-PERSON\nJobs\nI-PERSON\nfounded\nO\nApple\nB-ORG\nin\nO\nCalifornia\nB-GPE\n.\nO\nSome NER tools also output the “span” (start and end token indices):\nTokens 0–2: “Steve Jobs” (PERSON)\nToken 3: “Apple” (ORG)\nToken 5: “California” (GPE)\nThe core idea: the system identifies\nwhich part\nof the text is an entity, and\nwhat kind\nit is.\nRunning NER with spaCy\nYou don’t need to build NER from scratch to see it work. Tools like\nspaCy\noffer pre-trained English NER models.\nHere’s a minimal code example. Given this sentence:\n“Apple was founded by Steve Jobs in California.”\nLet’s run NER with spaCy:\nimport\nspacy\n# Load a small English model with NER support\nnlp\n=\nspacy\n.\nload\n(\n\"\nen_core_web_sm\n\"\n)\ntext\n=\n\"\nApple was founded by Steve Jobs in California.\n\"\ndoc\n=\nnlp\n(\ntext\n)\nfor\nent\nin\ndoc\n.\nents\n:\nprint\n(\nent\n.\ntext\n,\nent\n.\nlabel_\n)\nEnter fullscreen mode\nExit fullscreen mode\nOutput:\nApple ORG\nSteve Jobs PERSON\nCalifornia GPE\nEnter fullscreen mode\nExit fullscreen mode\n“Apple” is identified as an ORG (organization).\n“Steve Jobs” as a PERSON.\n“California” as a GPE (geo-political entity, like a state).\nYou can run this if you have spaCy installed (\npip install spacy\nand\npython -m spacy download en_core_web_sm\n). The important point is that NER gives back both the exact words (“spans”) and a label for each, showing which things are mentioned in text.\nKnowing who, what, and where is foundational for building search engines, news apps, chatbots, and more. NER takes the raw stream of words and tells you what real-world things are there.\nKey Takeaways\nNER detects specific entities like people, places, and organizations in text.\nCommon NER entity types include PERSON, ORG, LOC, GPE, DATE, TIME, MONEY, and PERCENT.\nNER can be implemented using rule-based, dictionary-based, statistical, or neural network methods.\nThe BIO tag format is widely used to mark entity spans in tokenized text.\nspaCy provides pre-trained NER models for easy extraction of entities from English text.\nTry It Yourself\nWrite a short Python script using spaCy to analyze three sentences you invent. For each sentence, extract all named entities and print both the entity text and its predicted label. Experiment with different kinds of names (people, places, dates, etc.) to see which types are detected.\nFurther Resources\n🎥\nNamed Entity Recognition (NER): NLP Tutorial For Beginners – S1 E12\n📄\nNamed Entity Recognition: How NLP Identifies People, Places & Organizations\n📄\nNamed Entity Recognition | Baeldung on Computer Science\nComing up on Day 9:\nText Classification with Naive Bayes and Logistic Regression",
  "metadata": {
    "title": "Day 8: Named Entity Recognition (NER) Fundamentals - DEV Community",
    "description": "Previously, on Day 7: Explained part-of-speech (POS) tagging, its importance in NLP, different... Tagged with ai, nlp, genai, 100daysofcode.",
    "keywords": "ai, nlp, genai, 100daysofcode, software, coding, development, engineering, inclusive, community",
    "author": null,
    "og:type": "article",
    "og:url": "https://dev.to/priyeshdave6/day-8-named-entity-recognition-ner-fundamentals-ko7",
    "og:title": "Day 8: Named Entity Recognition (NER) Fundamentals",
    "og:description": "Previously, on Day 7: Explained part-of-speech (POS) tagging, its importance in NLP, different...",
    "og:site_name": "DEV Community",
    "og:image": "https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fht8xafmxp2gbrvog3cmc.png",
    "twitter:site": "@thepracticaldev",
    "twitter:creator": "@",
    "twitter:title": "Day 8: Named Entity Recognition (NER) Fundamentals",
    "twitter:description": "Previously, on Day 7: Explained part-of-speech (POS) tagging, its importance in NLP, different...",
    "twitter:card": "summary_large_image",
    "twitter:widgets:new-embed-design": "on",
    "twitter:image:src": "https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fht8xafmxp2gbrvog3cmc.png"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/c4d2badacf55/code/body-000.txt",
      "chars": 223,
      "language": "text"
    },
    {
      "file": "attachments/c4d2badacf55/code/body-001.txt",
      "chars": 43,
      "language": "text"
    }
  ],
  "images": [],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/watch?v=2XUhKpH0p4M",
      "src": "https://www.youtube.com/watch?v=2XUhKpH0p4M",
      "status": "ok",
      "kind": "single_video",
      "local_path": "attachments/c4d2badacf55/videos/repair-2XUhKpH0p4M.mp4",
      "bytes": 83605530,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "1353.921000",
      "reused": true,
      "reused_from": "xinxing-zimeiti-corpus/attachments/34da2135edd5/videos/repair-2XUhKpH0p4M.mp4"
    }
  ],
  "links": [
    {
      "href": "https://www.youtube.com/watch?v=2XUhKpH0p4M",
      "label": "Named Entity Recognition (NER): NLP Tutorial For Beginners – S1 E12",
      "type": "a"
    },
    {
      "href": "https://fondralabs.com/blog/nlp-foundations/named-entity-recognition-how-nlp-identifies-people-places-organizations.html",
      "label": "Named Entity Recognition: How NLP Identifies People, Places & Organizations",
      "type": "a"
    },
    {
      "href": "https://www.baeldung.com/cs/ner-nlp",
      "label": "Named Entity Recognition | Baeldung on Computer Science",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:48:13Z",
  "source_url": "https://dev.to/priyeshdave6/day-8-named-entity-recognition-ner-fundamentals-ko7",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 7067,
  "expected_body_images": 0,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/c4d2badacf55/pages/source.html",
  "local_html": "attachments/c4d2badacf55/pages/article.html",
  "body_base_path": "attachments/c4d2badacf55/pages/",
  "body_markdown_path": "attachments/c4d2badacf55/pages/article.md"
}