2020 sent more bad news as Black Panther star Chadwick Boseman passed away aged 43. The response from the public and the industry has been enormous: the family’s announcement is now the most like tweet ever, stars made tributes, fans are creating art.

Black Panther and the rest of the Marvel Cinematic Universe (MCU) made a mark in popular culture. It’s a warming thought to think that these imaginary superheroes also make a positive impact in real people’s lives.

Apart from the standalone, critically acclaimed Black Panther film in 2018, King T’Challa was also an avenger who made notable appearances in Captain America: Civil War, Infinity War, and Endgame. In this blog post, I adapt methods from my previous Survivor article to look at the dynamics between Avengers characters.

Full disclosure: I started working on this article days before the tragic news. This post is about the imaginary characters and not the people behind them; centered on Avengers as a group and not only Black Panther.

**How did the dynamics between Avengers characters change over films? **I will be looking at who mentions who in dialogue, but also non-verbal interactions between characters — they are action movies afterall!

I will use Infinity War (the first Avengers movie I saw!) as an example to walkthrough the process. Then I move on to look at how relationships evolved over time through five films: The Avengers (2012), Age of Ultron (2015), Civil War (2016), Infinity War (2018) and Endgame (2019). The steps are:

  1. Find and scrape data
  2. Explore and prep data
  3. Extract entities
  4. Plot and analyse network graphs
  5. Draw insights

I will be leveraging some of my previous code and working in a Jupyter notebook. Key packages include BeautifulSoupfor parsing, spaCyfor entity extraction, and networkxfor visualising. As always, any comments on the thinking, coding and analysis are welcomed!

Want to skip ahead? Here is the final code. And awayyyyy we go!

#beautifulsoup #network-graph #python #avengers #nlp

Avengers: Web Scraping, Entity Extraction and Network Graphs in Python
2.30 GEEK