Update 3

Following the last update, the underlying algorithm is now fully implemented. The immediate next steps are about building up the poetry database and creating a mode where the system allows the user to visualize every intermediate step in the process of poetry generation.

Emotional Weight

I have implemented the emotional weight as well. There are two additional database tables now, one for emotional words and the other for qualifiers. Each word is assigned a weight along two axes: degree of pleasantness and degree of anxiety. Weights range from -1 to 1. Qualifiers are each assigned a multiplier. This number multiplies to the weight to obtain a combined value. The process is repeated for different word-qualifier combinations in the input message and poetry lines, and the figures are all added up.

These weights are then taken into consideration when poetry lines are selected.

Completed Algorithm

For a quick recap, this is how the system currently functions once it receives a message:

  • Format input for processing.
  • Calculate emotional weight of message. Two numbers will be attached to the message, along the two axes of emotion measurement.
  • Run the POS tagger on the input message and extract contextual information.
  • Select the most important words from the message by means of the tf-idf weight.
  • Fetch synonyms for these words.
  • Select most important word from this augmented set.
  • Shortlist poem lines from database (using word importance and contextual information)
  • Final selection taking the emotional weights into account.

Some notes

I was just thinking about this: there are several ways the system could be tested or modified.

  • Type of poetry. By restricting the type of poetry stored in the database, with the current algorithm the system would effectively learn what words and phrases are considered most important in that genre of poetry writing. The results of this could be interesting to see, they might be better than having a general poetry database.
  • Emotion axes. Today, the system attempts to select the poetry lines conveying emotions that match the input message closely in both degree of pleasantness and agitation. These parameters could be tweaked so that the system returns a line with just a similar degree of pleasantness but not agitation. Or to take it further, the system attempt to select lines corresponding to a directly opposite emotion.

Work in Progress

As I mentioned, the next steps are to build up a poetry database and create a verbose mode where the system shows intermediate steps. For the former, the idea is to set up a web form with fields for the author, poem name and text; and these will be stored in a temporary table for insertion to the database later. In the latter case, a boolean variable will decide whether verbose mode is activated.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License