N-gram Poems

Description

  • Rais Kazi

  • March 2021

I created a program that completes poems with bridge words. To do this I used a common Natural Language Processing technique known as N-gram. Two poems, corpus.txt and input.txt, are given as input. Based on corpus.txt the program will create a word affinity list based on each of the words and their adjacent words. Each connection between the words has a weight the represents the number of times those words have been adjacent to one another. The second poem, input.txt, will then be edited based on what words fit in between the given words.

Technology