Page layout method and apparatus
Abstract
A page layout method includes obtaining page information, element information of at least one page element to be laid out, and a layout rule; obtaining at least one candidate page layout policy based on the page information, the element information, and the layout rule using a reinforcement learning algorithm; and determining a target page layout policy from the at least one candidate page layout policy using an imitation learning algorithm.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 6 · Forward citations: 0.
Claims (8)
- Claim 1Independent Claim
A method comprising: obtaining page information, first element information of at least one page element to be laid out, and a layout rule; obtaining at least one candidate page layout policy based on the page information, the first element information, and the layout rule using a reinforcement learning algorithm; and determining a target page layout policy from the at least one candidate page layout policy using an imitation learning algorithm by: pre-training an imitation learner to obtain a reward function, wherein the reward function is based on a ranking loss of a positive sample and a negative sample used for training the imitation learner, and wherein the positive sample comprises a page layout policy conforming to user aesthetics; determining a score of each candidate page layout policy based on the reward function; and determining the target page layout policy based on the score.
- Claim 2Depends on #1
The method of claim 1, wherein the layout rule comprises a first-priority layout rule and a second-priority layout rule, wherein the at least one candidate page layout policy meets the first-priority layout rule, and wherein the method further comprises obtaining a reward, under a constraint of the second-priority layout rule, that is greater than a preset reward threshold.
- Claim 3Depends on #1
The method of claim 1, further comprising: step 1: laying out, on a page according to the layout rule based on the page information and second element information of a first page element to be laid out, the first page element and generating a page status of the page; step 2: determining, according to the layout rule based on the page status and third element information of a next page element to be laid out, a layout location of the next page element; step 3: determining a first reward value corresponding to the page status and the layout location and updating the page status; iterating step 2 and step 3 until the at least one page element to be laid out is laid out on the page and a first page layout policy is generated; and accumulating the first reward value determined in each iteration to obtain an accumulated reward value and setting a second page layout policy of a plurality of first page layout policies for which the accumulated reward value meets a preset condition as the at le
- Claim 4Depends on #3
The method of claim 3, wherein iterating step 2 and step 3 until the at least one page element is laid out on the page and the first page layout policy is generated comprises: calculating a current accumulated reward value of a second reward value corresponding to each page status and each layout location in an iteration process and determining a policy merit of a current page layout policy based on the current accumulated reward value; determining that the policy merit is not less than a preset merit threshold; and continuing, in response to determining that the policy merit is not less than the preset merit threshold, to iterate step 2 and step 3 until the at least one page element to be laid out is laid out on the page and the first page layout policy is generated.
- Claim 5Depends on #1
The method of claim 1, further comprising applying the target page layout policy to a page.
- Claim 6Depends on #1
The method of claim 1, wherein after determining the target page layout policy, the method further comprises: sending the target page layout policy; receiving an adjustment made by a user on the target page layout policy; setting an adjusted target page layout policy as the positive sample for training the imitation learner; and training the imitation learner to obtain an optimized reward function.
- Claim 7Depends on #1
The method of claim 1, wherein obtaining the page information, the element information, and the layout rule comprises receiving the page information, the first element information, and the layout rule from a user in a user interface.
- Claim 8Independent Claim
A computing device comprising: a memory configured to store instructions; and a processor coupled to the memory and configured to execute the instructions to cause the computing device to: obtain page information, first element information of at least one page element to be laid out, and a layout rule; obtain at least one candidate page layout policy based on the page information, the first element information, and the layout rule using a reinforcement learning algorithm; and determine a target page layout policy from the at least one candidate page layout policy using an imitation learning algorithm by: pre-training an imitation learner to obtain a reward function, wherein the reward function is based on a ranking loss of a positive sample and a negative sample used for training the imitation learner, and wherein the positive sample comprises a page layout policy conforming to user aesthetics; determining a score of each candidate page layout policy based on the reward function; and d
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS This is a continuation of International Patent Application PCT/CN2021/127122 filed on Oct. 28, 2021, which claims priority to Chinese Patent Application No. 202110118584.2 filed on Jan. 28, 2021. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This disclosure relates to the field of artificial intelligence (AI) technologies, and in particular, to a page layout method and apparatus. BACKGROUND A page layout is a core of design work, and is also most time-consuming work for designers in a process of making pages. The page layout requires deploying page elements of different quantities, shapes, and sizes on a limited page. In addition, some specific rules and aesthetics need to be met between page elements and pages, and between page elements. In recent years, with development of artificial intelligence technologies, development of the page layout gradually focus on using machine learning to replace manual work. An automatic layout is to use computer technologies to replace human designers for a page layout, and use artificial intelligence technologies to meet requirements of the page layout. Generally, operation of trained staff is not required for the automatic layout, so that labor consumption and training time of the designers can be greatly reduced and saved. In a related technology, a plurality of page elements may be deployed on a canvas in a random layout mode. A laid-out page is converted into image data, then the image data is scored by using an evaluation model, and finally a page layout with a high score may be selected by a user. It can be learned from a mode of automatically generating a page layout in the related technology that it is difficult to generate a page conforming to a rule in the random layout mode. Particularly, with an increase in a quantity of page elements, and a page size, it is easy to generate a page layout that does not
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (6)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (5)
- Sou Tabata et al,
- “
- Automatic Layout Generation for Graphical Design Magazines,
- ”
- SIGGRAPH 19 Posters, Jul. 28-Aug. 1, 2019, Los Angeles, CA, USA Sou Tabata, Hiroki Yoshihara, Haruka Maeda, and Kei Yokoyama, total 2 pages.