A Clickbait Article Generator

The Bullshit Generator became very popular recently. Inspired by that project, I built a Clickbait Article Generator.

A Clickbait Article Generator

This article was originally written in Chinese and translated into English by AI.

The “Bullshit Generator” became very popular recently. Inspired by that project, I built a Clickbait Article Generator.

       How the question of what to write in today's post happens, and what must be done to make it happen—or what would happen if it did not—is the key to solving every problem. In general, we must consider it with the utmost care. How the question of what to write in today's post happens, and what must be done to make it happen—or what would happen if it did not—is the key to solving every problem. After thinking deeply about this question day and night, I believe we must generally consider it with the utmost care. Following the discussion above, faced with such a difficult choice, I have turned it over in my mind and lost sleep and appetite. In general, we must consider it with the utmost care.

—Bullshit Generator

The passage above was not written by a person.

That may sound like an insult, but it truly was not written by a human. It was generated by an amusing program called the “Bullshit Generator.” A link to the online version appears at the end of this article.

The web version of the article generator

It began with a question on Zhihu: “How do I write a 6,000-word application to resign from the student union?” Then an enthusiastic user named KE meng, who hated empty formalism, saw it. The result was the “Bullshit Generator.”

The generator can produce an article of any length. At first glance, its output even looks vaguely convincing, much like the opening passage above. Some people joked that its generated articles were better than what certain humans write.

Comments from users

For precisely that reason, the project was widely praised on Zhihu and GitHub.

The Bullshit Generator became extremely popular

As an NLP enthusiast, when I first saw the project, I assumed it used a Chinese GPT-2 model—a neural network requiring enormous computational resources.

A novel generated by GPT-2

The image above shows a novel generated by GPT-2. Given an opening passage, the model can continue writing from it. More information and an online demo appear in the postscript.

The model's results are impressive, but it also requires substantial computing resources. When I learned that the Bullshit Generator had an online version, I wondered how many GPUs it needed to serve so many users simultaneously.

In reality, the generator does not use any AI algorithm at all!

The Bullshit Generator's author states that it has nothing to do with AI

If it does not use AI, how does it work?

The method is simple: continually repeat material written in advance.

Sentences prepared in the corpus

The Bullshit Generator randomly repeats existing sentences from its corpus and inserts the keyword from time to time. The result is nonsensical while remaining closely tied to the requested topic.

This reminds me of a joke: how to implement an AI chatbot in five lines of code.

A chatbot in five lines of code

For readers who do not understand the image, its supposedly “intelligent” answer merely repeats part of the question and adds an exclamation mark.

Part of what makes both the five-line chatbot and the article generator funny, I think, is that they use an extremely clumsy method to attack a complex problem, yet still produce an entertaining result.

Returning to the generator, its output is not the only amusing part. The way its code is implemented is funny too, because...

Part of the Bullshit Generator's source code

The entire program is written in Chinese! More precisely, its variables have Chinese names, and even its source files are named in Chinese.

From its presentation to its implementation, the Bullshit Generator is funny at every level.

Normally, this is where the post would end. Readers would reach the WeChat ad at the bottom, and I would earn a little advertising revenue from the impression.

But! I am a programming comedian who once used AI to “outwit” a scammer. You can read that earlier article by clicking the image below.

Earlier article: How I Used AI to Mess with a Scammer Click the image to read it

I decided to stand on the shoulders of the Bullshit Generator, carry on its spirit, and write an improved article generator—also programmed in Chinese, of course.

After some thought, I chose clickbait as my target.

I have always hated clickbait articles. Their headlines reveal no information beyond grabbing attention, while their contents are nothing but empty chatter.

A typical example is: “Why must you never eat watermelon with a spoon? It is dangerous if you don't know the reason—do you know why?”

A clickbait article

What? You cannot eat watermelon with a spoon? Why not?

Curiosity makes you open the article. After enduring incoherent paragraphs and all kinds of inexplicable illustrations, you finally find the answer:

Apparently, using a spoon makes it easy to eat too much and upset your stomach.

To build my Clickbait Article Generator, I first read a great many clickbait articles—my spirit remains traumatized—and identified three defining characteristics:

  1. The content rambles around an obvious statement or a rumor.
  2. It often quotes something an “expert” supposedly said.
  3. It includes several random-looking images.

Next, I will explain the generator's main idea and its more amusing modules, implemented in Python. Readers interested in the programming details can visit:

github.com/DrMofu/BTDgenerator

First, we need to enter an obvious statement as the article's central idea.

In the following example, our obvious statement is “Xiaoming is a student.”

Now let us generate an attention-grabbing headline.

The implementation is simple. We prepare a collection of headline openings and endings in advance.

Our headline = opening + obvious statement + ending

Possible openings include “Shocking!”, “Unbelievable!”, “Outrageous!”, “Understand ... in X days,” and “Something X% of people don't know!”, where X is generated randomly.

Possible endings include “You're not Chinese if you don't share this!”, “Men will fall silent and women will weep,” and “The truth is completely unexpected.”

Examples of automatically generated headlines:

  • Understand “Xiaoming Is a Student” in 38 Hours. So That's How It Is
  • Completely Understand “Xiaoming Is a Student” in 45 Days. You're Not Chinese If You Don't Share This!
  • Shocking! Xiaoming Is a Student. The Truth Is Completely Unexpected

