MavWolverine
MavWolverine

Reputation: 952

How to train a seq2seq model for converting structured text?

I am trying to train a model to convert some old templates to jinja2.

{if $logged_in}
    Welcome, <font color="{#fontColor#}">{$name}!</font>
{else}
    hi, {$name}
{/if}

to

{% if context.logged_in %}
    Welcome, <font color="{{ fontColor }}">{{ context.name }}!</font>
{% else %}
    hi, {{ context.name }}
{% endif %}

I have narrowed down the methodology to seq2seq and written a small program referencing various blog posts and tutorials.

But I am facing trouble keeping the text sequence.

How do I train it such that, it only needs to worry about stuff inside {} and can just copy paste everything else as is?

Upvotes: 1

Views: 24

Answers (0)

Related Questions