Branches are visual representations of 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 have the possibility to branch off at different points (so called branchings) in a statement to create more than one way to express the information. For this you can create branches that span one or more words, phrases, or entire statements.
The branches appear one below the other in the Write Tab, so you can keep track of your construction. For each branch you can specify in the branchings 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 the statements. This means you can create also (sub)-branches within a branch and also within a container.
If you create branches within a container, they are not visible in the statement, but only in the container settings.
# The settings for branches
You create branches in the Write Tab by marking these 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 ore more branches (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 branch weight is 1. With this setting 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 the weight 1, b the weight 2, c the weight 3. Now the software randomly gets one branch out of 6: 1*a, 2*b, 3*c.
If you set 0 (or a negative number) as a weight, the branch will not be rendered (the branch icon turns red).
# The settings for branchings
When you click on the Branching Symbol you 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 this branching can be skipped or not in case the maximum text length is exceeded.