Such analysis can be done on various levels -global (collection of text), sentence-level (where sentiment is assigned to one full sentence) or aspect-based.
cRFSUITE (Okazaki, 2007) is used to build a cRF classifier in python.