Package org.nlpub.watset.util
Interface Vectors
-
public interface VectorsUtilities for mapping bags-of-words to real-valued vectors.- See Also:
- Dot products
-
-
Method Summary
Static Methods Modifier and Type Method Description static <V> org.apache.commons.math3.linear.RealVectortransform(Map<V,Number> bag)Transform the bag-of-words into a real-valued vector.static <V> org.apache.commons.math3.linear.RealVectortransform(Map<V,Number> bag, Collection<V> domain)Transform the bag-of-words into a real-valued vector.
-
-
-
Method Detail
-
transform
static <V> org.apache.commons.math3.linear.RealVector transform(Map<V,Number> bag)
Transform the bag-of-words into a real-valued vector.The number of elements in the vector is equal to the size of the key set of the given bag.
- Type Parameters:
V- the type of bag elements- Parameters:
bag- the bag-of-words- Returns:
- a real-valued vector
-
transform
static <V> org.apache.commons.math3.linear.RealVector transform(Map<V,Number> bag, Collection<V> domain)
Transform the bag-of-words into a real-valued vector.The number of elements in the vector is equal to the size of the domain set.
Please make sure that all elements in
domainare unique.- Type Parameters:
V- the type of bag elements- Parameters:
bag- the bag-of-wordsdomain- the collection of allowed elements ofbag- Returns:
- a real-valued vector
-
-