I decided to make a robot that would Tweet fake C&EN headlines. There are many ways one could go about doing this. But, the way I decided to do this is to use something called Markov chains. This is similar to how your cellphone’s keyboard works: Your cellphone will try to guess which word you want to type next based on your previous history of typing. I’ll give an example below.
Let’s say I have fed these two headlines into my database
- “Novel Ruthenium Catalyst”
- “Ruthenium Based MOFs”
The Markov chain will think headlines should start with either the word “Novel” or “Ruthenium”. Now let’s tell the bot to roll the dice and start constructing a sentence.
The bot picks: Ruthenium
The bot knows that after the word Ruthenium either “Catalyst” or “Based” are typical. Let’s have the bot roll the dice again.
The bot picks: Catalyst
Now the bot knows that the word “Catalyst” is associated with a full-stop and there is no way for it to generate anything further. So from only two headlines the bot is able to generate something unique, “Ruthenium Catalyst”. Based on these rules and the luck of the dice “Novel Ruthenium Based MOFs” would also be a possible headline for it to make.
I fed a large batch of real C&EN headlines into a database, told my bot to go at it, and Tweet what it comes up with, and also grab the first image on Google Images if someone were to search for that headline. Here is an example
Sometimes I get lucky and the story is funny, usually it just comes out nonsensical, absurd, or worse an actual real headline. You can befriend the bot through this link: @C&EN Simulator
Taking it one step further I also made a JACS bot based on the article titles I have been scrapping at ChemFeeds for the past 7 years.
You can friend him here: @JACS Simulator
The bots will update randomly throughout the day. If you have any questions for me leave them in the comments. I can open source the code if there is any interest in such things.
from Chemistry Blog http://ift.tt/1Oj37g9