Typically for sequence tagging, I define a function

    features(words, idx)

that is called for each `i in xrange(len(words))` but gets the full sequence so it can extract global/context features.