{'fraction_non_alphanumeric': 0.03723887375113533, 'fraction_numerical': 0.0, 'mean_word_length': 5.297142857142857, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Path-constrained Viterbi Algorithm: an Alternative to State-transition Feature for Conditional Random Fields

The state-transition feature that considers the transition between states is an important feature used in Conditional random fields (CRFs). However, integrating the state-transition feature into the CRF model always results in a long training time. It is believed that there is no study focusing on this problem. Therefore, this paper proposes a path-constrained Viterbi algorithm to substitute the use of the state-transition feature, where the core idea involves pruning the paths (or state transitions) that does not exist in real-world data in the Viterbi decoding process. The proposed method is simple but effective. The experimental results obtained for four natural language processing (NLP) tasks, i.e., Chinese word segmentation (CWS), Named Entity Recognition (NER), text chunking, and part-of-speech (POS) tagging, demonstrate that the proposed method achieved performance close to that using state-transition feature, and hence saving as much as half the training time in total.