Writing Persian Poetry with GPT-2.0, by Afshin Khashei

Skip to first unread message

Behnam Esfahbod

Apr 1, 2020, 3:50:31 AM4/1/20
to Persian Computing
Hi there,

We haven't had any posts here (and much news in general) on language models for Persian for a few years now. That's why I'm very excited about this Medium post by Afshin Khashei:

Writing Persian Poetry with GPT-2.0

In January 2020 I pre-trained a Persian GPT-2 medium model on a large text corpus that was collected from the internet. After that, I tried different ways to fine-tune this model to generate classical and modern Persian poetry. 
My goal was to generate classical Persian poetry in a given topic while adhering to the strict rhythmic and rhyming structure of Persian poetry. To achieve that, I tried three different approaches:
  1. Pre-training GPT2 medium on a large corpus of plain text (like the above model) then continues training on classical Persian poetry for a while.
  2. Training GPT2 medium on a large corpus of text including both poetry and text, with heavier weight on poetry. (Poetry content was repeated in training set a few times more than the plain text).
  3. Training a GPT2 small only on a corpus of classical and modern poetry.

The article has some nice samples generated by the model. Check it out there.


Behnam Esfahbod | بهنام اسفهبد | Q4880939 Q2064908

Mitra Mir

Mar 13, 2021, 1:02:31 PM3/13/21
to Persian Computing

Hi Behnam!

I was just scrolling through the search results until I found your comment in here. I think text generation is indeed an interesting problem to solve! I wanted to see if you have done anything further on this matter?

Warm regards,

Behnam Esfahbod

Mar 13, 2021, 1:54:19 PM3/13/21
to Mitra Mir, Persian Computing
Hi Mitra,

This is not exactly my area of expertise. I suggest contacting the author of the article, Afshin Khashei, who seem to working in this area.


Behnam Esfahbod | بهنام اسفهبد | Q4880939 Q2064908 | behnam.es


You received this message because you are subscribed to the Google Groups "Persian Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to persian-comput...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/persian-computing/12f32bc0-589b-49a0-a080-753fdc4963f3n%40googlegroups.com.
Reply all
Reply to author
0 new messages