Portuguese variety identification: The bitter lesson

Given some text in Portuguese, how easy is it to determine if it's from Brazil or Portugal 1 ? For native speakers, this is pretty easy – it's almost a feeling. But for machines: not so much. This might seem like a useless problem at first. But in the age of language …