yafuly / SyntacticGen

14 stars 1 forks source link

How to paraphrase the text with a specific syntactic structure? #3

Open ryzhik22 opened 4 months ago

ryzhik22 commented 4 months ago

Could you explain, please, how to use your trained paraphrase model to generate a sentence with a specific syntactic structure, rather than just generating a new sentence?

1251480932 commented 4 months ago

Yes, I have the same question. I followed the paper to achieve this functionality by focusing on increasing scores. However, the generated sentences still follow the same patterns as during training and don't achieve the desired specific syntactic structures. How was this implemented? Because only five nodes representing parts of speech were used to form the syntactic signals, ignoring other nodes representing different parts of speech in the tree. Why were only some nodes selected?

yafuly commented 4 months ago

Hi,

Thanks for following our work. To control text generation with a specific syntactic template, you can incorporate a delexicalized syntax tree into scoring each beam candidate. For instance, at the tree depth of 2, you can award beam candidates if their delexicalized tree structure matches the given one, say (NP (VP)). In this way, we are encouraging the model to follow a generation path defined by our given syntactic template. Note that we can only use this method to control generation in a soft way, i.e., the generate may still not follow our expected template.