CSCI 3725 Mission 6: Create a poetry generation and evaluation system.
This system creates limericks inspired from Bob Ross's season 28 youtube transcripts that are then evaluated and eventually displayed on the brouser. This program utilizes n-grams, parse trees as well as other characteristics of limericks and topics we have discussed in class. I have named my program LACTIC - Limericks Accessed Creatively Through Intentional Computation.
This file reads in the Bob Ross script files and creates the ngram object. It does so by utilizing the functions read_file and make_n_gram. This is an essential aspect of this program because it is the way the 'inspiring set' is built and put into a useful data structure.
This file This file contains the functions to create and write to an html file that will display and read aloud each given poem. The functions make_html_doc and html_text utilize information from a given poem in order to write appropriately to the produced file, but also name the resulting files as well. This is an important aspect of the program in relationship to the human interaction with the resulting poetry.
This file contains the n_gram class and all of it's associated functions. In this case it is a bigram, and this class offers the appropriate access to information. Other classes are able to retrive words based on probabilities and specifications, as well as add to the bigram, through the functions add_to_ngram, retreive_next_word, retreive_ryming_word, and get_starting_words. Without this file, there would be no logic to the process of production of the limericks.
This file contains the limerick class and all of it's associated functions. This class is essentail for the functionality of creating ("writing"), evaluating and naming the poems. The evaluation of poems is processed through a parse tree. Functions that support the creation of poems are get_syllables, build_first_or_third, build_other_lines, build_full_limerick, get_noun, get_adj, get_noun_list, get_adj_list, and get_poem_name. Functions that support the evalutation process are evalutate, evaluate_lines, evaluate_rhyme, examine_line, compare_tag, and get_tags. This file is essential to the creation of LACTIC's poetry.
This file drives the poetry generation process, and includes our main function. This is where limericks and their files are actually made by calling uppon the other files and consolodating their functions. Limericks are made through the make_limerick function, and get_limericks_above_100 uses it to create the list of quality limericks. create_files creates the html files. main runs the entire program.
The location where poem html files are written to.
Contains favorite poems that were generated by LACTIC. They were hand selected and moved there.
To run the program, first clone this github repository onto your local machine in a directory of your choice.
In the terminal run git clone [link to this repo], and thenthe command python3 poetry_generator.py
git clone [link to this repo]
python3 poetry_generator.py
Once the program has run, access the poem files in the poems folder and double click the file in order to open it in your browser.
- https://nlp.stanford.edu/pubs/lilt15.pdf (Pages 5-13). Talked about various linquistic devices, and gave me an opportunity to think about a variety of paths. It inspired me to assess the rhyme at the end of the lines. I did not do it in the same way as described, but it inspired me to make sure the rhyme was of higher quality.
- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.5363&rep=rep1&type=pdf#page=75 (Pages 69-71). Was really helpful in breaking down what I may need to think about when approaching limericks. It explained one limerick generation system and pointed to various resources/ideas that helped me get started.
- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.403.3207&rep=rep1&type=pdf (All pages). Figure 1 in particular gave a nice visual for a potential way to break down the process of writing/thinking about limericks. The first box talking about the NLP system was helpful to point me towards spaCy and how to break down the ideas. I incorporated some, but not all, of that progression in my program.
- https://dl.acm.org/doi/pdf/10.1145/1108473.1108496 (Page 108). This helped me visualize how to use a parse tree, and the ways in which I can use it for comparing sentances and therefore evaluate them.
- https://www.youtube.com/watch?v=VAkquAxQUPc
- https://spacy.io/usage/spacy-101#whats-spacy
- https://www.nltk.org/book/ch08.html
- https://universaldependencies.org/docs/u/pos/
- https://pronouncing.readthedocs.io/en/latest/tutorial.html#next-steps
- https://pronouncing.readthedocs.io/en/latest/tutorial.html#
- https://usefulangle.com/post/98/javascript-text-to-speech
- https://www.hongkiat.com/blog/text-to-speech/
The challege of multiple, relatively new, laguages as well as applying concepts and doing research challenged me as a computer scientist. This project is complex and required me to slow down and approach it intentionally. I have never done research regarding computer science before, and it added a new aspect of my understanding of the concepts, but also made me critically think about what I was looking for and how to search for it. I had to use key words intentionally and it pushed me to break down the assignment into researchable pieces. Through this project I practiced creating an outline, and using pen and paper to sit with and organize my approach. Beyond the critical thinking and organizational, this project pushed my conceptual understanding of n-grams, parse trees and how to process language. It was interesting to make connections to the other course I am taking, Theory of Computation. I also improved on my technical skills through research and practice. I worked hard to mantain syntax as well as breaking down my code into smaller, understandable, reusable pieces. This project pushed me in a variety of ways, and I think that I have grown from it.