Algorithm-CRF

 view release on metacpan or  search on metacpan

CRF.xs  view on Meta::CPAN

	size_t freq
	double eta
	double C
	unsigned short thread_num
	unsigned short shrinking_size
	int algorithm
	bool convert
    CODE:
CRFPP::Encoder encoder;
    if (thread_num > 1024)
	fprintf (stderr,"#thread is too big\n",encoder.what());
    if (convert) {
	if (! encoder.convert(templfile, trainfile)) {
	    //cerr << encoder.what() << endl;
	    fprintf (stderr,"%s\n",encoder.what());
	    RETVAL = -1;
	}
    } else {
	if (! encoder.learn ( templfile, 
	trainfile, 
	modelfile, 
	textmodelfile, 
	maxitr, 
	freq, 
	eta, 
	C, 
	thread_num,
        shrinking_size,
	algorithm )) {
	    //	cerr << encoder.what() << endl;
	    fprintf (stderr,"%s\n",encoder.what());
	    RETVAL = -1;
	} else
	    RETVAL = 0;
    }
    OUTPUT:
	RETVAL



( run in 1.126 second using v1.01-cache-2.11-cpan-49f99fa48dc )