Skip to content

Commit 17aba3d

Browse files
committed
Update TextLoader.cs
1 parent acfec97 commit 17aba3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,10 @@ public class Options
479479

480480
/// <summary>
481481
/// Whether the data file has a header with feature names.
482-
/// Note: If a TextLoader is created with HasHeader=true but without a dataSample, then the TextLoader will not contain slot (columns that are chosen for manipulation) names, because the output schema is made when the TextLoader is made, and not when TextLoader.Load(IMultiStreamSource source) is called.
482+
/// Note: If a TextLoader is created with HasHeader = true but without a dataSample, then vector columns made by TextLoader will not contain slot name
483+
/// annotations (slots being the elements of the given vector column), because the output schema is made when the TextLoader is made, and not when
484+
/// TextLoader.Load(IMultiStreamSource source) is called. In addition, the case where dataSample = null and HasHeader = true indicates to the
485+
/// loader that when it is given a file when Load is called, it needs to skip the first line.
483486
/// </summary>
484487
[Argument(ArgumentType.AtMostOnce, ShortName = "header",
485488
HelpText = "Data file has header with feature names. Header is read only if options 'hs' and 'hf' are not specified.")]
@@ -680,9 +683,6 @@ public Bindings(TextLoader parent, Column[] cols, IMultiStreamSource headerFile,
680683
needInputSize = true;
681684
}
682685

683-
if (parent.HasHeader && dataSample == null)
684-
throw ch.ExceptNotSupp("Data sample cannot be null if the HasHeader flag is set to True.");
685-
686686
int inputSize = parent._inputSize;
687687
ch.Assert(0 <= inputSize & inputSize < SrcLim);
688688
List<ReadOnlyMemory<char>> lines = null;

0 commit comments

Comments
 (0)