Use of CRF ++ in Linux
The slave node stops working. As a result, the slave node is switched to the server for training. However, there is also a problem. It may be because the files in Windows are slightly different in Linux, so an error is reported during running, as shown below:
Encoder. cpp (340) [feature_index.open (templfile, trainfile)] feature_index.cpp (174) [max_size = size] inconsistent column size: 3 1 train404pos11.txt
I also tried to replace the line break "\ r \ n" in the Windows file with "\ r", but still reported an error. After trying several other methods, there was still no result. I suddenly remembered that there was an example folder in the CRF ++ package, and I put the example train in. copy data to Windows and compare it with my own files. use Notepad ++ to open these two files, "View"-"display symbol"-"display line tail character", the problem is displayed, such:
My training corpus
CRF ++ example File
How can I Replace "CRLF" in my document with "LF? On the Internet, I found the answer: "edit"-"convert file format"-"convert to unix format". Finally, the format of the sample file is consistent with that of the sample file. Then I went to the server to test the effect, the problem was solved and the training was successful.
TIPS: If you select mac format, only CR is available. If you select Windows format, all are available. The new document should be in Windows format by default.
This article permanently updates the link address: