Named Entity Recognition - Natural Language Processing With Python and NLTK p.7
Skills:
AI Pair Programming70%
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
Python Encryption Tutorial with PyCrypto
sentdex
Python's Logging Function
sentdex
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
wxPython Programming Tutorial 4: Panels
sentdex
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
wxPython Programming Tutorial 8: Custom Button Images
sentdex
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
Basic PHP Tutorial 12: Associative Array
sentdex
Basic PHP Tutorial 14: Foreach loop
sentdex
Basic PHP Tutorial 16: Include and Require
sentdex
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
Basic PHP Tutorial 4: Variables and Comments
sentdex
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
Basic PHP Tutorial 1: Intro to PHP
sentdex
Basic PHP Tutorial 3: HTML with PHP
sentdex
Basic PHP Tutorial 9: While Loop
sentdex
Basic PHP Tutorial 10: Switch Statement
sentdex
Basic PHP Tutorial 2: Print and Echo
sentdex
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
Basic PHP Tutorial 19: Finding words in strings
sentdex
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
Basic PHP Programming Tutorial 24: String similarity
sentdex
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
Sikuli Tutorial 1: Visually programming in python!
sentdex
Sikuli Tutorial 2: Program visually in python!
sentdex
Sikuli Tutorial 3: Program visually in python!
sentdex
3D Bar Charts in Python and Matplotlib
sentdex
3D Plane wire frame Graph Chart in Python
sentdex
Raspberry Pi Part 1 Introduction
sentdex
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
Raspberry Pi Part 11: Remote Desktop
sentdex
Twitter Analysis: How to rank a user's influence
sentdex
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex
More on: AI Pair Programming
View skill →Related Reads
📰
📰
📰
📰
The Python Skills AI Still Can’t Replace in 2026
Medium · Programming
AI's Next Frontier: Cost, Control, and the Compute Race
Dev.to AI
The Rise of Enterprise AI Coding Assistant Bans: Why Cloud Tools Are Being Blocked and What to Build Instead
Dev.to · ping wang
coding benchmarks are becoming production dependencies
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI