public class UIMAWordSyntacticProbabilityModel extends Object implements SyntacticProbabilityModel
Modifier and Type | Field and Description |
---|---|
static int |
APPROXCHARSPERWORD
We approximate the number of chars per word with 7 (to be somewhat sure) to give a rough
approximation of what region this Model is considering effectively.
|
int |
paragraphMalus
We punish if both Annotations are not in the same paragraph.
|
int |
sentenceMalus
We punish if both Annotations are not in the same sentence.
|
Constructor and Description |
---|
UIMAWordSyntacticProbabilityModel(double sigma,
org.apache.uima.jcas.JCas jcas) |
UIMAWordSyntacticProbabilityModel(org.apache.uima.jcas.JCas jcas) |
Modifier and Type | Method and Description |
---|---|
double |
calculateNormalDistribution(double input)
Calculates not the actual normal distribution N(input|0,sigma) / N(0|0,sigma)
|
double |
calculateSyntacticProbability(AnnotationCandidate a,
AnnotationCandidate b)
Returns the probability that two given AnnotationCandidates belong
together from a syntactic perspective.
|
<X extends org.apache.uima.jcas.tcas.Annotation> |
getDistanceInCoveringClass(Class<X> annotationClass,
org.apache.uima.jcas.JCas jcas,
AnnotationCandidate first,
AnnotationCandidate snd)
This calculates the distance of two annotations counted in the instance of the given Class.
|
int |
getMaximumCharBasedRange()
Returns a heuristic approximation which region of the text should be
considered at all from a syntactic perspective.
|
int |
getParagraphMalus() |
int |
getSentenceMalus() |
double |
getSigma() |
void |
setParagraphMalus(int paragraphMalus) |
void |
setSentenceMalus(int sentenceMalus) |
void |
setSigma(double sigma) |
public int sentenceMalus
public int paragraphMalus
public static final int APPROXCHARSPERWORD
public UIMAWordSyntacticProbabilityModel(org.apache.uima.jcas.JCas jcas)
public UIMAWordSyntacticProbabilityModel(double sigma, org.apache.uima.jcas.JCas jcas)
sigma
- Sigma determines after how many words distance the syntactic
probability is reduced to 63%.public void setSigma(double sigma)
sigma
- Sigma determines after how many words distance the syntactic
probability is reduced to 63%.public double getSigma()
public int getSentenceMalus()
public void setSentenceMalus(int sentenceMalus)
sentenceMalus
- a number specifying how many words are added to the distance if a
sentence boundary is in the way.public int getParagraphMalus()
public void setParagraphMalus(int paragraphMalus)
paragraphMalus
- a number specifying how many words are added to the distance if a
paragraph boundary is in the way.public double calculateNormalDistribution(double input)
input
- the input for the density function.public double calculateSyntacticProbability(AnnotationCandidate a, AnnotationCandidate b)
calculateSyntacticProbability
in interface SyntacticProbabilityModel
a
- the first candidate.b
- the second candidate.public <X extends org.apache.uima.jcas.tcas.Annotation> int getDistanceInCoveringClass(Class<X> annotationClass, org.apache.uima.jcas.JCas jcas, AnnotationCandidate first, AnnotationCandidate snd)
X
- annotationClass
- jcas
- first
- snd
- public int getMaximumCharBasedRange()
getMaximumCharBasedRange
in interface SyntacticProbabilityModel
Copyright (C) 2013, 2014 Raphael Dickfelder, Jan Göpfert, Benjamin Paassen, Andreas Stöckel, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/scie