Named Entity Recognition - Natural Language Processing With Python and NLTK p.7

sentdex · Intermediate ·💻 AI-Assisted Coding ·11y ago

Key Takeaways

Demonstrates Named Entity Recognition using NLTK and Python

Full Transcript

what's going on everybody Welcome to part seven of our python with nltk for natural language processing tutorial video series in this video we're going to be talking about named entity recognition with python uh Python's nltk module so let's go ahead and scroll on down here and we really don't need any more of really any of this uh we'll comment this out for now uh you might want to return to it later but actually I'm going to get rid of it uh cuz I'm not using anymore in this tutorial so I'll get rid of it anyway now what we're going to do is uh talk about some named dentity recognition so we've got tagged that still has our parts of speech and all that and then what we can do is we can say named n for named entity and that's going to equal nltk NE chunk and then we want a chunk via named entity tagged and then we can do [Music] named. draw not let save and run that close this okay so here you can see part of what is causing some problem immediately uh we've got white house so facility white organization house person Eric but not catching Draper but I think it doesn't catch Draper in this instance possibly cuz there's no space between this these words um anyway continuing along no named entities found okay served America found that at least thank you and uh before we go any further I probably should um show you guys what these words even mean so here are I'll just paste them right in here these are named entity type examples so you can have an organization a person location a date time money uh percent facility gpe this is just geographical kind of location is so this would be a location but this is more like a general location uh so anyways those are the types let's go back over to what we're showing up here no named entities there none there whoops misclicked come on give us another one driv me nuts okay our Union is strong okay so that was a a correct grab there uh so let's close this though let's go over here close this okay and what you can also do though if you don't care uh it'll still pick these up but if you don't care about these very specifically what you can do is you can say this and then binary equals true and what this does for you is it just classifies everything is a named entity period it doesn't actually tell you like any like organization person location anything like that cuz like I said sometimes it's just inaccurate uh unexpected indent what have we done it's probably just angry at this I don't know I don't see anything else that should give me an unexpected indent yeah okay so here you can see that the named entity chunk was correct at least in this instance to chunk White House together okay uh so that was good it probably would have got Eric Draper if if that space wasn't an issue but anyway it's finding these named entities now um I think we had a few to go before we found any more Nam entities so I just want to kind of X out a few Applause I don't think we've made it past that I can't remember shoot let's clicked again H I'm not really seen any more um identities I can't believe we're not finding see if we can find an identity protect our people maybe people should have been one oh we found some though here's United States his named entity and so on so anyways good enough uh we'll close this out and uh let's go back one more time to the original version um right so if we look we'll see here that these are separated when you did without binary okay so remember this would be before it was binary equals true this one not to take out my trash someone do that for me uh facility organization so it's it's calling white and house separate right they're not actually being called the exact same like they're not part of the same entity as opposed to when we called this to be binary true you'll find that they were not separate see they are part of the exact same figure out how to get that little tag thingy to show up I like that give me it whatever jerk there we go got it uh anyway it's classifying them as the same named entity so that might be useful for some of you if you are hoping to get those together same thing with Eric Draper if that space wasn't there it would pick it up uh but I think if it wasn't binary uh or if it yeah if it wasn't binary it would probably say to anyway it can get kind of annoying so uh nltk named entity recognition can be really useful but it's like false positives are kind of high and its error rate is also kind of high so you'd want to have something else in place to maybe check the N dentity recognition um but you know that's it for the basics of the named dentity recognition it's actually pretty useful to have but I've sometimes I go back and for sometimes I'll use the name d recognition but sometimes I'll just look for nouns and that almost works just as good so anyway uh that's that you can also combine the two though keep that in mind uh so if you find if you use name deny recognition you can search for all nouns and then also if you find uh a named entity that has two named entities back to back chances are they actually should go together why nltk doesn't have that kind of understood I don't really know the I'm sure the people there are much smarter than me so I'm sure there's a really good reason why um but anyway that works for me at least so maybe if you're looking for something specific like that uh you might want to try that out so that's it for the name entity recognition if you have any questions or comments please feel free to leave them below otherwise as always thanks for watching thanks for all the support and subscriptions and until next time

Original Description

Named entity recognition is useful to quickly find out what the subjects of discussion are. NLTK comes packed full of options for us. We can find just about any named entity, or we can look for specific ones. NLTK can either recognize a general named entity, or it can even recognize locations, names, monetary amounts, dates, and more. sample code: http://pythonprogramming.net http://hkinsley.com https://twitter.com/sentdex http://sentdex.com http://seaofbtc.com
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from sentdex · sentdex · 0 of 60

