All Downloads are FREE. Search and download functionalities are using the official Maven repository.

epic.features.SpanLengthFeaturizer.scala Maven / Gradle / Ivy

There is a newer version: 0.4.4
Show newest version
package epic.features

import epic.framework.Feature

/**
 *
 *
 * @author dlwh
 */
@SerialVersionUID(1L)
class SpanLengthFeaturizer(db: DistanceBinner = new DistanceBinner()) extends SurfaceFeaturizer[String] with Serializable {
  def anchor(words: IndexedSeq[String]): SurfaceFeatureAnchoring[String] = {
    new SurfaceFeatureAnchoring[String] {
      def featuresForSpan(begin: Int, end: Int): Array[Feature] = {
        Array(SpanLengthFeature(db.binnedDistance(begin, end)))
      }
    }
  }
}
case class SpanLengthFeature(dist: Int) extends Feature




© 2015 - 2025 Weber Informatics LLC | Privacy Policy