Run GATE pipeline from inside a Java program without the GUI. build a tomcat app with gate

我只是一个虾纸丫 提交于 2019-12-20 10:55:40

问题


i have built some plugin components to GATE and in combination with ANNIE tools, im running a pipeline in GATE platform.

Does anyone know how can i run a pipeline from the console? I want to build a web application in Tomcat that will be taking a plain text from the web page, passing it to the GATE pipeline i have built and do something. So i need to run GATE in a simple Java file, how can it be done?

Thanks in advance and sorry for my poor grammar


回答1:


The GATE example code shows you how to run GATE in a number of different ways, in particular the Goldfish example illustrates how to run GATE from the command line.




回答2:


First download GATE, it's like 320mb or something. Then if you use netbeans, you can add GATE to your by going to project -> Library -> right click add jar files and browse to GATE installation file and choose all JAR files inside lib folder. Once all jar file are there you can use GATE. (See GATE chapter.7 GATE Embedded).

A simple example is to use ANNIE, there is standAloneAnnie where you only need to pass a file and it will process it for you.

http://gate.ac.uk/wiki/code-repository/src/sheffield/examples/StandAloneAnnie.java

Once you add ANNIE to your project, you can use it by calling it's main method/you can change it's name later, and pass a File array as a parameter. The file array should contain the file you want to process.




回答3:


You need to use GATE EMBEDDED.

Look at here: http://gate.ac.uk/family/embedded.html
here: http://gate.ac.uk/sale/tao/splitch7.html#x11-1540007
take care with multi-thread issues (look multi-thread part): gate.ac.uk/sale/tao/splitch7.html#x11-1730007.13



来源:https://stackoverflow.com/questions/2171469/run-gate-pipeline-from-inside-a-java-program-without-the-gui-build-a-tomcat-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!