Provided you are under Linux, you could just write a bash script that takes your input file as argument, creates a temporary directory with "mktemp -d", "cp" the file into it, and then runs a Java class that calls org.apache.uima.examples.cpe.SimpleRunCPE on this temporary directory.
The init and class loading times will the same as before, as cTAKES needs to load its classes and models prior to any annotations. You might be more interested in running cTAKES behind a web service, but this depends on your use cases. Regards, Tomasz ________________________________________ From: Zuo Yiming [yiming...@gmail.com] Sent: Wednesday, December 07, 2016 1:44 PM To: u...@ctakes.apache.org; dev@ctakes.apache.org Subject: How to use cTAKES from command line to process only one file instead of all files in a directory? Hi guys, Is there any suggestion on using cTAKES to process one specific text file from command line? I was able to follow Tsung-Ting Kuo's post on stackoverflow as shown below to apply cTAKES in a batch mode to process all files in a folder from command line. But the initiation time and processing time are quite long, and all I need is to process one file submitted from user's side. So I think there should be something similar to org.apache.uima.examples.cpe.SimpleRunCPE to process only one file using cTAKES but get stuck and can't move on. Can anyone help me out? Tsung-Ting Kuo's post on stackoverflow: http://stackoverflow.com/questions/32939527/how-to-use-ctakes-from-the-command-line Best, Yiming -- Yiming Zuo <https://sites.google.com/site/yimingzuo/> Georgetown U. Medical Center: Dr. Ressom's Omics Lab <http://omics.georgetown.edu/> ECE Department of Virginia Tech: Computational Bioinformatics & Bio-imaging Laboratory <http://www.cbil.ece.vt.edu/>