April 2017
Intermediate to advanced
532 pages
12h 39m
English
To show an example of extracting textual features in the binary vector representation, we can use the movie titles that we have available.
First, we will create a function to strip away the year of release for each movie, if the year is present, leaving only the title of the movie.
We will use a regular expression, to search for the year between parentheses in the movie titles. If we find a match with this regular expression, we will extract only the title up to the index of the first match (that is, the index in the title string of the opening parenthesis).
Scala
First, we create a function which takes the input string and filters the output with a regular expression.
def processRegex(input:String):String= ...
Read now
Unlock full access