Scientists devise algorithm that detects sarcasm better than humans