@@ -61,7 +61,7 @@ internal sealed class Options : TransformInputBase
61
61
public Column [ ] Columns ;
62
62
63
63
[ Argument ( ArgumentType . AtMostOnce , HelpText = "Pre-trained model used to create the vocabulary" , ShortName = "model" , SortOrder = 1 ) ]
64
- public WordEmbeddingsExtractingEstimator . PretrainedModelKind ? ModelKind = WordEmbeddingsExtractingEstimator . PretrainedModelKind . Sswe ;
64
+ public WordEmbeddingsExtractingEstimator . PretrainedModelKind ? ModelKind = WordEmbeddingsExtractingEstimator . PretrainedModelKind . SentimentSpecificWordEmbedding ;
65
65
66
66
[ Argument ( ArgumentType . AtMostOnce , IsInputFileName = true , HelpText = "Filename for custom word embedding model" ,
67
67
ShortName = "dataFile" , SortOrder = 2 ) ]
@@ -96,7 +96,7 @@ internal static VersionInfo GetVersionInfo()
96
96
/// <summary>
97
97
/// The names of the output and input column pairs on which the transformation is applied.
98
98
/// </summary>
99
- public IReadOnlyCollection < ( string outputColumnName , string inputColumnName ) > Columns => ColumnPairs . AsReadOnly ( ) ;
99
+ private IReadOnlyCollection < ( string outputColumnName , string inputColumnName ) > Columns => ColumnPairs . AsReadOnly ( ) ;
100
100
101
101
private sealed class Model
102
102
{
@@ -162,7 +162,7 @@ public List<string> GetWordLabels()
162
162
/// <param name="inputColumnName">Name of the column to transform. If set to <see langword="null"/>, the value of the <paramref name="outputColumnName"/> will be used as source.</param>
163
163
/// <param name="modelKind">The pretrained word embedding model.</param>
164
164
internal WordEmbeddingsExtractingTransformer ( IHostEnvironment env , string outputColumnName , string inputColumnName = null ,
165
- WordEmbeddingsExtractingEstimator . PretrainedModelKind modelKind = WordEmbeddingsExtractingEstimator . PretrainedModelKind . Sswe )
165
+ WordEmbeddingsExtractingEstimator . PretrainedModelKind modelKind = WordEmbeddingsExtractingEstimator . PretrainedModelKind . SentimentSpecificWordEmbedding )
166
166
: this ( env , modelKind , new WordEmbeddingsExtractingEstimator . ColumnOptions ( outputColumnName , inputColumnName ?? outputColumnName ) )
167
167
{
168
168
}
@@ -227,7 +227,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
227
227
env . CheckValue ( input , nameof ( input ) ) ;
228
228
229
229
if ( options . ModelKind == null )
230
- options . ModelKind = WordEmbeddingsExtractingEstimator . PretrainedModelKind . Sswe ;
230
+ options . ModelKind = WordEmbeddingsExtractingEstimator . PretrainedModelKind . SentimentSpecificWordEmbedding ;
231
231
env . CheckUserArg ( ! options . ModelKind . HasValue || Enum . IsDefined ( typeof ( WordEmbeddingsExtractingEstimator . PretrainedModelKind ) , options . ModelKind ) , nameof ( options . ModelKind ) ) ;
232
232
233
233
env . CheckValue ( options . Columns , nameof ( options . Columns ) ) ;
@@ -614,7 +614,7 @@ private ValueGetter<VBuffer<float>> GetGetterVec(DataViewRow input, int iinfo)
614
614
{ WordEmbeddingsExtractingEstimator . PretrainedModelKind . GloVeTwitter100D , "glove.twitter.27B.100d.txt" } ,
615
615
{ WordEmbeddingsExtractingEstimator . PretrainedModelKind . GloVeTwitter200D , "glove.twitter.27B.200d.txt" } ,
616
616
{ WordEmbeddingsExtractingEstimator . PretrainedModelKind . FastTextWikipedia300D , "wiki.en.vec" } ,
617
- { WordEmbeddingsExtractingEstimator . PretrainedModelKind . Sswe , "sentiment.emd" }
617
+ { WordEmbeddingsExtractingEstimator . PretrainedModelKind . SentimentSpecificWordEmbedding , "sentiment.emd" }
618
618
} ;
619
619
620
620
private static Dictionary < WordEmbeddingsExtractingEstimator . PretrainedModelKind , int > _linesToSkipInModels = new Dictionary < WordEmbeddingsExtractingEstimator . PretrainedModelKind , int > ( )
@@ -630,7 +630,7 @@ private string EnsureModelFile(IHostEnvironment env, out int linesToSkip, WordEm
630
630
linesToSkip = _linesToSkipInModels [ kind ] ;
631
631
using ( var ch = Host . Start ( "Ensuring resources" ) )
632
632
{
633
- string dir = kind == WordEmbeddingsExtractingEstimator . PretrainedModelKind . Sswe ? Path . Combine ( "Text" , "Sswe" ) : "WordVectors" ;
633
+ string dir = kind == WordEmbeddingsExtractingEstimator . PretrainedModelKind . SentimentSpecificWordEmbedding ? Path . Combine ( "Text" , "Sswe" ) : "WordVectors" ;
634
634
var url = $ "{ dir } /{ modelFileName } ";
635
635
var ensureModel = ResourceManagerUtils . Instance . EnsureResource ( Host , ch , url , modelFileName , dir , Timeout ) ;
636
636
ensureModel . Wait ( ) ;
@@ -747,7 +747,7 @@ public sealed class WordEmbeddingsExtractingEstimator : IEstimator<WordEmbedding
747
747
/// <param name="inputColumnName">Name of the column to transform. If set to <see langword="null"/>, the value of the <paramref name="outputColumnName"/> will be used as source.</param>
748
748
/// <param name="modelKind">The embeddings <see cref="PretrainedModelKind"/> to use. </param>
749
749
internal WordEmbeddingsExtractingEstimator ( IHostEnvironment env , string outputColumnName , string inputColumnName = null ,
750
- PretrainedModelKind modelKind = PretrainedModelKind . Sswe )
750
+ PretrainedModelKind modelKind = PretrainedModelKind . SentimentSpecificWordEmbedding )
751
751
: this ( env , modelKind , new ColumnOptions ( outputColumnName , inputColumnName ?? outputColumnName ) )
752
752
{
753
753
}
@@ -777,7 +777,7 @@ internal WordEmbeddingsExtractingEstimator(IHostEnvironment env, string outputCo
777
777
/// <param name="modelKind">The embeddings <see cref="PretrainedModelKind"/> to use. </param>
778
778
/// <param name="columns">The array columns, and per-column configurations to extract embeedings from.</param>
779
779
internal WordEmbeddingsExtractingEstimator ( IHostEnvironment env ,
780
- PretrainedModelKind modelKind = PretrainedModelKind . Sswe ,
780
+ PretrainedModelKind modelKind = PretrainedModelKind . SentimentSpecificWordEmbedding ,
781
781
params ColumnOptions [ ] columns )
782
782
{
783
783
Contracts . CheckValue ( env , nameof ( env ) ) ;
@@ -829,7 +829,7 @@ public enum PretrainedModelKind
829
829
FastTextWikipedia300D = 8 ,
830
830
831
831
[ TGUI ( Label = "Sentiment-Specific Word Embedding" ) ]
832
- Sswe = 9
832
+ SentimentSpecificWordEmbedding = 9
833
833
}
834
834
/// <summary>
835
835
/// Information for each column pair.
0 commit comments