lingscope.drivers
Class SentenceTagger

java.lang.Object
  extended by lingscope.drivers.SentenceTagger

public class SentenceTagger
extends java.lang.Object

Tags scope or cue in a single sentence


Field Summary
static java.lang.String CUE_INTER
           
static java.lang.String CUE_START
           
static java.lang.String OTHER
           
static java.lang.String SCOPE_INTER
           
static java.lang.String SCOPE_START
           
 
Constructor Summary
SentenceTagger()
           
 
Method Summary
static java.util.List<AnnotatedSentence> annotateSentences(Annotator annotator, java.util.List<java.lang.String> inputSentences, boolean isTokenized)
           
static Annotator getAnnotator(java.lang.String classifierType, java.lang.String markType)
          Gets the Annotator from the given classifier and mark type
static java.util.List<java.lang.String> getStringList(java.lang.String inputFile, boolean isAnnotated)
          Gets the list of sentences in string format from the given inputFile.
static java.util.List<java.lang.String> getStringListFromAnnotatedSentences(java.util.List<AnnotatedSentence> annotatedSentences)
          Given a list of annotated sentences, return a list where the annotated sentences are replaced with strings
static void main(java.lang.String[] args)
           
static AnnotatedSentence tag(Annotator annotator, java.lang.String sentence, boolean isTokenized)
          Tags the given sentence with the given annotator
static void usage()
          Prints the usage for the sentence tagger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUE_START

public static final java.lang.String CUE_START
See Also:
Constant Field Values

CUE_INTER

public static final java.lang.String CUE_INTER
See Also:
Constant Field Values

SCOPE_START

public static final java.lang.String SCOPE_START
See Also:
Constant Field Values

SCOPE_INTER

public static final java.lang.String SCOPE_INTER
See Also:
Constant Field Values

OTHER

public static final java.lang.String OTHER
See Also:
Constant Field Values
Constructor Detail

SentenceTagger

public SentenceTagger()
Method Detail

tag

public static AnnotatedSentence tag(Annotator annotator,
                                    java.lang.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 java.util.List<java.lang.String> getStringListFromAnnotatedSentences(java.util.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 java.util.List<AnnotatedSentence> annotateSentences(Annotator annotator,
                                                                  java.util.List<java.lang.String> inputSentences,
                                                                  boolean isTokenized)

getStringList

public static java.util.List<java.lang.String> getStringList(java.lang.String inputFile,
                                                             boolean isAnnotated)
Gets the list of sentences in string format from the given inputFile.

Parameters:
inputFile - the file containing input sentences
isAnnotated - 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(java.lang.String classifierType,
                                     java.lang.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(java.lang.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