updated term_sentiment.py

defined all the methods and main function code