For the sorbet, place the sugar, water and basil into a saucepan over a high heat. Bring to a boil and boil until the sugar has dissolved.
Remove from the heat and leave to cool slightly before pouring the basil syrup into a food blender. Blend to a smooth consistency then pass through a sieve into a clean bowl using the back of a spoon to push the mixture through.
Pour through a second sieve, lined with a piece of clean muslin or a clean kitchen cloth, into a clean bowl. Leave to cool.
Once the mixture has cooled completely, transfer to an ice cream machine and churn until just frozen according to the manufacturer's instuctions. Transfer to a bowl and freeze until solid.
Preheat the oven to 220C/428F/Gas 7.
For the basil cream, place the milk and basil into a saucepan and bring to the boil.
Place the egg yolks, sugar and cornflour into a bowl and whisk to combine. Pour the hot milk onto the egg mixture and whisk until smooth.
Return the mixture to the saucepan and cook over a gentle heat, stirring continuously, for 1-2 minutes, or until thick enough to hold its shape. Leave to cool.
Meanwhile, for the tart, cut the pastry into four 13cm/5in squares and place onto a baking sheet. Brush the pastry with the beaten egg yolk. Use a sharp knife to score a line 1cm/0.5in in from the edge of the pastry, all the way round the squares, taking care not to cut all the way through (this will rise to create a crust around the edge when cooked).
Divide the cooled basil cream evenly among each of the four pastry squares, spreading it gently up to the scored edges.
Arrange the blackberries in rows over the top of the cream, scatter over the flaked almonds and transfer to the oven. Bake for 15-20 minutes, or until the pastry is crisp and golden-brown.
To serve, place each tart on a serving plate and top each one with a ball of sorbet. Garnish with a sprig of basil.