This page describes a procedure that enables TinySVM to be used with RaSC. TinySVM must be changed at the program level to perform input and output through file (for the changes, refer to ref:faq_modify_program).
The following describes a procedure to change the program by applying a patch to it so that TinySVM may be used as an RaSC service.
First, get the TinySVM source code.
$ wget http://chasen.org/~taku/software/TinySVM/src/TinySVM-0.09.tar.gz
$ tar zxvf TinySVM-0.09.tar.gz
Then, get the patch file.
$ wget https://alaginrc.nict.go.jp/rasc/resources/patch_rasc_TinySVM.diff
Then, apply the patch.
$ patch -p0 < patch_rasc_TinySVM.diff
Then, build.
$ cd TinySVM-0.09
$ ./configure
$ make
These commands produce the executable binary svm_classify, 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 the service XML).Modify ___BASE_DIR___ and ___PATH_TO_MODEL_FILE___ to the directory that actually includes svm_classify and the path to the model file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="target"
class="jp.go.nict.langrid.servicecontainer.handler.TargetServiceFactory">
<property name="service">
<bean class="jp.go.nict.wisdom.wrapper.StdIOCommandService">
<property name="cmdLine" value="___BASE_DIR___/src/svm_classify -V - ___PATH_TO_MODEL_FILE___" />
<property name="delimiterIn" value="\n[END_OF_INPUT]\n" />
<property name="delimiterOut" value="EOS\n" />
<property name="delLastNewline" value="true" />
</bean>
</property>
</bean>
</beans>
For information on the procedure to start the service, refer to Run a user program as a RaSC service or Work with various network protocols.