60 references to WordEmbeddingEstimator
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
4539
ModelKind =
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding
Microsoft.ML.PerformanceTests (1)
StochasticDualCoordinateAscentClassifierBench.cs (1)
113
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding)
Microsoft.ML.Samples (1)
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (1)
40
"Tokens",
WordEmbeddingEstimator
.PretrainedModelKind
Microsoft.ML.Tests (5)
OnnxConversionTest.cs (1)
853
var
pipeline = mlContext.Transforms.Text.ApplyWordEmbedding("Embed", embedNetworkPath, "Tokens");
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
543
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding));
Transformers\WordEmbeddingsTests.cs (3)
46
var
pipe = ML.Transforms.Text.ApplyWordEmbedding("WordEmbeddings", "CleanWords", modelKind:
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding);
89
var
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>
162
public static
WordEmbeddingEstimator
ApplyWordEmbedding(this TransformsCatalog.TextTransforms catalog,
165
WordEmbeddingEstimator
.PretrainedModelKind modelKind =
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding)
169
/// Create an <see cref="
WordEmbeddingEstimator
"/>, which is a text featurizer that converts vectors
186
public 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>
208
internal static
WordEmbeddingEstimator
ApplyWordEmbedding(this TransformsCatalog.TextTransforms catalog,
209
WordEmbeddingEstimator
.PretrainedModelKind modelKind =
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding,
210
params
WordEmbeddingEstimator
.ColumnOptions[] columns)
Text\WordEmbeddingsExtractor.cs (39)
36
/// <see cref="ITransformer"/> resulting from fitting an <see cref="
WordEmbeddingEstimator
"/>.
65
public
WordEmbeddingEstimator
.PretrainedModelKind? ModelKind =
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding;
89
private readonly
WordEmbeddingEstimator
.PretrainedModelKind? _modelKind;
161
WordEmbeddingEstimator
.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))
184
internal WordEmbeddingTransformer(IHostEnvironment env,
WordEmbeddingEstimator
.PretrainedModelKind modelKind, params
WordEmbeddingEstimator
.ColumnOptions[] columns)
187
env.CheckUserArg(Enum.IsDefined(typeof(
WordEmbeddingEstimator
.PretrainedModelKind), modelKind), nameof(modelKind));
190
_modelFileNameWithPath = EnsureModelFile(env, out _linesToSkip, (
WordEmbeddingEstimator
.PretrainedModelKind)_modelKind);
200
internal WordEmbeddingTransformer(IHostEnvironment env, string customModelFile, params
WordEmbeddingEstimator
.ColumnOptions[] columns)
212
private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(
WordEmbeddingEstimator
.ColumnOptions[] columns)
226
options.ModelKind =
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding;
227
env.CheckUserArg(!options.ModelKind.HasValue || Enum.IsDefined(typeof(
WordEmbeddingEstimator
.PretrainedModelKind), options.ModelKind), nameof(options.ModelKind));
231
var cols = new
WordEmbeddingEstimator
.ColumnOptions[options.Columns.Length];
235
cols[i] = new
WordEmbeddingEstimator
.ColumnOptions(
260
_modelKind = (
WordEmbeddingEstimator
.PretrainedModelKind)ctx.Reader.ReadUInt32();
261
_modelFileNameWithPath = EnsureModelFile(Host, out _linesToSkip, (
WordEmbeddingEstimator
.PretrainedModelKind)_modelKind);
605
private 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" }
619
private static readonly Dictionary<
WordEmbeddingEstimator
.PretrainedModelKind, int> _linesToSkipInModels = new Dictionary<
WordEmbeddingEstimator
.PretrainedModelKind, int>()
620
{ {
WordEmbeddingEstimator
.PretrainedModelKind.FastTextWikipedia300D, 1 } };
622
private string EnsureModelFile(IHostEnvironment env, out int linesToSkip,
WordEmbeddingEstimator
.PretrainedModelKind kind)
632
string dir = kind ==
WordEmbeddingEstimator
.PretrainedModelKind.SentimentSpecificWordEmbedding ? Path.Combine("Text", "Sswe") : "WordVectors";
815
_host = env.Register(nameof(
WordEmbeddingEstimator
));
824
_host = env.Register(nameof(
WordEmbeddingEstimator
));