Search code examples
crf++

Bag-of-words in CRF++


What is the syntax for a bag-of-words feature in CRF++ template file?

Template example:

#Unigrams
U00:%x[0,0]
U01:%x[0,1]
U02:%x[1,0]

#Bigrams
B

Solution

  • I think it is this way:

    #Unigrams
    U00:%x[0,0]
    U00:%x[0,1]
    U00:%x[1,0]
    
    #Bigrams
    B
    

    Using the same identifier.