It is not evident in the book as to whether it was Ginny who wrote the poem that is read out loud by a dwarf dressed as Cupid. However, J. K. Rowling, the author of the book, has confirmed on several occasions that it was indeed Ginny who wrote the poem.