The structure function of semi-inclusive heavy flavour decays in field theory