From the course: NLP with Python for Machine Learning Essential Training
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Learning how to use regular expressions - Python Tutorial
From the course: NLP with Python for Machine Learning Essential Training
Learning how to use regular expressions
- [Instructor] There is a lot to unpack with regular expressions. I'm going to outline a few quick examples here, but there's so much that you can do with regexes in terms of searching for character patterns, character placement within a string, splitting up the strings, and so on. So I encourage you to do some of your own exploration to learn the different patterns and the functions that can be used. You can find more details in the link here. To put this to use, the low-hanging fruit here and the primary reason that we're talking about regexes is in order to tokenize sentences or split a sentence into a list of words so that Python can understand what it needs to be looking at. Right now, Python just sees a string of characters, so we need to tell it what to focus on, and how to organize those characters. For our machine learning model, Python will need to split the string into what we call tokens, or words, so that the model can learn how those tokens relate to the r response…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
What are NLP and NLTK?4m 7s
-
(Locked)
NLTK setup and overview6m 15s
-
(Locked)
Reading in text data11m 41s
-
(Locked)
Exploring the dataset6m 56s
-
(Locked)
What are regular expressions?4m 8s
-
(Locked)
Learning how to use regular expressions8m 44s
-
(Locked)
Regular expression replacements6m 3s
-
(Locked)
Machine learning pipeline4m 45s
-
(Locked)
Implementation: Removing punctuation9m 10s
-
(Locked)
Implementation: Tokenization3m 37s
-
(Locked)
Implementation: Removing stop words4m 2s
-
(Locked)
-
-
-
-
-