The function f(x) appears to be a sentiment analysis function that assigns a value between 0 and 1