Next comes article generation.

The body can follow the same broad approach. We prepare a collection of empty phrases such as “Obviously, A seems simple to most people, but is that really the truth?” and “A looks simple?”, where A is the obvious statement, and continually repeat them.

That gives us the first characteristic of clickbait: “The content rambles around an obvious statement or rumor.”

Next comes the second characteristic: “It often quotes something an ‘expert’ said.”

First, we automatically generate the expert's name. We prepare possible family-name and given-name characters, then draw one character from the first collection and one or two from the second.

Then we insert phrases such as “Expert R repeatedly stressed that A must be taken seriously, or the consequences will be severe,” and “Professor R says A is nowhere near as simple as it looks.” Here A is the obvious statement and R is the expert's name.

Combining these steps, the Clickbait Article Generator can produce content like this:

Expert Xi Lipin repeatedly stressed that “Xiaoming is a student” must be taken seriously, or the consequences will be severe! Professor Xi Lipin says “Xiaoming is a student” is nowhere near as simple as it looks. Does “Xiaoming is a student” seem simple? Many people mistakenly believe that “Xiaoming is a student” is perfectly ordinary. Obviously, “Xiaoming is a student” seems simple to most people, but is that really the truth? Just how dangerous is “Xiaoming is a student”?

Are we finished? Not yet!

Clickbait has a third characteristic: “It includes several random-looking images.”

Here, I call a web crawler that searches for our obvious statement and extracts the URLs of the first few images. I use Sogou because Baidu Image Search requires verification and is harder to crawl directly.

I have to complain, though: Sogou's related searches are always baffling.

Finally, we add the finishing touch: a “bullshit conclusion” such as “In short, there is actually nothing wrong with A,” or “From the analysis above, we can see that A is completely normal, so there is no need to worry.”

We then write a webpage template, insert the generated headline, article, and crawled images, and save it as a new page.

And just like that, a clickbait article is born!

The page layout is rudimentary, but as a whole, the article looks surprisingly convincing.

At present, the Clickbait Article Generator is available only as a Python program:

github.com/DrMofu/BTDgenerator

To run it, readers must download the program and execute it locally with Python. I have always wanted to create a web version so everyone can try it easily, but my time and energy are limited. I will definitely add the web version in a few days.

Here is part of the implementation:

Postscript

Articles generated by GPT-2, an actual AI model, are also entertaining. Here I used the open-source GPT2-ML project published on GitHub by user imcaspar.

Enter a single sentence, and the model can continue it with new material.

For example, I entered “A secret 99% of employees don't know! Read this now!” Some of the more interesting generated passages were:

A secret 99% of employees don't know! Read this now! A little compliance knowledge for labor-service companies: never lease a company for the long term, and never lend out all of a company's belongings for the long term, including bags, computers, phones, refrigerators, air conditioners, televisions, and set-top boxes! Do not establish a fixed company through long-term leasing. Once established, it will have no management or maintenance staff and will remain a tiny operation indefinitely! Better to struggle for a year or two than borrow money from a long-term leasing company! Everyone must understand! A company is a place for vacation; its employees come to work as though visiting a grave! The company offers absolute freedom, can organize trips for everyone, and even has an ultra-comfortable clubhouse. Just thinking about it is exciting~

A secret 99% of employees don't know! Read this now! The trick behind 58.com and Ganji lies in these five ghosts! Rumor says 58 often tricks people recruited through Ganji. First 58 and Ganji pull strange moves, then the two companies cannot agree on anything. Neither side's people are satisfied, until one phone call sends a group over from the other company and, in a fit of rage, they viciously trap the 58-Ganji side! The partnership between the two sites is not going well. Something suspicious is happening: 58-Ganji often recruits part-timers and then tries every possible way to generate fake orders.

Or I entered “Why can't you eat watermelon with a spoon?”

Why can't you eat watermelon with a spoon? Because watermelon is alive (mortality rate...). American soldiers could not carry out their mission because obvious language barriers caused enforcement problems. In a special cultural environment and under enforcement regulations, they insisted that a young American soldier come out, but he refused. It was already beyond their capabilities, and in the end he received a life sentence, yet they still insisted on making them come out again! If you want to strengthen the watermelon's vitality, let them dig it out—let them use spoons.

Why can't you eat watermelon with a spoon? I don't think that way when I eat watermelon. I know watermelon can taste bitter but is still edible, just as I know bitterness will not affect me, yet I don't know who above is bitter. What do you think? How many of these answers can resolve the questioner's confusion while expressing every experience since birth? All that unnecessary nonsense is simply idleness. Trust me, this is not good. Anyone who thinks this belongs to philosophy should click “disagree” and “not helpful.”

AI-generated articles seem much more entertaining than clickbait articles.

Clickbait Article Generator project—the project described here: github.com/DrMofu/BTDgenerator

Bullshit Generator project: github.com/menzi11/BullshitGenerator

Online Bullshit Generator: suulnnka.github.io/BullshitGenerator

GPT-2 article generator project: github.com/imcaspar/gpt2-ml

Online GPT-2 article generator—access restrictions may apply:

colab.research.google.com/github/imcaspar/gpt2-ml/blob/master/pretrained_model_demo.ipynb

This article was generated by the Clickbait Article Generator. Just kidding.