Class FieldMatchMetricsParameters
java.lang.Object
com.yahoo.searchlib.ranking.features.fieldmatch.FieldMatchMetricsParameters
The parameters to a string match metric calculator.
Mutable until frozen.
- Author:
- bratseth
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an unfrozen marcg metrics object initialized to the default values -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldMatchMetricsParametersReturns the frozen default parametersvoidfreeze()Freezes this object.floatReturns the importance of the match occuring early in the query, relative to segmentProximityImportance, occurrenceImportance and proximityCompletenessImportance in thematchmetric.floatReturns a number between 0 and 1 which determines the importancy of field completeness in relation to query completeness in thematchandcompletenessmetrics.intReturns the maximal number of alternative segmentations allowed in addition to the first one found.intReturns the number of occurrences the number of occurrences of each word is normalized against.floatReturns the importance of having many occurrences of the query terms, relative to earlinessImportance, segmentProximityImportance and proximityCompletenessImportance in thematchmetric.floatgetProximity(int index) Returns the proximity table value at an indexfloatReturns the importance of the match having high proximity and being complete, relative to segmentProximityImportance, occurrenceImportance and earlinessImportance in thematchmetric.intReturns the maximum allowed gap within a segment.float[]Returns the current proxmity table.floatReturns the normalized importance of relatedness used in thematchmetric.floatReturns the importance of multiple segments being close to each other, relative to earlinessImportance, occurrenceImportance and proximityCompletenessImportance in thematchmetric.voidsetEarlinessImportance(float earlinessImportance) voidsetFieldCompletenessImportance(float fieldCompletenessImportance) voidsetMaxAlternativeSegmentations(int maxAlternativeSegmentations) voidsetMaxOccurrences(int maxOccurrences) voidsetOccurrenceImportance(float occurrenceImportance) voidsetProximityCompletenessImportance(float proximityCompletenessImportance) voidsetProximityLimit(int proximityLimit) Sets the maximum allowed gap within a segment.voidsetProximityTable(float[] proximityTable) Sets the proximity table deciding the importance of separations of various distances, The table must have size proximityLimit*2+1, where the first half is for reverse direction distances.voidsetRelatednessImportance(float relatednessImportance) voidsetSegmentProximityImportance(float segmentProximityImportance)
-
Constructor Details
-
FieldMatchMetricsParameters
public FieldMatchMetricsParameters()Creates an unfrozen marcg metrics object initialized to the default values
-
-
Method Details
-
defaultParameters
Returns the frozen default parameters -
setProximityLimit
public void setProximityLimit(int proximityLimit) Sets the maximum allowed gap within a segment. Default: 10 -
getProximityLimit
public int getProximityLimit()Returns the maximum allowed gap within a segment. Default: 10 -
setProximityTable
public void setProximityTable(float[] proximityTable) Sets the proximity table deciding the importance of separations of various distances, The table must have size proximityLimit*2+1, where the first half is for reverse direction distances. The table must only contain values between 0 and 1, where 1 is "perfect" and 0 is "worst". -
getProximityTable
public float[] getProximityTable()Returns the current proxmity table. The default table is calculated by1/2^(n/2)on the right order side, and1/2^(n/2) /3on the reverse order side where n is the distance between the tokens. -
getProximity
public float getProximity(int index) Returns the proximity table value at an index -
getMaxAlternativeSegmentations
public int getMaxAlternativeSegmentations()Returns the maximal number of alternative segmentations allowed in addition to the first one found. Default is 10000. This will prefer to not consider iterations on segments that are far out in the field, and which starts late in the query. -
setMaxAlternativeSegmentations
public void setMaxAlternativeSegmentations(int maxAlternativeSegmentations) -
getMaxOccurrences
public int getMaxOccurrences()Returns the number of occurrences the number of occurrences of each word is normalized against. This should be set as the number above which additional occurrences of the term has no real significance. The default is 100. -
setMaxOccurrences
public void setMaxOccurrences(int maxOccurrences) -
getFieldCompletenessImportance
public float getFieldCompletenessImportance()Returns a number between 0 and 1 which determines the importancy of field completeness in relation to query completeness in thematchandcompletenessmetrics. Default is 0.05 -
setFieldCompletenessImportance
public void setFieldCompletenessImportance(float fieldCompletenessImportance) -
getProximityCompletenessImportance
public float getProximityCompletenessImportance()Returns the importance of the match having high proximity and being complete, relative to segmentProximityImportance, occurrenceImportance and earlinessImportance in thematchmetric. Default: 0.9 -
setProximityCompletenessImportance
public void setProximityCompletenessImportance(float proximityCompletenessImportance) -
getEarlinessImportance
public float getEarlinessImportance()Returns the importance of the match occuring early in the query, relative to segmentProximityImportance, occurrenceImportance and proximityCompletenessImportance in thematchmetric. Default: 0.05 -
setEarlinessImportance
public void setEarlinessImportance(float earlinessImportance) -
getSegmentProximityImportance
public float getSegmentProximityImportance()Returns the importance of multiple segments being close to each other, relative to earlinessImportance, occurrenceImportance and proximityCompletenessImportance in thematchmetric. Default: 0.05 -
setSegmentProximityImportance
public void setSegmentProximityImportance(float segmentProximityImportance) -
getOccurrenceImportance
public float getOccurrenceImportance()Returns the importance of having many occurrences of the query terms, relative to earlinessImportance, segmentProximityImportance and proximityCompletenessImportance in thematchmetric. Default: 0.05 -
setOccurrenceImportance
public void setOccurrenceImportance(float occurrenceImportance) -
getRelatednessImportance
public float getRelatednessImportance()Returns the normalized importance of relatedness used in thematchmetric. Default: 0.9 -
setRelatednessImportance
public void setRelatednessImportance(float relatednessImportance) -
freeze
public void freeze()Freezes this object. All changes after this point will cause an IllegalStateException. This must be frozen before being handed to a calculator.- Throws:
IllegalStateException- if this parameter object is inconsistent. In this case, this is not frozen.
-