Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about use custom text as input Parse-Then-Place #46

Open
ruick opened this issue Sep 28, 2024 · 1 comment
Open

Question about use custom text as input Parse-Then-Place #46

ruick opened this issue Sep 28, 2024 · 1 comment

Comments

@ruick
Copy link

ruick commented Sep 28, 2024

Thank you very much for your work!
May I ask if it is possible to use custom text as input for LayoutPromoter and Parse-Then-Place? It seems that the input must contain ir and elements, and I can only call inputs from the existing test.json file. Is there a way to input custom text directly?

@kaoshizhou
Copy link
Contributor

Hi @ruick,

We are pleased to share with you that it's possible to use custom text for Parse-Then-Place. Specifically, there are totally 4 steps that you can follow to accomplish this.

  1. Adapt the eval_split name in the script, maybe something like mydata.
  2. Create a new json file in the folder Parse-Then-Place/data/$dataset/stage2/finetune/mydata.json according to the split name you specified in step 1.
  3. Construct the sample based on your custom text in mydata.json. Below is an example:
[
    {
      "text": "a page for end user license agreement. on the top, there is a toolbar with a text button for the back on the left and a text in the middle. below is a text button for the end user license agreement. in the middle, there is a text occupying most of the page.",
      "region_id": "",
      "region_type": "",
      "ir": "[region:SingleInfo]",
      "execution": "",
      "layout_seq_with_completion": "",
      "layout_seq_without_completion": "",
      "plain_layout_seq": "",
      "canvas_width": 1440,
      "canvas_height": 2560
    }
]
  1. Test on your custom text using the same command in README! And please check your result in the folder tmp/output/$dataset/stage1/mydata_predictions.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants