Automatic justification enhancement with minimal content editing
AssigneeAdobe Inc.
InventorsAshish Jain, Arushi Jain
Life of this patent
Estimating the term…
Abstract
A system and methods for text processing include determining a penalty value for a line of a text in a digital document applied with a justification setting. The penalty value indicates a level of typography violation based on the justification setting. The system and methods further include selecting an alternative phrase from multiple alternative phrases for an original phrase in the line based on the penalty value for the line. The system and methods also include modifying the line by using the selected alternative phrase to create a modified text. The modified text can be displayed in a graphical user interface (GUI) to a user.
Claims18
A method performed by one or more processing devices, comprising:
- determining a penalty value for a line of a text in a digital document applied with a justification setting, wherein the penalty value indicates a level of typography violation based on the justification setting;
- determining, based on determining the penalty value for the line is greater than a threshold value, a number of characters that can be changed for the line to reduce the penalty value for the line to be equal to or less than the threshold value;
- creating a map comprising penalty values for the line and corresponding numbers of characters with a nature of change to the line;
- executing a natural language processing algorithm to generate a plurality of alternative phrases for an original phrase;
- selecting one or more candidate phrases from the plurality of alternative phrases to replace the original phrase, wherein each of the one or more candidate phrases causes the line to change by a first number of changed characters with the nature of change indicated in the map, wherein the first number of changed characters is closer to the number of characters in the map than a second number of changed characters that an unselected alternative phrase causes the line to change;
- determining one or more updated penalty values for the line with the one or more candidate phrases respectively;
- selecting an alternative phrase corresponding to a lowest penalty value among the one or more updated penalty values;
- modifying the line by using the alternative phrase to create a modified text;
- and
- causing the modified text to be displayed in a graphical user interface (GUI).
A system, comprising:
- a memory component;
- a processing device coupled to the memory component, the processing device to perform operations comprising:
- accessing a text in a digital document comprising a plurality of lines applied with a justification setting;
- determining a penalty value for each line of the plurality of lines of the text, wherein the penalty value indicates a level of typography violation based on the justification setting;
- determining, based on determining the penalty value for the line is greater than a threshold value, a number of characters that can be changed for the line to reduce the penalty value for the line to be equal to or less than the threshold value;
- creating a map comprising penalty values for the line and corresponding numbers of characters with a nature of change to the line;
- executing a natural language processing algorithm to generate a plurality of alternative phrases for an original phrase;
- selecting one or more candidate phrases from the plurality of alternative phrases to replace the original phrase, wherein each of the one or more candidate phrases causes the line to change by a first number of changed characters with the nature of change indicated in the map, wherein the first number of changed characters is closer to the number of characters in the map than a second number of changed characters that an unselected alternative phrase causes the line to change;
- determining one or more updated penalty values for the line with the one or more candidate phrases respectively;
- selecting a first alternative phrase corresponding to a lowest penalty value among the one or more updated penalty values;
- and
- modifying the line by using the alternative phrase to create a modified text.
A non-transitory computer-readable medium, storing executable instructions, which when executed by a processing device, cause the processing device to perform operations comprising:
- accessing a text in a digital document comprising a plurality of lines applied with a justification setting;
- determining a penalty value for each line of the plurality of lines of the text, wherein the penalty value indicates a level of typography violation based on the justification setting;
- determining, based on determining the penalty value for the line is greater than a threshold value, a number of characters that can be changed for the line to reduce the penalty value for the line to be equal to or less than the threshold value;
- creating a map comprising penalty values for the line and corresponding numbers of characters with a nature of change to the line;
- executing a natural language processing algorithm to generate a plurality of alternative phrases for a first original phrase;
- selecting one or more candidate phrases from the plurality of alternative phrases to replace the first original phrase, wherein each of the one or more candidate phrases causes the line to change by a first number of changed characters with the nature of change indicated in the map, wherein the first number of changed characters is closer to the number of characters in the map than a second number of changed characters that an unselected alternative phrase causes the line to change;
- determining one or more updated penalty values for the line with the one or more candidate phrases respectively;
- selecting the alternative phrase corresponding to a lowest penalty value among the one or more updated penalty values;
- and
- modifying the line by using the alternative phrase to create a first modified text;
- determining an updated penalty value for the first modified text;
- selecting a second alternative phrase for a second original phrase in the first modified text based on the updated penalty value, wherein the second original phrase is identified by keeping the alternative phrase in the first modified text unchanged;
- and
- modifying the first modified text by using the second alternative phrase to create a second modified text.
Dependencies are inferred from the claim text.