Cool Useless Demo
I’m sure you’ve asked yourself these questions before (who hasn’t?). In any case, ponder no further, for I’ve taken the time to hack a script that does just that! I’ve created a short Python script that queries Webhose.io for news and blog articles that mention Hillary Clinton. The Webhose.io API returns the mentioned personalities in each article, and the script indentifies the top 5 people mentioned. The script runs for each mentioned personality, until it reaches a list of 100 names. I plugged the dataset into the VivaGraphJS library, and plotted the list into a cool blob of a graph.
- Hover to highlight the connection graph
- Double-click to learn more about each person
- Drag the graph to explore more clusters
- Use the mouse wheel to zoom in & out
Granted, at first sight it appears interesting and useful, but as I sat down to explain what I had created, I wasn’t quite sure why anyone would want to know how Donald Trump is connected to Taylor Swift. Apparently she is supporting him. Don’t get me started.
But I digress. Since Webhose.io provides other types of entities, you can easily customize the script to visualize relationships between companies or locations. If you’d like to learn more about how the script works (which means you have some coding skills), keep reading. If not, you are more than welcome to play with the graph, and maybe you will find it useful (doubt it).
Try it for yourselfIf you want to run your own experiments, just follow these steps:
Edit & run extract_entities.pyI’ve uploaded to GitHub the Python script that produces the JSON for both the persons connected list, and their respective images. To run the script you need two access tokens, one for the Webhose.io API that you can obtain by creating a free account. The second is also free for Bing Image Search API.
Set your Webhose.io access token on the following line:
I’ve used Bing search API, to retrieve the faces of the mentioned persons. Note that if you want images other than faces, you need to remove the image type from this line:
The HTMLI’ve uploaded the HTML file to GitHub as well, and I’m relying on VivaGraphJS for the graphical interface, so make sure you download it and set the correct path:
Ran Geva, CEO webhose.io