Skip to content

Commit a81c3d2

Browse files
committed
review comments regarding adding summary comments
1 parent c23c464 commit a81c3d2

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
lines changed

src/Microsoft.ML.Transforms/Text/LdaTransform.cs

+47-1
Original file line numberDiff line numberDiff line change
@@ -980,20 +980,62 @@ internal LatentDirichletAllocationEstimator(IHostEnvironment env, params ColumnI
980980
_columns = columns.ToImmutableArray();
981981
}
982982

983+
/// <summary>
984+
/// Describes how the transformer handles one column pair.
985+
/// </summary>
983986
public sealed class ColumnInfo
984987
{
988+
/// <summary>
989+
/// Name of the column resulting from the transformation of <cref see="InputColumnName"/>.
990+
/// </summary>
985991
public readonly string Name;
992+
/// <summary>
993+
/// Name of column to transform. If set to <see langword="null"/>, the value of the <cref see="Name"/> will be used as source.
994+
/// </summary>
986995
public readonly string InputColumnName;
996+
/// <summary>
997+
/// The number of topics.
998+
/// </summary>
987999
public readonly int NumTopic;
1000+
/// <summary>
1001+
/// Dirichlet prior on document-topic vectors.
1002+
/// </summary>
9881003
public readonly float AlphaSum;
1004+
/// <summary>
1005+
/// Dirichlet prior on vocab-topic vectors.
1006+
/// </summary>
9891007
public readonly float Beta;
1008+
/// <summary>
1009+
/// Number of Metropolis Hasting step.
1010+
/// </summary>
9901011
public readonly int MHStep;
1012+
/// <summary>
1013+
/// Number of iterations.
1014+
/// </summary>
9911015
public readonly int NumIter;
1016+
/// <summary>
1017+
/// Compute log likelihood over local dataset on this iteration interval.
1018+
/// </summary>
9921019
public readonly int LikelihoodInterval;
1020+
/// <summary>
1021+
/// The number of training threads.
1022+
/// </summary>
9931023
public readonly int NumThread;
1024+
/// <summary>
1025+
/// The threshold of maximum count of tokens per doc.
1026+
/// </summary>
9941027
public readonly int NumMaxDocToken;
1028+
/// <summary>
1029+
/// The number of words to summarize the topic.
1030+
/// </summary>
9951031
public readonly int NumSummaryTermPerTopic;
1032+
/// <summary>
1033+
/// The number of burn-in iterations.
1034+
/// </summary>
9961035
public readonly int NumBurninIter;
1036+
/// <summary>
1037+
/// Reset the random number generator for each document.
1038+
/// </summary>
9971039
public readonly bool ResetRandomGenerator;
9981040

9991041
/// <summary>
@@ -1150,7 +1192,8 @@ internal void Save(ModelSaveContext ctx)
11501192
}
11511193

11521194
/// <summary>
1153-
/// Returns the schema that would be produced by the transformation.
1195+
/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
1196+
/// Used for schema propagation and verification in a pipeline.
11541197
/// </summary>
11551198
public SchemaShape GetOutputSchema(SchemaShape inputSchema)
11561199
{
@@ -1169,6 +1212,9 @@ public SchemaShape GetOutputSchema(SchemaShape inputSchema)
11691212
return new SchemaShape(result.Values);
11701213
}
11711214

1215+
/// <summary>
1216+
/// Trains and returns a <see cref="LatentDirichletAllocationTransformer"/>.
1217+
/// </summary>
11721218
public LatentDirichletAllocationTransformer Fit(IDataView input)
11731219
{
11741220
return LatentDirichletAllocationTransformer.TrainLdaTransformer(_host, input, _columns.ToArray());

src/Microsoft.ML.Transforms/Text/NgramHashingTransformer.cs

+7
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,10 @@ internal static bool IsSchemaColumnValid(SchemaShape.Column col)
12021202

12031203
internal const string ExpectedColumnType = "Expected vector of Key type, and Key is convertible to U4";
12041204

1205+
/// <summary>
1206+
/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
1207+
/// Used for schema propagation and verification in a pipeline.
1208+
/// </summary>
12051209
public SchemaShape GetOutputSchema(SchemaShape inputSchema)
12061210
{
12071211
_host.CheckValue(inputSchema, nameof(inputSchema));
@@ -1222,6 +1226,9 @@ public SchemaShape GetOutputSchema(SchemaShape inputSchema)
12221226
return new SchemaShape(result.Values);
12231227
}
12241228

1229+
/// <summary>
1230+
/// Trains and returns a <see cref="NgramHashingTransformer"/>.
1231+
/// </summary>
12251232
public NgramHashingTransformer Fit(IDataView input) => new NgramHashingTransformer(_host, input, _columns);
12261233
}
12271234
}

src/Microsoft.ML.Transforms/Text/NgramTransform.cs

+7
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,9 @@ internal NgramExtractingEstimator(IHostEnvironment env, params ColumnInfo[] colu
762762
_columns = columns;
763763
}
764764

765+
/// <summary>
766+
/// Trains and returns a <see cref="NgramExtractingTransformer"/>.
767+
/// </summary>
765768
public NgramExtractingTransformer Fit(IDataView input) => new NgramExtractingTransformer(_host, input, _columns);
766769

767770
internal static bool IsColumnTypeValid(ColumnType type)
@@ -865,6 +868,10 @@ internal ColumnInfo(string name,
865868
}
866869
}
867870

871+
/// <summary>
872+
/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
873+
/// Used for schema propagation and verification in a pipeline.
874+
/// </summary>
868875
public SchemaShape GetOutputSchema(SchemaShape inputSchema)
869876
{
870877
_host.CheckValue(inputSchema, nameof(inputSchema));

src/Microsoft.ML.Transforms/Text/WordEmbeddingsExtractor.cs

+7
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,10 @@ public ColumnInfo(string name, string inputColumnName = null)
850850
}
851851
}
852852

853+
/// <summary>
854+
/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
855+
/// Used for schema propagation and verification in a pipeline.
856+
/// </summary>
853857
public SchemaShape GetOutputSchema(SchemaShape inputSchema)
854858
{
855859
_host.CheckValue(inputSchema, nameof(inputSchema));
@@ -867,6 +871,9 @@ public SchemaShape GetOutputSchema(SchemaShape inputSchema)
867871
return new SchemaShape(result.Values);
868872
}
869873

874+
/// <summary>
875+
/// Trains and returns a <see cref="WordEmbeddingsExtractingTransformer"/>.
876+
/// </summary>
870877
public WordEmbeddingsExtractingTransformer Fit(IDataView input)
871878
{
872879
bool customLookup = !string.IsNullOrWhiteSpace(_customLookupTable);

0 commit comments

Comments
 (0)