Package io.outofprintmagazine.nlp
Class App
- java.lang.Object
-
- io.outofprintmagazine.nlp.App
-
public class App extends Object
The main cli entry point for oopcorenlp.
To get the sample output run:
java -jar oopcorenlp-1.0.jar -a generate
java -Xms8096m -Xmx10120m -jar oopcorenlp-1.0.jar -a analyze
To get custom output, generate, tweak, analyze.
Annotator order is important. Try commenting out existing lines rather than editing.
Copy output files to oopcorenlp_web WebContent/Corpora/corpus/ directory and build/deploy to view results.
usage: oopcorenlp -a,--action REQUIRED. analyze or generate. analyze requires all parameters. generate requires outputPath. -h,--help print usage -i,--inputPath Location for input files (.). -m,--metadata Name of metadata file in Properties format (metadata.properties). -n,--annotators Name of annotator list file in text format (annotators.txt). -o,--outputPath Location for output files (.). -p,--parameterStore Name of parameterStore file in Properties format (parameterStore.properties). -s,--story Name of story file in text format (story.txt). Ascii character set, vertical double quote for quotations, vertical single quote for apostrophe, block paragraphs.
NB: Needs a lot of memory to run. -Xms8096m -Xmx10120m at a minimum.
- Author:
- Ram Sadasiv
- See Also:
Analyzer
-
-
Constructor Summary
Constructors Constructor Description App()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateTemplates(String outputPath)protected io.outofprintmagazine.util.IParameterStoreloadParameterStore(String path, String fileName)protected PropertiesloadProperties(String path, String fileName)static voidmain(String[] args)voidrunAnalyzer(io.outofprintmagazine.util.IParameterStore parameterStore, List<String> customAnnotators, Properties metadata, String text, String outputPath)protected voidwriteOutput(String outputPath, Properties metadata, String document, Map<String,com.fasterxml.jackson.databind.node.ObjectNode> json)
-
-
-
Method Detail
-
main
public static void main(String[] args) throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException, org.apache.commons.cli.ParseException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
- Throws:
IOExceptionInstantiationExceptionIllegalAccessExceptionClassNotFoundExceptionorg.apache.commons.cli.ParseExceptionIllegalArgumentExceptionInvocationTargetExceptionNoSuchMethodExceptionSecurityException
-
generateTemplates
public void generateTemplates(String outputPath) throws IOException
- Throws:
IOException
-
runAnalyzer
public void runAnalyzer(io.outofprintmagazine.util.IParameterStore parameterStore, List<String> customAnnotators, Properties metadata, String text, String outputPath) throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
-
writeOutput
protected void writeOutput(String outputPath, Properties metadata, String document, Map<String,com.fasterxml.jackson.databind.node.ObjectNode> json) throws IOException
- Throws:
IOException
-
loadParameterStore
protected io.outofprintmagazine.util.IParameterStore loadParameterStore(String path, String fileName) throws IOException
- Throws:
IOException
-
loadProperties
protected Properties loadProperties(String path, String fileName) throws IOException
- Throws:
IOException
-
-