RWET Final Proposal

Real news for a fictional world:

The idea I have for the final is to create a sort of news service for fictional worlds. My thinking right now is that I’ll work on something that reads in current headlines, picks one (or maybe uses all of them) to construct a headline for a fictional (e.g. TV or video game) universes. My plan is to use spaCy to pick out noun phrases and other parts of speech and then replace them with similar parts of speech from Wikia fandom pages. This may include descriptions of the articles as well. Ideally this will create a natural contrast with the idea narrative of “fake news”. Here are some examples done by hand:

 

I’m still trying to figure out how the presentation of this will work, maybe I will read it like a newspaper. I’m not sure if it should come from one fandom or multiple.

RWET – Markov / Ngram

This week I took my headline gathering script and applied the Ngram and Markov chain library to it. After adjusting the length of the N grams and trying out some “key” words I ended up with something rather simple but effective in terms of this confusion of news and time effect I’m going for. Basically I take all of my headlines and pass them through Generate_from_tokens function to create new headlines with an Ngram length of 6. I liked the results here because the headlines are typically generated but occasionally repeating the source material so when you read through a list of them its unclear whats real and what isn’t. Also some of them worked out to be kinda funny. Here are some of the highlights:

Read More

RWET – Functions

This week I took my previous assignment and tried to get all the printing to work through a function. I got it all working in the end but I had a surprising amount of difficulty.

I call the function like this:

 

Here’s an example of the result, which hasn’t changed much.

 

Ashwin’s dig: March 30 will be known as ‘World Apology Day’ – Times of India

thirtieth

Both Houses adjourned till 11 am on March 31

Does Science Advance One Funeral at a Time?

 

Both Houses adjourned till 11 am on March 31

thirtieth

Supreme Court refers triple talaq case to 5-judge constitutional bench; hearing to begin May 11 – Times of India

No stamping of flyers’ handbags at 7 airports from April 1 – Times of India

I tried to set this aside as a module but It required a lot of libraries and variables from my main script. I guess I could have passed all those through as parameters but it felt kinda hacky so I left it all as one file.

RWET – Poetic Form

I  once again continued working with news headlines this week. However this time I think I have a more robust collection of headlines. I found a news api that lets me pull in over 550+ headlines from 60 different news sources. The code I wrote basically gets the list of sources from the API and then uses that list to request 10 headlines from each source. These headlines are then saved in a list together and then if any of them contain numbers (in either written or numerical form) they are sorted into another list based on the numbers they use. E.g “Five people discover volcano”   would be assigned to a list within the 5th slot of another list. I then got the real time and date and tried to have the program print the date and time using these headlines. Here are some results:

Read More

RWET – APIs

I continued to work with headlines and news. This time I used an API to grab the most popular headlines on NYTimes.com and pick a random word to replace with a definition from Oxford dictionary. Sometimes the results don’t make sense but every now an then an interesting replacement occurs. Here are some examples of the output (my favorites are in bold):

Read More