You are on page 1of 11

"AI Poetry Generator "

A PROJECT WORK PHASE-1 REPORT SUBMITTED TO

THE NATIONAL INSTITUTE OF ENGINEERING, MYSURU


(AUTONOMOUS INSTITUTION UNDER VTU)

In partial fulfilment of the requirements for project work phase – 1

Bachelor of Engineering in

Computer Science and Engineering


Submitted by:
Nishant Sharma (4NI19CS076)
Harsh Babal (4NI19CS048)
Amandeep Singh (4NI19CS017)
Sanjay S (4NI18CS075)

Under the guidance of


B R Vatsala
Assistant Professor
Department of CS&E
NIE, Mysuru - 570008

Department of Computer Science and Engineering


The National Institute of Engineering
(Autonomous Institution under VTU)
Manandavadi Road, Mysuru-570 008
2022-2023

1
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
THE NATIONAL INSTITUTE OF ENGINEERING

CERTIFICATE

This is to Certify that the project work entitled “AI Poetry Generator” is a bona fide work carried
out by Nishant Sharma (4NI19CS076) , Harsh Babal (4NI19CS048), Amandeep Singh
(4NI19CS017) , Sanjay S (4NI18CS075) in partial fulfilment for project work phase – I, seventh
semester, Computer Science and Engineering, The National Institute of Engineering (Autonomous
under VTU) during the academic year 2022 – 2023. It is certified that all corrections and
suggestions indicated for the Internal Assessment have been incorporated in the report deposited in
the department library. The project work Phase – 1 report has been approved inpartial fulfilment
as per academic regulations of The National Institute of Engineering, Mysore.

Internal Guide Professor & Head Co-Examiner

……………………………… …………………………….. ..……………………….


B R Vatsala Dr. C Vidyaraj Dr. C Vidyaraj

Assistant Professor Professor & Head Professor & Head


Dept of CS&E Dept of CS&E Dept of CS&E
NIE, Mysuru NIE, Mysuru NIE, Mysuru

2
ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of any task would be incomplete without
the mention of people whose ceaseless cooperation made it possible and whose constant guidance
and encouragement crown all efforts.

First and foremost, we would like to thank our beloved principal Dr. Rohini Nagapadma for being
the patron and the beacon light for this project.

We wish to express our sincere gratitude to Dr. C Vidya Raj, HOD, Department of CSE, NIE for
her relentless support and encouragement.

It gives us immense pleasure to thank our guide B R Vatsala ma’am, Assistant Professor,
Departmentof CSE, NIE, and our co-examiner Dr. C Vidya Raj, HOD, Department of CSE, NIE
for their valuable suggestions and guidance during the process of the seminar and for having
permitted us to pursue work on the subject.

- Nishant Sharma
- Harsh Babal
- Amandeep Singh
- Sanjay S

3
TABLE OF CONTENTS

Sl. No. Contents Page No.

1 Introduction 05

2 System Analysis 06

2.1 Literature Survey 06

Research Papers on Existing


2.1.1 06
System

2.1.2 Existing System 07

2.1.3 Proposed System 07

2.2 System Requirements 08

2.2.1 Hardware Requirements 08

2.2.2 Software Requirements 09

3 References 10

4
Chapter 1
INTRODUCTION

In the last years we have seen several attempts to generate creative objects automatically, with the
help of computer programs and we have started to accept the computer has an artist. The creation of
visual art, the composition of musical pieces or the generation of creative text are just some of the
fields that actual creative systems deal with.The generation of natural language is a well-established
and promising sub-field of artificial intelligence and computational linguistics. Its main goal is to
develop computer programs that can produce text that can be understood by humans. Among the
types of text generated automatically we can find, for example, biographies , weather forecasts and
also text that includes creative features. Attempts to the automatic generation of creative text include
systems capable of generating story narratives, jokes or poetry.This paper is focused on the generation
of the last referred text genre. The automatic generation of poetry involves several levels of language
like phonetics, lexical choice, syntax and semantics and usually demands a considerable amount of
input knowledge. It is a complex task and though an interesting topic for artificial intelligence
research.

We start by presenting two different categorisations forthe existing poetry generation systems. The
first is based on the approaches and techniques used to accomplish poetry generation and the second
is based on the goals of the system and on the output text. A brief overview on several systems
capable of generating poetry is then provided.

What makes this task more interesting is that some levels of language do not have to be strictly
addressed. Writing poetic text does not have to be an extremely precise task , as several ´ rules,
typically present in the production of natural language, need to be broken . On the other hand, poetry
involves a high occurrence of interdependent linguistic phenomena where features such as metre,
rhyme, and the presence of figurative language play an important role. For instance, it might be ok to
transmit a less clear message, in a trade-off for a pleasant sound given by a highly regular metre.

5
Chapter 2
SYSTEM ANALYSIS

2.1 Literature Survey:

2.1.1 Research Papers on Existing System:

Early poetry generators ( Queneau (1961) or Oulipo (1981)) relied heavily on combinatory
processes applied to a set of human-created poems. On the other hand, intelligent poetry generation
systems consider semantics when selecting content and take advantage of computational techniques
that add value to the generation process, with a more efficient exploration of the space of possible
generations, also enabling to handle a larger number of features, often towards a predefined
intention, and sometimes resulting in poems with higher novelty. This section enumerates some of
those techniques, borrowed from the domain of AI.

