0
$\begingroup$

Problem

I have collected a decently large set of movie trailer titles from various Youtube trailer channels. I'd like to extract or infer the movie title and release year from this set in some way to look up additional information about it via a browser extension.

Attempted Solutions

Regex. I've developed a fairly successful regular expression to work with the most common trailer channels, but new formats tend to pop up every now and then which renders the results invalid or incomplete. I've added a sample of my list (200k+) with raw titles from Youtube and manual extraction by myself in the parsed title and parsed year columns. There tends to always be a pattern to these titles such as "title is at the start and all caps", "year is usually in parentheses", and many others.

Question

I'm looking to extract EXACT text fragments, not summarizations. In the below examples, casing is maintained and the extraction occurs at a specific index in the source string. I'm trying to "understand" where these indices are based on training/sample data.

How would I go about extracting this index information automatically?

Sample Data

raw_title parsed_title parsed_year
MARVEL'S SHANG-CHI Official Trailer (2021) MARVEL'S SHANG-CHI 2021
ARTHUR AND MERLIN: KNIGHTS OF CAMELOT Official Trailer (2020) Action, Adventure ARTHUR AND MERLIN: KNIGHTS OF CAMELOT 2020
HIDDEN IN PLAIN SIGHT Official Trailer (2019) Thriller Movie HIDDEN IN PLAIN SIGHT 2019
MORTAL KOMBAT "Scorpion VS Sub-Zero" Opening Scene (2021) MORTAL KOMBAT 2021
SHANG-CHI AND THE LEGEND OF THE TEN RINGS Trailer (2021) Marvel Movie HD SHANG-CHI AND THE LEGEND OF THE TEN RINGS 2021
WHITNEY Trailer #2 (2018) Whitney Houston Documentary, Music Movie WHITNEY 2018
THEY Trailer (Cannes 2018) Rhys Fehrenbacher, Koohyar Hosseini Thriller Movie THEY 2018
RAMPART Movie Trailer # 1 (COP Drama - Woody Harrelson - 2012 RAMPART 2012
Mainstream Teaser Trailer (2021) - Movieclips Trailers Mainstream 2021
Mortal Kombat - First Seven Minutes (2021) - Movieclips Trailers Mortal Kombat 2021
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.