AI is the two-faced god that will do anything for you and the opposite for someone else.

Ask AI To Classify Meme Topics and Sentiments

Ask AI To Classify Meme Topics and Sentiments

For years, I have been classifying my favorite memes by topic. You can see all of these here. Often though, I find myself looking for a specific meme and not remembering what topic I used, or not being sure what topic it would have made me think of. Discussing the problem of organizing memes with some friends, it occurred to me that this is a perfect task for AI.

First we need to use OCR (Optical Character Recognition) to transcribe the text of the memes.

Next we need to create a list of topics for the meme based on the transcription.

The topics need to be qualified by sentiment. For example, Libertarianism versus Anti-Libertarianism.

Okay so first step is hooking into an OCR API. I found OCR.Space which is a free OCR API. I fed it the meme from above.

The OCR API had no trouble transcribing the text;

During my research I interviewed a
guy who said he was a libertarian
until he did MDMA and realized
that other people have feelings,
and that was pretty much the best
summary of libertarianism live
ever heard

Next I went over to OpenAI and fed the following prompt into GPT-3 Davinci-002;

Objecting: Analyze a meme’s text description and generate a list of topics for the meme of just one or two words each; these topics should be as general as possible. For each topic, add whether the sentiment is critical or affirmative of the topic in parenthesis.


Then I added the transcript of the meme. Here’s how the AI responded;

Topic: police (critical)
Topic: drugs (affirmative)
Topic: libertarianism (critical)


This is amazing! It’s way easier than I thought it would be. So now we just need to write a script that automatically does this for all the images in an upload directory, and then build a simple web-based front end which sets the transcript as the alt of the image and sets up a link tree of the topics that points to pages of the relevant content for each topic.