Under the first-order expectation semiring E R,R n , the inside algorithm of Figure 2 will return Z, r where r is a vector of n feature expectations.
eisner (2002, section 5) observes that this is inefficient when n is large.