60 references to WordEmbeddingEstimator
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
4539ModelKind = WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding
Microsoft.ML.PerformanceTests (1)
StochasticDualCoordinateAscentClassifierBench.cs (1)
113WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding)
Microsoft.ML.Samples (1)
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (1)
40"Tokens", WordEmbeddingEstimator.PretrainedModelKind
Microsoft.ML.Tests (5)
OnnxConversionTest.cs (1)
853var pipeline = mlContext.Transforms.Text.ApplyWordEmbedding("Embed", embedNetworkPath, "Tokens");
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
543WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding));
Transformers\WordEmbeddingsTests.cs (3)
46var pipe = ML.Transforms.Text.ApplyWordEmbedding("WordEmbeddings", "CleanWords", modelKind: WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding); 89var pipe = ML.Transforms.Text.ApplyWordEmbedding("WordEmbeddings", pathToCustomModel, "CleanWords");
Microsoft.ML.Transforms (52)
Text\TextCatalog.cs (13)
145/// Create an <see cref="WordEmbeddingEstimator"/>, which is a text featurizer that converts a vector 154/// <param name="modelKind">The embeddings <see cref="WordEmbeddingEstimator.PretrainedModelKind"/> to use. </param> 162public static WordEmbeddingEstimator ApplyWordEmbedding(this TransformsCatalog.TextTransforms catalog, 165WordEmbeddingEstimator.PretrainedModelKind modelKind = WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding) 169/// Create an <see cref="WordEmbeddingEstimator"/>, which is a text featurizer that converts vectors 186public static WordEmbeddingEstimator ApplyWordEmbedding(this TransformsCatalog.TextTransforms catalog, 194/// Create an <see cref="WordEmbeddingEstimator"/>, which is a text featurizer that converts vectors 198/// <param name="modelKind">The embeddings <see cref="WordEmbeddingEstimator.PretrainedModelKind"/> to use. </param> 208internal static WordEmbeddingEstimator ApplyWordEmbedding(this TransformsCatalog.TextTransforms catalog, 209WordEmbeddingEstimator.PretrainedModelKind modelKind = WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding, 210params WordEmbeddingEstimator.ColumnOptions[] columns)
Text\WordEmbeddingsExtractor.cs (39)
36/// <see cref="ITransformer"/> resulting from fitting an <see cref="WordEmbeddingEstimator"/>. 65public WordEmbeddingEstimator.PretrainedModelKind? ModelKind = WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding; 89private readonly WordEmbeddingEstimator.PretrainedModelKind? _modelKind; 161WordEmbeddingEstimator.PretrainedModelKind modelKind = WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding) 162: this(env, modelKind, new WordEmbeddingEstimator.ColumnOptions(outputColumnName, inputColumnName ?? outputColumnName)) 174: this(env, customModelFile, new WordEmbeddingEstimator.ColumnOptions(outputColumnName, inputColumnName ?? outputColumnName)) 184internal WordEmbeddingTransformer(IHostEnvironment env, WordEmbeddingEstimator.PretrainedModelKind modelKind, params WordEmbeddingEstimator.ColumnOptions[] columns) 187env.CheckUserArg(Enum.IsDefined(typeof(WordEmbeddingEstimator.PretrainedModelKind), modelKind), nameof(modelKind)); 190_modelFileNameWithPath = EnsureModelFile(env, out _linesToSkip, (WordEmbeddingEstimator.PretrainedModelKind)_modelKind); 200internal WordEmbeddingTransformer(IHostEnvironment env, string customModelFile, params WordEmbeddingEstimator.ColumnOptions[] columns) 212private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(WordEmbeddingEstimator.ColumnOptions[] columns) 226options.ModelKind = WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding; 227env.CheckUserArg(!options.ModelKind.HasValue || Enum.IsDefined(typeof(WordEmbeddingEstimator.PretrainedModelKind), options.ModelKind), nameof(options.ModelKind)); 231var cols = new WordEmbeddingEstimator.ColumnOptions[options.Columns.Length]; 235cols[i] = new WordEmbeddingEstimator.ColumnOptions( 260_modelKind = (WordEmbeddingEstimator.PretrainedModelKind)ctx.Reader.ReadUInt32(); 261_modelFileNameWithPath = EnsureModelFile(Host, out _linesToSkip, (WordEmbeddingEstimator.PretrainedModelKind)_modelKind); 605private static readonly Dictionary<WordEmbeddingEstimator.PretrainedModelKind, string> _modelsMetaData = new Dictionary<WordEmbeddingEstimator.PretrainedModelKind, string>() 607{ WordEmbeddingEstimator.PretrainedModelKind.GloVe50D, "glove.6B.50d.txt" }, 608{ WordEmbeddingEstimator.PretrainedModelKind.GloVe100D, "glove.6B.100d.txt" }, 609{ WordEmbeddingEstimator.PretrainedModelKind.GloVe200D, "glove.6B.200d.txt" }, 610{ WordEmbeddingEstimator.PretrainedModelKind.GloVe300D, "glove.6B.300d.txt" }, 611{ WordEmbeddingEstimator.PretrainedModelKind.GloVeTwitter25D, "glove.twitter.27B.25d.txt" }, 612{ WordEmbeddingEstimator.PretrainedModelKind.GloVeTwitter50D, "glove.twitter.27B.50d.txt" }, 613{ WordEmbeddingEstimator.PretrainedModelKind.GloVeTwitter100D, "glove.twitter.27B.100d.txt" }, 614{ WordEmbeddingEstimator.PretrainedModelKind.GloVeTwitter200D, "glove.twitter.27B.200d.txt" }, 615{ WordEmbeddingEstimator.PretrainedModelKind.FastTextWikipedia300D, "wiki.en.vec" }, 616{ WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding, "sentiment.emd" } 619private static readonly Dictionary<WordEmbeddingEstimator.PretrainedModelKind, int> _linesToSkipInModels = new Dictionary<WordEmbeddingEstimator.PretrainedModelKind, int>() 620{ { WordEmbeddingEstimator.PretrainedModelKind.FastTextWikipedia300D, 1 } }; 622private string EnsureModelFile(IHostEnvironment env, out int linesToSkip, WordEmbeddingEstimator.PretrainedModelKind kind) 632string dir = kind == WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding ? Path.Combine("Text", "Sswe") : "WordVectors"; 815_host = env.Register(nameof(WordEmbeddingEstimator)); 824_host = env.Register(nameof(WordEmbeddingEstimator));