Support Vector Machines (SVMs), trained in a poetry corpus, were also used to predict followup
lines with certain syllabic and rhyming properties (Das and Gamback, 2014). And classic NNs ¨
were also used to measure the fitness of poems generated by an evolutionary approach (Levy,
2001). In the latter case, the NN was trained on human judgments of creativity in a selection of
limericks, half by humans and another half randomly generated

Some systems acquire full lines or fragments from human-created poems (Queneau, 1961), rap
lyrics (Malmi et al., 2016), blog posts (Wong and Chun, 2008), or tweets (Charnley et al., 2014),
and recombine them in new poems, considering features such as metre, rhymes, presence of certain
words or semantic similarity. On the one hand, these solutions minimize the issues of dealing with
syntax and do not require an underlying generation grammar or template. On the other hand, from
the point of view of novelty, they are poor, as lines from known texts can be spotted in the middle
of the produced poems. If precautions are not taken, this can even lead to licensing issues

6
2.1.2 Existing System:

Previous work in Poetry Analysis:

As mentioned above very little work has been done in studying empirical models
for poetry. In this section, we’ll examine a few ways of distinguishing good poetry from average
poetry.

Rhyme, Meter and Word Stress. In Automatic Analysis of Rhythmic Poetry [Greene etal.
2010], authors suggest that all the lines in the corpus to be converted into a stress – syllable mapping
using an FST. Next to cascade that FST into norm FST which near iambic parameters to strict iambic
parameters. Next step is to use Viterbi’s decoding to recover the highest probability alignments.

Here, one of the most important difficulty is poets tend to use a particular word in the
beginning or only the endings, few syllables are mostly stressed and a few of them are mostly Poetry
Analysis and Generation 6unstressed. Therefore, the solution is to apply unsupervised learning to
acquire word-stresspatterns directly from raw poetry, without relying on a dictionary.

2.1.3 Proposed System:

Poetry is just the evidence of life. If your life is burning well, poetry is just

the ash.

― Leonard Cohen

This quote justifies how vast, subjective and how difficult it is to define poetry. For ourdiscussion,
we’ll define poetry as a piece of natural language text that complies with theconstraints of
grammaticality, meaningfulness, and poeticness.

Grammaticality: This states that poem should be syntactically well formed. This does not
necessarily mean that poem should comply with all the grammatical rules in Englishl anguage, rather
poem should be governed by set of poetic grammar rules

7
Meaningfulness: Poem should convey some thought or concept. For instance, a giventext may
be correct by rhyme and meter to be considered a good poem but if it fails toconvey particular
emotion or message, it should not be considered as a good poem.

Poeticness: Poem should follow certain guidelines for style, rhyme and word-stress to
beconsidered as a good poetic text

8
2.1 System Requirements:

2.1.1 Hardware Requirements:

The following are the Hardware Requirements for the running the system:

 Hard Disk: 50 GB (or more)


 Ram: 8 GB (Recommended)
 Processor: i3 / AMD Fx 4100 (or greater)
 Processor Speed: 1.5 GHz (or higher)Software Requirements:
 GPU: Nvidia 1050ti or above

2.1.2 Software Requirements:

 Operating System: Windows only


 Languages: Python
 Tools: Jupyter Notebook, Google collab
 Proper Anaconda Environment

9
Chapter 3
REFERENCES
[1] K. Binsted. Machine humour: An implemented model ofpuns. PhD thesis,
University of Edinburgh,

Scotland, 1996.

[2] L. Bourbeau, D. Carcagno, E. Goldberg, R. Kittredge, andA. Polgu`ere. Bilingual


generation of weather forecasts in anoperations environment. In Proceedings of the
13th confer-ence on Computational linguistics, pages 318–320, Morris-town, NJ, USA,
1990. Association for Computational Lin-guistics.

[3] S. Bringsjord and D. A. Ferrucci. Artificial Intelligence andLiterary Creativity:


Inside the Mind of BRUTUS, a Story-telling Machine. Lawrence Erlbaum Associates,
Hillsdale,NJ., 1999.

[4] B. D ́ıaz-Agudo, P. Gerv ́as, and P. A. Gonz ́alez-Calero. Po-etry generation in


colibri. In ECCBR ’02: Proceedings of the6th European Conference on Advances in
Case-Based Rea-soning, pages 73–102, London, UK, 2002. Springer-Verlag.

[5] P. Gerv ́as. Wasp: Evaluation of different strategies for theautomatic generation of
spanish verse. In Wiggins, G. (Ed.).Proceedings of the AISB00 Symposium on
Creative & Cul-tural Aspects and Applications of AI & Cognitive
Science,Birmingham, UK, 2000.

[6] P. Gerv ́as. An expert system for the composition of for-mal spanish poetry. Journal
of Knowledge-Based Systems,14:200–1, 2001.

[7] P. Gerv ́as. Exploring quantitative evaluations of the creativ-ity of automatic poets.
In Workshop on Creative Systems,Approaches to Creativity in Artificial Intelligence
and Cog-nitive Science, 15th European Conference on Artificial Intel-ligence, 2002.

[8] P. Gerv ́as, B. L ̈onneker-Rodman, J. C. Meister, andF. Peinado. Narrative models:


Narratology meets artificialintelligence. In Basili, Roberto and Lenci, Alessandro

10
(Ed.).International Conference on Language Resources and Eval-uation. Satellite
Workshop: Toward Computational Modelsof Literary Analysis, Genova, Italy, 2006

11

You might also like