Home For Fiction – Blog

for thinking people


programming

Literary Genre Detector: a Simple AI model in Python

July 17, 2023

My knowledge in Python is scant compared to JavaScript, though some years ago I did play with it a bit. Still, lately I’ve been interested in AI models, so I decided to give Python another go. As it turns out, it’s trivial to train some simple AI models with it. In today’s post, I’ll show you how I made a very simple literary genre detector.

AI models of this kind work in a very simple manner, conceptually speaking. They simply take as input a list of data the programmer has supplied in the form of [("love","positive"), ("care","positive"), ("hate","negative"), ("rage", "negative")] and then return guesses for a supplied string. For example, a sentence like “love, care, and blah blah” (in this extremely simple example) would be classified as positive.

As you can appreciate, it all boils down to the quality of the data – garbage in, garbage out, and all that. So, with this important caveat in mind, let’s see what a literary genre detector looks like!

Literary Genre Detector
A literary genre detector doesn’t have much to do with cookies and cat-shaped mugs, but reading does 😉
(more…)

AI Tools for Writers: Make Your Life Easier, Keep Your Art Intact

May 29, 2023

The popularization of artificial intelligence (AI) tools is arguably one of the most important things to have happened in terms of the internet and IT in recent years. We’ve already seen how AI can help programmers, and we’ve also seen the pitfalls of improper AI use. So let’s make it specific for writers and see what kinds of AI tools writers can use – and this will be a case of “it’s not what you think”.

You might recall a post where I explained how AI can write really well but it’s utterly lousy at producing art. This is a crucial detail to keep in mind here: AI can’t do your job for you. AI can’t produce art; currently it can barely produce something emulating it (though this might change in the near future).

In any case, if your goal is to write fiction that actually has something to express, completely eradicate from your mind the idea that you can delegate this job to AI. You can’t rely on AI for anything that is “client-facing”. In other words, you can’t rely on AI for writing.

Instead, I will focus on ways and AI tools writers can use to make their life easier, tickle their imagination, and produce literature that is affective.

ai tools writers
This is an AI-generated image made with DALL-E and Microsoft Bing Image Creator. The prompt was “A white FIAT 500, old model, parked on a Greek island beach under a tree, late afternoon”. For a fiction author, this is an invaluable reference tool
(more…)

The Clock Village: an Interactive Fiction Experience

April 24, 2023

The Clock Village, my latest programming project, is first and foremost an interactive fiction experience. Only nominally could one also call it a modern text adventure game, like my earlier Mansion Escape.

In other words, though in this process as a “player” you move around, engage in interactive dialogues, collect and use items, and try to increase the score that will let you get a “better” ending, I prefer to see The Clock Village as something more artistic.

Perhaps it’s a philosophical exploration of self. Or maybe a short interactive reflection of our innermost existential anxieties. Maybe, like true art, it simply is what its experiencer wants it to be

interactive fiction clock village game screen
This is the main screen of the interface. I don’t want to call it “game”; it’s interactive fiction
(more…)