Class AnnotationPositionInSectionC
- java.lang.Object
-
- edu.upf.taln.dri.module.rhetclassifier.feats.generator.AnnotationPositionInSectionC
-
- All Implemented Interfaces:
edu.upf.taln.ml.feat.base.FeatCalculator<Double,gate.Annotation,DocumentCtx>
public class AnnotationPositionInSectionC extends Object implements edu.upf.taln.ml.feat.base.FeatCalculator<Double,gate.Annotation,DocumentCtx>
Get a Double from 0 to 100 that reflects the position of the annotation (central offset ID) with respect to the section the sentence belongs to. A section is the set of sentences between two consecutive main headers (h1).
-
-
Constructor Summary
Constructors Constructor Description AnnotationPositionInSectionC(Integer folderNumber, boolean unequal, boolean considerOnlyTopLevelHeaders)
If folderNumber is greater than 0, the section length is divided in folderNumber different folders of equal size and the id from 1 to folderNumber equal to the folder where the annotation is placed is returned If unequal is true the section is divided into 5 equal sized folders (folderNumber = 5) and a number from 1 to 5 is returned if (original number ---> returned number): 1 ---> first sentence of the section 2 ---> sentences from the first fifth of the section, after the first one 3 ---> sentences from the second, third and fourth fifth of the section 4 ---> sentences from the fifth fifth of the section, excluding the last one 5 ---> last sentence of the section
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description edu.upf.taln.ml.feat.base.MyDouble
calculateFeature(gate.Annotation obj, DocumentCtx doc, String featName)
static double
round(double value, int places)
-
-
-
Constructor Detail
-
AnnotationPositionInSectionC
public AnnotationPositionInSectionC(Integer folderNumber, boolean unequal, boolean considerOnlyTopLevelHeaders)
If folderNumber is greater than 0, the section length is divided in folderNumber different folders of equal size and the id from 1 to folderNumber equal to the folder where the annotation is placed is returned If unequal is true the section is divided into 5 equal sized folders (folderNumber = 5) and a number from 1 to 5 is returned if (original number ---> returned number): 1 ---> first sentence of the section 2 ---> sentences from the first fifth of the section, after the first one 3 ---> sentences from the second, third and fourth fifth of the section 4 ---> sentences from the fifth fifth of the section, excluding the last one 5 ---> last sentence of the section- Parameters:
folderNumber
-unequal
-considerOnlyTopLevelHeaders
-
-
-
Method Detail
-
calculateFeature
public edu.upf.taln.ml.feat.base.MyDouble calculateFeature(gate.Annotation obj, DocumentCtx doc, String featName)
- Specified by:
calculateFeature
in interfaceedu.upf.taln.ml.feat.base.FeatCalculator<Double,gate.Annotation,DocumentCtx>
-
round
public static double round(double value, int places)
-
-