jsat.text
Class HashedTextVectorCreator
- java.lang.Object
-
- jsat.text.HashedTextVectorCreator
-
- All Implemented Interfaces:
- java.io.Serializable, TextVectorCreator
public class HashedTextVectorCreator extends java.lang.Object implements TextVectorCreator
Hashed Text Vector Creator exists to convert a text string into aVecusing feature hashing. Thetokenizationandword weightingmethod must be provided and already set up. When constructed the user should make sure theWordWeighting.setWeight(java.util.List, java.util.List)method has already been called, or is a stateless weighting (such asBinaryWordPresent).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description HashedTextVectorCreator(int dimensionSize, Tokenizer tokenizer, WordWeighting weighting)Creates a new text vector creator that works with hash-trick features
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description VecnewText(java.lang.String input)Converts the given input text into a vector representation.VecnewText(java.lang.String input, java.lang.StringBuilder workSpace, java.util.List<java.lang.String> storageSpace)Converts the given input text into a vector representation
-
-
-
Constructor Detail
-
HashedTextVectorCreator
public HashedTextVectorCreator(int dimensionSize, Tokenizer tokenizer, WordWeighting weighting)Creates a new text vector creator that works with hash-trick features- Parameters:
dimensionSize- the dimension size of the feature spacetokenizer- the tokenizer to apply to incoming stringsweighting- the weighting process to apply to each loaded document.
-
-
Method Detail
-
newText
public Vec newText(java.lang.String input)
Description copied from interface:TextVectorCreatorConverts the given input text into a vector representation.- Specified by:
newTextin interfaceTextVectorCreator- Parameters:
input- the input string- Returns:
- a vector representation
-
newText
public Vec newText(java.lang.String input, java.lang.StringBuilder workSpace, java.util.List<java.lang.String> storageSpace)
Description copied from interface:TextVectorCreatorConverts the given input text into a vector representation- Specified by:
newTextin interfaceTextVectorCreator- Parameters:
input- the input stringworkSpace- an already allocated (but empty) string builder than can be used as a temporary work space.storageSpace- an already allocated (but empty) list to place the tokens into- Returns:
- a vector representation
-
-
DataMelt 3.0 © DataMelt by jWork.ORG