public class IntervalDistanceFunction extends Object implements IDistanceFunction
IDistanceFunction
interface for scoring the
distance between interval-scaled categories. That is to say, categories
represent a numerical value whose difference can be measured. A typical
example is date as measures, for instance, using the Gregorian calendar.
We are able to measure the difference between the years 2010 and 2000
and to say that the difference equals the difference between he years
1980 and 1970. However, we cannot say that 2000 is twice the year 1000,
since there is no absolute zero (note that the year 0 is arbitrarily
defined and that we need to cater for years such as 200 BCE). For
natural language processing tasks, judging the similarity between two
entities on a linear scale of, say, 1 to 6 is another example for
interval-scaled data. Mathematically, the interval scale only allows for
the equality, comparison, and addition operations, but prohibits
multiplication. The distance function returns the squared difference
between the numerical representation of two categories. It thus assumes
the categories to be integers or doubles and falls back to a
NominalDistanceFunction
for other data types.IDistanceFunction
Constructor and Description |
---|
IntervalDistanceFunction() |
Modifier and Type | Method and Description |
---|---|
double |
measureDistance(IAnnotationStudy study,
Object category1,
Object category2)
Returns a distance value for the given pair of categories used within
the given annotation study.
|
public double measureDistance(IAnnotationStudy study, Object category1, Object category2)
IDistanceFunction
measureDistance
in interface IDistanceFunction
Copyright © 2011–2015 Ubiquitous Knowledge Processing (UKP) Lab. All rights reserved.