This script does the heavy lifting by parsing Facebook Messenger conversations into individual messages with the associated timestamp, sender, and text or image contents. You can then add your code to analyze and explore the resulting data however you would like!
Begin by downloading your data from Facebook, which creates an archive that includes your Messenger conversations. Visit this page and click Download a copy of your Facebook data at the bottom. Then find the HTML file for the chat you would like to parse in the "messages" directory of the archive.
You can then add your code to the end of the file to analyze the messages in the conversation. The script has comments to guide you through the process.