Package lingscope.drivers
Class SentenceTagger
- java.lang.Object
-
- lingscope.drivers.SentenceTagger
-
public class SentenceTagger extends Object
Tags scope or cue in a single sentence- Author:
- shashank
-
-
Field Summary
Fields Modifier and Type Field Description static StringCUE_INTERstatic StringCUE_STARTstatic StringOTHERstatic StringSCOPE_INTERstatic StringSCOPE_START
-
Constructor Summary
Constructors Constructor Description SentenceTagger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<AnnotatedSentence>annotateSentences(Annotator annotator, List<String> inputSentences, boolean isTokenized)static AnnotatorgetAnnotator(String classifierType, String markType)Gets the Annotator from the given classifier and mark typestatic List<String>getStringList(String inputFile, boolean isAnnotated)Gets the list of sentences in string format from the given inputFile.static List<String>getStringListFromAnnotatedSentences(List<AnnotatedSentence> annotatedSentences)Given a list of annotated sentences, return a list where the annotated sentences are replaced with stringsstatic voidmain(String[] args)static AnnotatedSentencetag(Annotator annotator, String sentence, boolean isTokenized)Tags the given sentence with the given annotatorstatic voidusage()Prints the usage for the sentence tagger
-
-
-
Field Detail
-
CUE_START
public static final String CUE_START
- See Also:
- Constant Field Values
-
CUE_INTER
public static final String CUE_INTER
- See Also:
- Constant Field Values
-
SCOPE_START
public static final String SCOPE_START
- See Also:
- Constant Field Values
-
SCOPE_INTER
public static final String SCOPE_INTER
- See Also:
- Constant Field Values
-
OTHER
public static final String OTHER
- See Also:
- Constant Field Values
-
-
Method Detail
-
tag
public static AnnotatedSentence tag(Annotator annotator, String sentence, boolean isTokenized)
Tags the given sentence with the given annotator- Parameters:
annotator-sentence-isTokenized-- Returns:
-
usage
public static void usage()
Prints the usage for the sentence tagger
-
getStringListFromAnnotatedSentences
public static List<String> getStringListFromAnnotatedSentences(List<AnnotatedSentence> annotatedSentences)
Given a list of annotated sentences, return a list where the annotated sentences are replaced with strings- Parameters:
annotatedSentences-- Returns:
-
annotateSentences
public static List<AnnotatedSentence> annotateSentences(Annotator annotator, List<String> inputSentences, boolean isTokenized)
-
getStringList
public static List<String> getStringList(String inputFile, boolean isAnnotated)
Gets the list of sentences in string format from the given inputFile.- Parameters:
inputFile- the file containing input sentencesisAnnotated- set this as true if the input file contains annotated sentences. Set this as false if the input file contains only sentences as strings- Returns:
- the list of sentences in string format in the given inputFile
-
getAnnotator
public static Annotator getAnnotator(String classifierType, String markType)
Gets the Annotator from the given classifier and mark type- Parameters:
classifierType- such as "baseline", "crf", or "negex"markType-- Returns:
-
main
public static void main(String[] args)
- Parameters:
args- 0 - Annotator type ("cue" or "scope") 1 - Model type ("crf", "baseline" or "negex") 2 - Saved model file 3 - Sentence to tag
-
-