Skip to content

Commit

Permalink
Add corenlp.sh for preprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyfeng committed Sep 26, 2015
1 parent 830a583 commit a4855ef
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions corenlp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Runs Stanford CoreNLP.
# Simple uses for xml and plain text output to files are:
# ./corenlp.sh -file filename
# ./corenlp.sh -file filename -outputFormat text

scriptdir=`dirname $0`

# echo java -mx3g -cp \"$scriptdir/*\" edu.stanford.nlp.pipeline.StanfordCoreNLP $*

# $1 - path

PATH=$1
for FNAME in $PATH/*
do
/usr/bin/java -mx2g -cp "$scriptdir/*" edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse -ssplit.eolonly -tokenize.whitespace true -file $FNAME
# /usr/bin/java -mx2g -cp "$scriptdir/*" edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse -file $FNAME
/bin/mv $(/usr/bin/basename $FNAME.xml) $PATH/
done

0 comments on commit a4855ef

Please sign in to comment.