Updated term_sentiment.py for problem 3