/// <include file='doc.xml' path='doc/members/member[@name="WordEmbeddings"]/*' />
 /// <param name="input">Vector of tokenized text.</param>
 /// <param name="modelKind">The pretrained word embedding model.</param>
 /// <returns></returns>
 public static Vector <float> WordEmbeddings(this VarVector <string> input, WordEmbeddingsTransform.PretrainedModelKind modelKind = WordEmbeddingsTransform.PretrainedModelKind.Sswe)
 {
     Contracts.CheckValue(input, nameof(input));
     return(new OutColumn(input, modelKind));
 }
 public static VarVector <Key <uint> > Hash <T>(this VarVector <T> me)
 => _rec.VarVector <Key <uint> >(me);
 public static VarVector <Key <uint, string> > Hash <T>(this VarVector <T> me, int invertHashTokens)
 => _rec.VarVector <Key <uint, string> >(me);
 public static VarVector <string> Tokenize(this VarVector <string> me)
 => _rec.VarVector <string>(me);
 public static VarVector <Key <uint, T> > Dictionarize <T>(this VarVector <T> me)
 => _rec.VarVector <Key <uint, T> >(me);
 public static VarVector <Key <uint, string> > Hash <T>(this VarVector <T> me, int maximumNumberOfInvertsTokens)
 => _rec.VarVector <Key <uint, string> >(me);
 public static VarVector <T> ConcatWith <T>(this VarVector <T> me, params ScalarOrVectorOrVarVector <T>[] i)
 => _rec.VarVector <T>(Helper(me, i));
 public OutPipelineColumn(VarVector <Key <uint, string> > input, int hashBits, int ngramLength, int skipLength, bool allLengths, uint seed, bool ordered, int invertHash)
     : base(new Reconciler(hashBits, ngramLength, skipLength, allLengths, seed, ordered, invertHash), input)
 {
     Input = input;
 }
 public static Vector <float> BagVectorize <T, TVal>(this VarVector <Key <T, TVal> > me)
 => _rec.Vector <float>(me);
 public OutPipelineColumn(VarVector <string> input, Language language)
     : base(new Reconciler(language), input)
 {
     Input = input;
 }
 /// <summary>
 /// Remove stop words from incoming text.
 /// </summary>
 /// <param name="input">The column to apply to.</param>
 /// <param name="language">Langauge of the input text.</param>
 public static VarVector <string> RemoveStopwords(this VarVector <string> input,
                                                  Language language = Language.English) => new OutPipelineColumn(input, language);
Example #12
0
 /// <summary>
 /// Convert to variable array of floats.
 /// </summary>
 /// <param name="input">The input column.</param>
 /// <returns >Column with variable array of floats.</returns>
 public static VarVector <float> ToFloat(this VarVector <sbyte> input) => new ImplVarVector <sbyte>(Contracts.CheckRef(input, nameof(input)), DataKind.R4);
 /// <summary>
 /// Converts the categorical value into an indicator array by building a dictionary of categories based on the data and using the id in the dictionary as the index in the array
 /// </summary>
 /// <param name="input">Incoming data.</param>
 /// <param name="outputKind">Specify the output type of indicator array: array or binary encoded data.</param>
 /// <param name="hashBits">Amount of bits to use for hashing.</param>
 /// <param name="seed">Seed value used for hashing.</param>
 /// <param name="ordered">Whether the position of each term should be included in the hash.</param>
 /// <param name="invertHash">Limit the number of keys used to generate the slot name to this many. 0 means no invert hashing, -1 means no limit.</param>
 public static Vector <float> OneHotHashEncoding(this VarVector <string> input, OneHotHashVectorOutputKind outputKind = DefOut,
                                                 int hashBits = DefHashBits, uint seed = DefSeed, bool ordered = DefOrdered, int invertHash = DefInvertHash)
 {
     Contracts.CheckValue(input, nameof(input));
     return(new ImplVector <string>(input, new Config(outputKind, hashBits, seed, ordered, invertHash)));
 }
 public OutColumn(VarVector <string> input, string customModelFile = null)
     : base(new Reconciler(customModelFile), input)
 {
     Input = input;
 }
 /// <include file='doc.xml' path='doc/members/member[@name="WordEmbeddings"]/*' />
 /// <param name="input">Vector of tokenized text.</param>
 /// <param name="customModelFile">The custom word embedding model file.</param>
 public static Vector <float> WordEmbeddings(this VarVector <string> input, string customModelFile)
 {
     Contracts.CheckValue(input, nameof(input));
     return(new OutColumn(input, customModelFile));
 }
 /// <summary>
 /// Given a set of columns including at least one variable sized vector column, concatenate them
 /// together into a vector valued column of the same type.
 /// </summary>
 /// <typeparam name="T">The value type.</typeparam>
 /// <param name="me">The first input column.</param>
 /// <param name="others">Subsequent input columns.</param>
 /// <returns>The result of concatenating all input columns together.</returns>
 public static VarVector <T> ConcatWith <T>(this VarVector <T> me, params ScalarOrVectorOrVarVector <T>[] others)
 => new ImplVar <T>(Join(me, others));
 public OutColumn(VarVector <string> input, WordEmbeddingsTransform.PretrainedModelKind modelKind = WordEmbeddingsTransform.PretrainedModelKind.Sswe)
     : base(new Reconciler(modelKind), input)
 {
     Input = input;
 }
 public OutVarVectorColumn(VarVector <TValue> input)
     : base(Reconciler.Inst, input)
 {
     Input = input;
 }