Inspiration

While studying history, it is often useful to use a contemporary map to visualize the regions involved. I have found that the geographical context sheds light on the relationship between events and on their reasons for occurring. This project is an attempt to apply this technique to browsing news of current events. The idea is that the geographic visualization will make grasping current events a more simple and intuitive process.

What it does

The program displays a scrollable, zoomable map of the world. Markers appear on the map which the user can click to see a list of events taking place primarily at that location. The articles are read from a sidebar allowing simultaneous viewing of the article and the map. When an article is read, names of countries mentioned in the article are listed at the top of the page; hovering over these names temporarily pans the map to the country, and clicking on them zooms the map to focus on the country in detail. Similar links appear inline within the text of the article itself for greater convenience. The formatting of the article is otherwise preserved.

How we built it

The news articles were scraped from the New York Times website using Python 3 and a combination of feedparser, selenium, and beautifulsoup4. The countries and corresponding geographical coordinates were extracted from the articles using nltk, OpenStreetMap, and a database of country names. A Flask server sent this data to the front-end, which was written in Javascript and displayed the information using the Google Maps Javascript API and Bootstrap.

Challenges we ran

Extracting location information for entities other than countries generated an unacceptable number of false positives using our technique; unfortunately in the time allotted we were unable to fix this. We were also hoping to add article classification based on topic and location, which again proved too much to accomplish in a single day. There was also an issue using the Google Maps Javascript API with our original React project, preventing us from using that framework as planned.

Accomplishments that we're proud of

We are happy that the project was able to come together in such a cohesive picture from its component pieces. The Google Maps API is excellent, and resulted in an interface which feels fluid (and intuitive, at least to us, the developers).

What we learned

Javascript scope with var is confusing, and a single typo can result in incomprehensible behaviour. One should not put off deploying the demonstration version until an hour before the deadline.

What's next for Geographic News Contextualizer

We need to improve the location extraction from the articles. We will need to add capabilities for classifying articles by topic and by location, and to search and filter the articles in similar dimensions. As the app is used over a long period of time, the accumulation of news articles mean we should create options for filtering and visualizing articles by date published in order to show the temporal aspect of events. Also, we need to add the capability to read from news feeds other than the NYT.

Share this project:
×

Updates