Home For Fiction – Blog

for thinking people

Patreon LogoPatreon

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…)

Dreaming of Japan (and Other Imaginary Lands)

July 10, 2023

Japan is obviously not imaginary; it’s a real country, it exists – if you’re looking for countries that don’t exist, Finland is the one you’re looking for πŸ˜›. But my Japan is imaginary. I’m dreaming of a Japan that simply is there only in my imagination, being an entirely subjective, partial, and factually extremely flawed version of the realWe’ll come back to this later; it’s intriguing. Japan.

My Japan is no more (or less?) real than the afternoons of my childhood, smelling Greek coffee, and overall constructing a version of a reality that is, shall we use the term, questionable.

Whenever I’m reading about Japan, seeing photos or videos from there – including its huge cat culture, one must admit – I immediately feel calm. I feel a sense of longing for something that, again, isn’t there. More still, it never has; it’s not like I used to live in Japan and now I miss it.

So what does dreaming of Japan – and other imaginary lands – reveals to us about the way our mind wanders?

dreaming Japan
I tried to find the most stereotypical Japanese image you can think of, and this qualifies. I’m dreaming of a Japan that isn’t real – or, to put it this way, is a drop of reality in an ocean of factual details I deliberately ignore
(more…)

How to Deal with Incompetence: The Role of Malice

July 3, 2023

You might have seen some memes going around claiming “Idiots, everywhere!” or something of the sort. As George Carlin famously said, imagine how dumb the average person is, then realize half of them are even dumber. But to deal with incompetence (which isn’t quite the same as stupidity, which isn’t quite the same as ignorance), we need to also take something else into consideration: the role of malice.

There is a world of difference between an incompetent person who, still, has good intentions, and one who is malevolent. In other words, the saying “the road to hell is paved with good intentions” is seriously misleading.

Why?

But because benevolent incompetence will want to rectify its repercussions, whereas malevolent will not even recognize there is a problem.

Let’s try to categorize all this and come up with a theoretical framework, to see where (if anywhere!) it gets us.

deal with incompetence cats
“Let me handle this, Jim” (as I’ve said before, whenever I don’t want to spend much time finding a more suitable image, you get a cat; this time, you get two)
(more…)