Branches visualize the structures and sub-decisions in your statements in the Write tab of the NLG platform. Branches facilitate formulating statements in more variable ways and arranging their components according to given requirements.
When writing a statement, you can branch off at different points in the statement to provide more than one way to express its information. Use branching to create branches that span one or more words, phrases or even whole statements.
- Branches appear one below the other in the Write Tab, so you can keep track of your construction. At each branching, you can specify different modes of deciding which branch to render.
- You can copy and paste branches as well as change the order of the branches by drag and drop.
- You can create branches at any point in a statement. This means you can also create (sub)-branches within a branch and within a container (see the warning below).
If you create branches within a container, they are not visible in the statement, but only in the container settings.
Settings for Branches
You create branches in the Write Tab by marking those parts of a statement that should have more than one variant and clicking on the branching icon. With this marking, you define the starting and ending point for a branch: a point where the statements will split into one or more branches (a branching) and the point where the branches come together again.
For each branching you can define the conditions under which this branch should appear:
- Select the corresponding trigger variable you created in the Transform Tab.
- Set the weight for a branch that defines the frequency of appearance. Depending on the specification of the weight, the probability that the branch is triggered increases or decreases. You can only set the weight for a branch if you have chosen random in the settings for branchings (see below)
- In the general settings of each container you can switch on or off the function that a **branch will be skipped if the container is empty.
The default setting for branches weight is 1. With this, the probability of being rendered is the same for all branches.
If you set n as weight, the software acts as if this branch had been duplicated n times.
Example: You have three branches: a has weight 1, b weight 2, c weight 3. Now the software randomly selects one branch out of 6: 1*a + 2*b + 3*c.
If you set weight to 0 or a negative number, the branch will not be rendered (its branch icon turns red).
Settings for Branchings
Click on the Branching Symbol to open the settings of the branching in the right panel, where you can define the mode of processing the associated branches:
- first: The first valid branch will be chosen.
- random: The branches are chosen randomly from the pool of valid branches.
- text shortening: With this switch, you specify whether or not this branching can be skipped in case the maximum text length is exceeded.