info.ephyra.nlp
Class StanfordNeTagger

java.lang.Object
  extended by info.ephyra.nlp.StanfordNeTagger

public class StanfordNeTagger
extends java.lang.Object

Wrapper for the Stanford named entity recognizer.

Version:
2008-02-10
Author:
Guido Sautter, Nico Schlaefer

Field Summary
private static edu.stanford.nlp.ie.AbstractSequenceClassifier classifier
           
private static java.lang.String defaultSerializedClassifier
           
private static java.lang.String serializedClassifier
           
 
Constructor Summary
StanfordNeTagger()
           
 
Method Summary
static java.util.HashMap<java.lang.String,java.lang.String[]> extractNEs(java.lang.String sentence)
          Extracts NEs from an individual sentence.
static java.util.HashMap<java.lang.String,java.lang.String[][]> extractNEs(java.lang.String[] sentences)
          Extracts NEs from an array of sentences.
static java.lang.String getCurrentClassifier()
          Gets the path of the current serialized classifier.
static boolean init()
          Initializes the StanfordNeTagger (loads the model).
static boolean init(java.lang.String customSerializedClassifier)
          Initializes the StanfordNeTagger with a custom model.
static boolean isInitialized()
          Checks whether the model for the StanfordNeTagger has been loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classifier

private static edu.stanford.nlp.ie.AbstractSequenceClassifier classifier

defaultSerializedClassifier

private static java.lang.String defaultSerializedClassifier

serializedClassifier

private static java.lang.String serializedClassifier
Constructor Detail

StanfordNeTagger

public StanfordNeTagger()
Method Detail

isInitialized

public static boolean isInitialized()
Checks whether the model for the StanfordNeTagger has been loaded.

Returns:
true iff the StanfordNeTagger is initialized

init

public static boolean init()
Initializes the StanfordNeTagger (loads the model).


getCurrentClassifier

public static java.lang.String getCurrentClassifier()
Gets the path of the current serialized classifier.

Returns:
path of the serializedClassifier

init

public static boolean init(java.lang.String customSerializedClassifier)
Initializes the StanfordNeTagger with a custom model.

Parameters:
customSerializedClassifier - path of the custom classifier to load

extractNEs

public static java.util.HashMap<java.lang.String,java.lang.String[][]> extractNEs(java.lang.String[] sentences)
Extracts NEs from an array of sentences.

Parameters:
sentences - array of sentences
Returns:
NEs per sentence and NE type, using a HashMap since the types might change with the model

extractNEs

public static java.util.HashMap<java.lang.String,java.lang.String[]> extractNEs(java.lang.String sentence)
Extracts NEs from an individual sentence. Initializes the StanfordNeTagger if not done before.

Parameters:
sentence - the sentence
Returns:
NEs per NE type, using a HashMap since the types might change with the model