← Previous Next →
1 Matplotlib Python Tutorial Part 1: Basics and your first Graph!
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
2 Python Encryption Tutorial with PyCrypto
Python Encryption Tutorial with PyCrypto
sentdex
3 Python's Logging Function
Python's Logging Function
sentdex
4 wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
5 wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
6 wxPython Programming Tutorial 3: Menu Bar and Menu Button
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
7 wxPython Programming Tutorial 4: Panels
wxPython Programming Tutorial 4: Panels
sentdex
8 wxPython Programming Tutorial 5: User Input Saved To Variables
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
9 wxPython Programming Tutorial 6: Multiple Choice Input
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
10 wxPython Programming Tutorial 7: Adding Static Text and Colors
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
11 wxPython Programming Tutorial 8: Custom Button Images
wxPython Programming Tutorial 8: Custom Button Images
sentdex
12 wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
13 Basic PHP Tutorial 13: Multi-dimensional Array
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
14 Basic PHP Tutorial 15: Functions and Global Variables
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
15 Basic PHP Tutorial 12: Associative Array
Basic PHP Tutorial 12: Associative Array
sentdex
16 Basic PHP Tutorial 14: Foreach loop
Basic PHP Tutorial 14: Foreach loop
sentdex
17 Basic PHP Tutorial 16: Include and Require
Basic PHP Tutorial 16: Include and Require
sentdex
18 Basic PHP Tutorial 7: Assignment, comparison and Logical operators
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
19 Basic PHP Tutorial 4: Variables and Comments
Basic PHP Tutorial 4: Variables and Comments
sentdex
20 Basic PHP Tutorial 11: Arrays part 1, basic array
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
21 Basic PHP Tutorial 6: If else and else if conditionals cont'd
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
22 Basic PHP Tutorial 1: Intro to PHP
Basic PHP Tutorial 1: Intro to PHP
sentdex
23 Basic PHP Tutorial 3: HTML with PHP
Basic PHP Tutorial 3: HTML with PHP
sentdex
24 Basic PHP Tutorial 9: While Loop
Basic PHP Tutorial 9: While Loop
sentdex
25 Basic PHP Tutorial 10: Switch Statement
Basic PHP Tutorial 10: Switch Statement
sentdex
26 Basic PHP Tutorial 2: Print and Echo
Basic PHP Tutorial 2: Print and Echo
sentdex
27 Basic PHP Tutorial 5: If else and else if conditional statements
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
28 Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
29 Basic PHP Tutorial 17: User Input Form Example / String Manipulation
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
30 Basic PHP Tutorial 18: HTML Entities and forms cont'd
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
31 Basic PHP Tutorial 19: Finding words in strings
Basic PHP Tutorial 19: Finding words in strings
sentdex
32 Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
33 Basic PHP Programming Tutorial 22: Hashing part 2: salting
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
34 Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
35 Basic PHP Programming Tutorial 21: MD5 Hashing For Security
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
36 Basic PHP Programming Tutorial 24: String similarity
Basic PHP Programming Tutorial 24: String similarity
sentdex
37 Basic PHP Programming Tutorial 25: Time and Time stamps
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
38 Basic PHP Programming Tutorial 26: Die and Exit
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
39 Basic PHP Programming Tutorial 27: MySQL Databases Part 1
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
40 Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
41 Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
42 Basic PHP Programming Tutorial 30: MySQL database in Use
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
43 Django Tutorial Web Development with Python Part 1: Installing Django
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
44 Python Tutorial: File Deletion and Folder Deletion / directory deletion
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
45 Python Tutorial: How to Rename Files and Move Files with Python
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
46 3D Graphs in Matplotlib for Python: Basic 3D Line
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
47 3D Plotting in Matplotlib for Python: 3D Scatter Plot
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
48 3D Charts in Matplotlib for Python: Multiple datasets scatter plot
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
49 Sikuli Tutorial 1: Visually programming in python!
Sikuli Tutorial 1: Visually programming in python!
sentdex
50 Sikuli Tutorial 2: Program visually in python!
Sikuli Tutorial 2: Program visually in python!
sentdex
51 Sikuli Tutorial 3: Program visually in python!
Sikuli Tutorial 3: Program visually in python!
sentdex
52 3D Bar Charts in Python and Matplotlib
3D Bar Charts in Python and Matplotlib
sentdex
53 3D Plane wire frame Graph Chart in Python
3D Plane wire frame Graph Chart in Python
sentdex
54 Raspberry Pi Part 1 Introduction
Raspberry Pi Part 1 Introduction
sentdex
55 Raspberry Pi Part 8: First Download and Update! (Firmware)
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
56 Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
57 Raspberry Pi Part 11: Remote Desktop
Raspberry Pi Part 11: Remote Desktop
sentdex
58 Twitter Analysis: How to rank a user's influence
Twitter Analysis: How to rank a user's influence
sentdex
59 GPIO Tutorial for Pi Part 2 - Programming the GPIO
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
60 GPIO Tutorial for Raspberry Pi Part 1 - Setting up
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex

Related Reads

📰
The Python Skills AI Still Can’t Replace in 2026
Learn the Python skills that AI still can't replace in 2026, focusing on security, architecture, and judgment
Medium · Programming
📰
AI's Next Frontier: Cost, Control, and the Compute Race
Learn how AI's next frontier is driven by cost, control, and the compute race, and why it matters for AI development
Dev.to AI
📰
The Rise of Enterprise AI Coding Assistant Bans: Why Cloud Tools Are Being Blocked and What to Build Instead
Learn why enterprises are banning cloud AI coding assistants and how to build a secure on-premise alternative, a $5,000/month opportunity for founders
Dev.to · ping wang
📰
coding benchmarks are becoming production dependencies
Coding benchmarks like SWE-Bench Pro have significant errors, impacting production dependencies, and it's crucial to reassess their use in decision-making
Dev.to AI
Up next
CodeAI at #ISTELive and their free lessons and learning space
Cool Cat Teacher
Watch →