|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.tools.sentdetect.SentenceDetectorME
public class SentenceDetectorME
A sentence detector for splitting up raw text into sentences.
A maximum entropy model is used to evaluate the characters ".", "!", and "?" in a string to determine if they signify the end of a sentence.
Field Summary | |
---|---|
static java.lang.String |
NO_SPLIT
Constant indicates no sentence split. |
static java.lang.String |
SPLIT
Constant indicates a sentence split. |
Constructor Summary | |
---|---|
SentenceDetectorME(SentenceModel model)
Initializes the current instance. |
|
SentenceDetectorME(SentenceModel model,
Factory factory)
|
Method Summary | |
---|---|
double[] |
getSentenceProbabilities()
Returns the probabilities associated with the most recent calls to sentDetect(). |
static void |
main(java.lang.String[] args)
Trains a new sentence detection model. |
java.lang.String[] |
sentDetect(java.lang.String s)
Detect sentences in a String. |
Span[] |
sentPosDetect(java.lang.String s)
Detect the position of the first words of sentences in a String. |
static SentenceModel |
train(java.lang.String languageCode,
ObjectStream<SentenceSample> samples,
boolean useTokenEnd,
Dictionary abbreviations)
|
static SentenceModel |
train(java.lang.String languageCode,
ObjectStream<SentenceSample> samples,
boolean useTokenEnd,
Dictionary abbreviations,
int cutoff,
int iterations)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SPLIT
public static final java.lang.String NO_SPLIT
Constructor Detail |
---|
public SentenceDetectorME(SentenceModel model)
model
- the SentenceModel
public SentenceDetectorME(SentenceModel model, Factory factory)
Method Detail |
---|
public java.lang.String[] sentDetect(java.lang.String s)
sentDetect
in interface SentenceDetector
s
- The string to be processed.
public Span[] sentPosDetect(java.lang.String s)
sentPosDetect
in interface SentenceDetector
s
- The string to be processed.
public double[] getSentenceProbabilities()
public static SentenceModel train(java.lang.String languageCode, ObjectStream<SentenceSample> samples, boolean useTokenEnd, Dictionary abbreviations) throws java.io.IOException
java.io.IOException
public static SentenceModel train(java.lang.String languageCode, ObjectStream<SentenceSample> samples, boolean useTokenEnd, Dictionary abbreviations, int cutoff, int iterations) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
Trains a new sentence detection model.
Usage: opennlp.tools.sentdetect.SentenceDetectorME data_file new_model_name (iterations cutoff)?
args
-
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |