Use of CRF ++ in Linux

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.