============== Use SVM Perf ============== This page describes a procedure that enables `SVM Perf `_ classifier (svm_perf_classify) to be used with RaSC. SVM Perf must be changed at a program level to perform input and output through file (the changes are described with CRF++ as an example in :ref:`faq_modify_program`). The following describes a procedure to change the program by applying a patch to it so that SVM Perf may be used as an RaSC service. First, get the SVM Perf source code. .. code-block:: bash $ wget http://download.joachims.org/svm_perf/current/svm_perf.tar.gz $ mkdir svm_perf $ tar zxvf svm_perf.tar.gz -C svm_perf Create new files necessary to apply a patch. .. code-block:: bash $ touch svm_perf/svm_light/svm_classify_stdin.c $ touch svm_perf/svm_struct/svm_struct_classify_stdin.c Then, get the patch file. .. code-block:: bash $ wget https://alaginrc.nict.go.jp/rasc/resources/patch_rasc_svm_perf.diff Then, apply the patch. .. code-block:: bash $ patch -p0 < patch_rasc_svm_perf.diff Then, build SVM Perf. .. code-block:: bash $ cd svm_perf $ ./configure $ make These commands produce the executable binary svm_perf_classify_stdin, which has been modified so that it can be used with RaSC. In a service definition XML, describe a start command line that includes the path to and the model file of the executable binary (you can download :download:`service XML `).Modify ``___SVM_PERF_DIR___`` and ``___PATH_TO_MODEL_FILE___`` to the directory that actually includes ``svm_perf_classify_stdin`` and the path to the model file. .. code-block:: xml :emphasize-lines: 8-10 - For ``cmdLine``, specify the path to SVM that was created before by applying the patch, and the model file to be read in. - For ``delimiterIn``, describe ``\n[END_OF_INPUT]\n`` because the patch has been applied to set the input delimiting character string to ``[END_OF_INPUT]``. - Similarly, for delimiterOut, describe ``EOS\n`` because the patch has been applied to set the output delimiting character string to ``EOS\n``. - Within the program, ``\n`` in this example will be replaced with an appropriate linefeed code suitable for each system. For information on the procedure to start the service, refer to :doc:`rasc_core` or :doc:`rasc_basic`.