Tuesday, 13 December 2016

The Common Ground Algorithm - A Possible Remedy for Filter Bubbles

People have a tendency towards Confirmation Bias, whereby they seek out things that confirm their existing opinions and avoid things that challenge them. On social networks and recommendation systems, this can lead to the development of a filter bubble, whereby their sources of information come to be structured around what they already believe. This, of course, acts as an obstacle to healthy discussion between people of differing opinions, and causes their positions to become ever more deeply entrenched and polarised. Instead of seeing those with whom they differ as being decent people who have something of value to offer them, and who may be persuadable on some of their differences, people start seeing their opponents as the enemy. To prevent this, people need something that will put them in touch with people with whom they have generally opposing viewpoints. Of course, we can't just confront people with contrary opinions - this will risk provoking hostile reactions. What we need is to show people what they have in common with those whose opinions are different, so that they can build trust and begin to interact in a healthy way. As an attempt to do this, I present The Common Ground Algorithm. This uses a combination of topic modelling and sentiment analysis to characterise a user's opinions. It then finds people whose opinions are generally opposed to theirs, and identifies the topics on which they share common ground, recommending posts where they agree on something with people they disagree with in general. I've coded up a reference implementation in Python, and am releasing it under the MIT Licence to encourage its use and further development.

Saturday, 27 February 2016

FizzBuzz

def FizzBuzz():
    for i in xrange(1,100):
        word=''.join(('Fizz' if i%3==0 else ''),
                              ('Buzz' if i%5==0 else ''))
        print i if word=='' else word

Thursday, 17 December 2015

Conscripts on Doctor Who

As mentioned before, my interests in conlanging and Doctor Who don't overlap as much as I'd like, due to Tardis telepathically translating everything. This apparently goes for writing too - in The Impossible Planet the Doctor realises that they're in a particularly dangerous situation when they encounter a script that the Tardis can't translate.

However, something odd has been going on this season. Amidst the rumours of the Hybrid, the theme of Truth of Consequences, the story of Ashildr, and the build up to the death of Clara, there's been another, more subtle theme in the background. In Under the Lake / Before the Flood, the Fisher King scratches this on the wall of his hearse.

The Fisher King's Script

The Doctor can't read it, and has to get Cass to lip-read what the ghosts are saying before he can work out what it means. The reason that the Tardis can't translate it is that the writing is intended to plant a message in the mind of the reader. Also, in that story we have the use of British Sign Language, which the Tardis can't translate because The Doctor's forgotten it.

In The Zygon Invasion / The Zygon Inversion we see this where the Zygon rebels have been active.

Zygon Script

Neither The Doctor, Clara nor the Tardis is present in these scenes, and whatever the poster says doesn't come into the story.

In Sleep No More, we see this Indo-Japanese script (apparently a hybrid on Kanji and Devanagari) on Le Verrier Space Station.

Indo-Japanese script

In this case it's not translated because what we're seeing has been hacked from the visual cortices of those who experienced the events, most of whom could read the script to start with. As in Under the Lake / Before the Flood, Ramussen's broadcast is meant to be a vector for mental malware.

Finally, in Face the Raven, we get this.

Aurebesh script

This is a bit of an oddity. It's the Aurebesh script from Star Wars, which is simply a cipher for the Roman alphabet (Star Wars never having cared about plausible languages). It says Delorean, which is presumably a Back to the Future reference. It looks like this is just an in-joke.

So, is this leading up to something? Might Doctor Who be about to start using conlangs? And if so, please can I make one?

Thursday, 22 October 2015

Integrating Java with Python the Easy Way

I have an idea for something I want to build, which will involve a speech recognition component, written in Java and a Hidden Markov Model, written in Python. So that means I have to integrate components written in two different languages. What's the best way of doing it? One way would be to run Python on the JVM. There is a Python implementation for the JVM, Jython, but from what I've heard it's painfully slow. Since I'm aiming for something as close to real time as possible, it's unlikley to meet my needs. It did occur to me that there could be a faster way to run Python on the JVM. Pypy is a self-hosting, JIT-compliled implementation of Python, which is much faster than the reference implementation. If its code generation phase were modified to emit Java Bytecode, then Pypy could run on the JVM. This approach, which I call Jypy, would be a worthwhile project for somebody who knows Java Bytecode. Unfortunately, I'm not that person. However, I then thought about the architecture of my project. I'd already realised that it would have to be organised as a number of concurrent processes, communicating via pipes. I then realised that meant that I didn't need to run Python on the JVM at all. The Java and Python components could each run in their own processes, and didn't need to share any resources. The only integration I needed was pipes. You know the sense of delight when you realise that something complicated is actually simple? That's how I felt when I worked that out.