Home For Fiction – Blog

for thinking people


programming

Fiction Sentiment Analysis: Examples and Methods

September 19, 2022

The term “sentiment analysis” in the contexts of texts refers to a program (to put it simply) that detects emotions in a text. A typical application is for detecting whether clients are happy or angry, but large-scale analysis – for instance, analyzing tweets – can also give a sense of public opinion on a matter. I’m not interested in any of that. Instead, I wanted to experiment with fiction sentiment analysis.

What kind of applications could it have? How difficult is it to implement?

That’s what we’ll be looking at in this post. Though I’ll offer you details and links along the way, I’ll also keep it accessible to a lay audience. Whether you’re a beginner/intermediate programmer looking for ideas, or simply someone interested in seeing the possibilities, there’s something here that will interest you.

Sneak preview: I’ll also share with you a link to my program, so that you can perform a fiction sentiment analysis on your novel or short story!

(more…)

Book Title Generator: A JavaScript Program with a Creative Lesson

August 15, 2022

One morning, I was staring at the screen a bit bored, trying to find something productive to do. Browsing through the blog, I saw an old post on how to select a title for your novel. I immediately had a flash of inspiration: What I should make is a book title generator!

The truth is, I wasn’t super serious about it, it was mostly meant as something productive to pass the time with. I mean, as I explain in the post linked above, picking a title for your novel cannot be a random process. More still, it cannot be a spur-of-the-moment thing, either. Conversely, it has to be a result of deliberation. It involves patience.

So, how does a book title generator fit in all that?

Honestly, I didn’t trouble myself with it. I just began coding – as I said, for the fun of it. But I was thoroughly surprised with the result, as it revealed to me several important things about creativity, including in terms of coming up with book titles. The book title generator… generated ideas.

In this post I’ll offer you all the details of my thought process behind making this JavaScript book title generator. I’ll also offer you the code and the program to try for free. However, above all, I’ll talk about the important lessons on creativity this silly little program had to offer.

book title generator
Here’s how this silly book title generator looks like. The results can occasionally be incoherent, but I cherry-picked a good example.
(more…)

Structuring Language for Automatic Text

July 18, 2022

If you’ve used Planet Generator, you must’ve noticed how it offers, among other things, what I refer to as “civilizational data”. These also include trivia for the imaginary cultures of the program, in the style of “Arranging a visit to Orphne? Avoid Flöchixäwu — and its rather ferocious beasts”. Such phrases are examples of automatic text.

To be clear, these examples are not entirely automatic – in the sense, they’re not made out of thin air, perhaps using AI or at least combining texts from other sources. Rather, they’re based on syntactic patterns I’ve offered the program, together with sets of words to choose from.

But it’s precisely this simplicity that makes this strategy attractive. It’s trivial to use, and the possible combinations it can come up with is staggeringly high.

So, in this post, I’m offering you a look under the hood of Planet Generator, showing you how it generates its automatic text. It’s easy, educating (in terms of teaching us how language operates), and revealing.

automatic text
“Natives of Damon are considered potentially obstinate” – or that’s what the automatic text of Planet Generator tells me…
(more…)