C # calls the CRFs application

Source: Internet
Author: User

Today I want to call CRFs in C #, but the old problem. There are several reasons. First, I do not understand the CRF, although I ran with a cmd, but do not understand why, and just a cursory look at the next parameter to enter what, just understand the form, no understanding of the substance. So at the time of the call, I don't know how to transfer the input and output parameters. In addition, Crf_learn in the CMD run time, the use of a self-brought DLL file I do not know how to deal with. And I can't find an example of a similar call on the Internet. Second, not familiar with the instance code found, do not understand the meaning and function of each line of code. Third, do not know how to output the result, will not be the appropriate breakpoint.

After a classmate's help, he helped me to solve the problem. The final run was successful.

Console.WriteLine ("AAAAA"); For test output
System.Diagnostics.Process p = new System.Diagnostics.Process (); Start System process
P.startinfo = new System.Diagnostics.ProcessStartInfo (@ "C:\Users\AMY\Desktop\test\crf_learn.exe"); Application path
P.startinfo.arguments = @ "C:\Users\AMY\Desktop\test\template C:\Users\AMY\Desktop\test\train.data C:\Users\AMY\ Desktop\test\model "; Parameter input
P.startinfo.redirectstandardoutput = true; Result output
P.startinfo.useshellexecute = false; Whether to display in the shell
P.start ();
p.WaitForExit ();
Console.WriteLine ("nnnn");
Console.readkey ();

C # calls the CRFs application

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.