A woman from Scotland was “astonished” when artificial intelligence software added profanity and asked her questions of the sexual variety in a voicemail.

Louise Littlejohn, 66, of Dunfermline in Fife, Scotland, received the message on March 5 from the Lookers Land Rover garage in Motherwell, who were inviting the woman to an event, BBC News reported.

Apple’s AI-powered voice-to-text transcription service bungled the translation, asking Littlejohn if she was “able to have sex” — then it called her a “piece of s***.”

Littlejohn initially thought it was a scam but she remembered the zip code of the garage and recalled buying a vehicle there a few years back.

“The garage is trying to sell cars, and instead of that they are leaving insulting messages without even being aware of it,” she said.

“It is not their fault at all.”

One tech expert told the outlet that the AI software may have mis-translated the message due to the caller’s Scottish accent, but other likely factors include background noise at the garage and the fact that he was reading off a script.

“All of those factors contribute to the system doing badly. The bigger question is why it outputs that kind of content,” said speech technology professor Peter Bell, of the University of Edinburgh.

RECOMMENDED VIDEO

“If you are producing a speech-to-text system that is being used by the public, you would think you would have safeguards for that kind of thing.”

The BBC listened to the voicemail left for Littlejohn and described it as “so jumbled it’s hard to decipher where it went wrong,” but noted the “sex” reference may have come when the caller mentioned the “sixth” of March.

That said, while many people might have been appalled by the raunchy message, the Scotswoman took it in stride.

“Initially I was shocked — astonished — but then I thought, ‘That is so funny.’ The text was obviously quite inappropriate.”