As we see here, to build an NER model we can pass text features (parts of the word, pos tag, structure of the word etc.) to Sklearn-CRF. I was wondering how does this package convert the text features to numerical features? What strategy do they use - any specific type of embedding?
CRF models are not DL models, they use text features in the traditional way as categorical data (equivalent to one-hot-encoding). However they are different from other supervised ML methods because they exploit the sequential information of the text.
Typically the text sequence is represented word by word, and each word can have several additional "features" usually represented as columns. For example:
The DET the dog NOUN dog chases VERB chase a DET a cat NOUN cat
The real features used by the CRF are computed based on the rules defined before training the model. They can involve the position of the current word or any other position relative to the current one. The features are usually simple binary values, for examples "doc[n-1] == 'DET'" would represent the condition "the previous word is a determiner": "previous word" is indicated as n-1 in the sequence, column 2 indicates the POS column. The exact syntax to specify the rules may differ with different CRF implementations but the principle is the same.