1 instantiation of TextDataViewType
Microsoft.ML.DataView (1)
DataViewType.cs (1)
100Interlocked.CompareExchange(ref _instance, new TextDataViewType(), null) ??
353 references to TextDataViewType
Microsoft.Data.Analysis (4)
DataFrameColumns\ArrowStringDataFrameColumn.cs (1)
584builder.AddColumn(Name, TextDataViewType.Instance);
DataFrameColumns\StringDataFrameColumn.cs (1)
496builder.AddColumn(Name, TextDataViewType.Instance);
DataFrameColumns\VBufferDataFrameColumn.cs (1)
369return new VectorDataViewType(TextDataViewType.Instance);
IDataView.Extension.cs (1)
115else if (type == TextDataViewType.Instance)
Microsoft.ML.AutoML (6)
ColumnInference\ColumnTypeInference.cs (1)
206col.SuggestedType = TextDataViewType.Instance;
Utils\ColumnTypeExtensions.cs (1)
18return columnType is TextDataViewType;
Utils\UserInputValidationUtil.cs (4)
95column.Type.GetItemType() != TextDataViewType.Instance) 98$"{BooleanDataViewType.Instance}, {NumberDataViewType.Single}, and {TextDataViewType.Instance}. " + 115new DataViewType[] { NumberDataViewType.Single, TextDataViewType.Instance }); 119new DataViewType[] { TextDataViewType.Instance });
Microsoft.ML.AutoML.Tests (23)
AutoFitTests.cs (3)
353Assert.Equal(TextDataViewType.Instance, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 376Assert.Equal(TextDataViewType.Instance, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 404Assert.Equal(TextDataViewType.Instance, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type);
TransformInferenceTests.cs (14)
27new DatasetColumnInfo("Categorical1", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(7, null)), 28new DatasetColumnInfo("Categorical2", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(7, null)), 29new DatasetColumnInfo("LargeCat1", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(500, null)), 30new DatasetColumnInfo("LargeCat2", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(500, null)), 83new DatasetColumnInfo("Categorical1", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(7, null)), 84new DatasetColumnInfo("Categorical2", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(7, null)), 85new DatasetColumnInfo("LargeCat1", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(500, null)), 86new DatasetColumnInfo("LargeCat2", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(500, null)), 139new DatasetColumnInfo("Categorical1", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(7, null)), 140new DatasetColumnInfo("LargeCat1", TextDataViewType.Instance, ColumnPurpose.CategoricalFeature, new ColumnDimensions(500, null)), 325new DatasetColumnInfo("Text", TextDataViewType.Instance, ColumnPurpose.TextFeature, new ColumnDimensions(null, null)), 358new DatasetColumnInfo("Text", TextDataViewType.Instance, ColumnPurpose.TextFeature, new ColumnDimensions(null, null)), 674new DatasetColumnInfo("CustomName", TextDataViewType.Instance, columnPurpose, new ColumnDimensions(null, null)), 685new DatasetColumnInfo("CustomLabel", TextDataViewType.Instance, ColumnPurpose.Label, new ColumnDimensions(null, null)),
UserInputValidationTests.cs (5)
239ValidateLabelTypeTestCore<string>(TaskKind.Regression, TextDataViewType.Instance, false); 248ValidateLabelTypeTestCore<string>(TaskKind.Recommendation, TextDataViewType.Instance, false); 264ValidateLabelTypeTestCore<string>(TaskKind.MulticlassClassification, TextDataViewType.Instance, true); 273ValidateLabelTypeTestCore<string>(TaskKind.Ranking, TextDataViewType.Instance, false); 376if (labelType == TextDataViewType.Instance)
Utils\MLNetUtils\DataViewTestFixture.cs (1)
45else if (column.type == TextDataViewType.Instance)
Microsoft.ML.Core (13)
Data\AnnotationBuilderExtensions.cs (1)
19=> builder.Add(AnnotationUtils.Kinds.SlotNames, new VectorDataViewType(TextDataViewType.Instance, size), getter);
Data\AnnotationUtils.cs (9)
145return new VectorDataViewType(TextDataViewType.Instance, size); 270if (columnType is TextDataViewType) 295&& vectorType.ItemType is TextDataViewType; 314&& metaCol.ItemType is TextDataViewType; 345&& metaCol.ItemType == TextDataViewType.Instance; 429cols.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false)); 430cols.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false)); 449if (metaCol.ItemType is TextDataViewType) 450cols.Add(new SchemaShape.Column(Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Data\ColumnTypeExtensions.cs (3)
21(columnType is NumberDataViewType) || (columnType is TextDataViewType) || (columnType is BooleanDataViewType) || 98return TextDataViewType.Instance; 115return TextDataViewType.Instance;
Microsoft.ML.Core.Tests (14)
UnitTests\ColumnTypes.cs (1)
29TextDataViewType.Instance, BooleanDataViewType.Instance, DateTimeDataViewType.Instance, DateTimeOffsetDataViewType.Instance, TimeSpanDataViewType.Instance };
UnitTests\DataTypes.cs (3)
29TextDataViewType.Instance, NumberDataViewType.Single, out bool identity2); 53TextDataViewType.Instance, NumberDataViewType.Double, out bool identity2); 256TextDataViewType.Instance, dstType, out bool identity);
UnitTests\ScoreSchemaTest.cs (5)
68Assert.Equal(TextDataViewType.Instance, (scoreMetadata.Schema[0].Type as VectorDataViewType).ItemType); 69Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[1].Type); 70Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[2].Type); 122Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[0].Type); 123Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[1].Type);
UnitTests\TestEntryPoints.cs (5)
1634Assert.True(type is TextDataViewType, "Binary ensemble scored data does not have correct type of metadata."); 1643Assert.True(type is TextDataViewType, "Regression ensemble scored data does not have correct type of metadata."); 1651Assert.True(type is TextDataViewType, "Anomaly detection ensemble scored data does not have correct type of metadata."); 1794TextDataViewType.Instance, BooleanDataViewType.Instance, labelToBinary); 5407Assert.True(type is VectorDataViewType vecType && vecType.ItemType is TextDataViewType && vecType.Size == 10);
Microsoft.ML.Data (146)
Commands\ScoreCommand.cs (1)
312mapper.OutputSchema.TryGetAnnotation(TextDataViewType.Instance, AnnotationUtils.Kinds.ScoreColumnKind, 0, ref scoreKind) &&
Commands\ShowSchemaCommand.cs (1)
158if (typeNames.GetVectorSize() != type.GetVectorSize() || !(typeNames.GetItemType() is TextDataViewType))
Data\Conversion.cs (1)
454if (!(typeSrc is TextDataViewType))
Data\SchemaAnnotationsExtensions.cs (5)
17/// is of <see cref="TextDataViewType"/>, and further whose <see cref="VectorDataViewType.Size"/> matches 40/// is of <see cref="TextDataViewType"/>, and further whose <see cref="VectorDataViewType.Size"/> matches 45/// though not universal, type to provide is <see cref="TextDataViewType.Instance"/>, so if left unspecified 46/// this will be assumed to have the value <see cref="TextDataViewType.Instance"/>.</param> 55keyValueItemType = TextDataViewType.Instance;
DataLoadSave\Binary\BinaryLoader.cs (1)
636/// should contains a <see cref="DataViewSchema.Column"/> with <see cref="TextDataViewType.Instance"/> as its <see cref="DataViewType"/>.
DataLoadSave\Binary\Codecs.cs (1)
299: base(factory, TextDataViewType.Instance)
DataLoadSave\Text\TextSaver.cs (3)
104if (type is TextDataViewType) 168&& typeNames.Size == type.Size && typeNames.ItemType is TextDataViewType) 423if (typeNames != null && typeNames.Size == vectorType.Size && typeNames.ItemType is TextDataViewType)
DataView\ArrayDataViewBuilder.cs (2)
227meta.AddKeyValues(_columns[i].Type.GetKeyCountAsInt32(_host), TextDataViewType.Instance, keyValueGetter); 441: base(TextDataViewType.Instance, values)
DataView\DataViewConstructionUtils.cs (3)
248Host.Assert(vectorType.ItemType is TextDataViewType); 275Host.Assert(colType is TextDataViewType); 957Contracts.Assert(AnnotationType is TextDataViewType);
DataView\LambdaColumnMapper.cs (2)
127bldr.AddGetter(AnnotationUtils.Kinds.KeyValues, new VectorDataViewType(TextDataViewType.Instance, _typeDst.GetItemType().GetKeyCountAsInt32(Host)), mdGetter); 135bldr.AddGetter(AnnotationUtils.Kinds.SlotNames, new VectorDataViewType(TextDataViewType.Instance, vectorSize), mdGetter);
DataView\TypedCursor.cs (2)
368Ch.Assert(colType.GetItemType() is TextDataViewType); 395Ch.Assert(colType is TextDataViewType);
Deprecated\Instances\HeaderSchema.cs (1)
34_slotNamesType = new VectorDataViewType(TextDataViewType.Instance, collection.Count);
Evaluators\AnomalyDetectionEvaluator.cs (3)
183overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray()); 198topKdvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, topKStratVal.ToArray()); 200topKdvBldr.AddColumn(TopKResultsColumns.Instance, TextDataViewType.Instance, names.ToArray());
Evaluators\BinaryClassifierEvaluator.cs (5)
179vecType.Size > 0 && vecType.ItemType == TextDataViewType.Instance) 338overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray()); 359confDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, confStratVal.ToArray()); 379dvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, prStratVal.ToArray()); 1552schemaBuilder.AddColumn(MetricKinds.ColumnNames.WarningText, TextDataViewType.Instance);
Evaluators\ClusteringEvaluator.cs (2)
205overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray()); 724var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _numClusters);
Evaluators\EvaluatorBase.cs (2)
310dvBldr.AddColumn(MetricKinds.ColumnNames.WarningText, TextDataViewType.Instance, 370if (stratType.GetKeyCount() == 0 && !(stratType is TextDataViewType))
Evaluators\EvaluatorUtils.cs (17)
88if (columnType == null || !(columnType is TextDataViewType)) 100return columnType != null && columnType is TextDataViewType; 142if (col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreValueKind)?.Type == TextDataViewType.Instance) 203if (col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreValueKind)?.Type == TextDataViewType.Instance) 223if (type == null || !(type is TextDataViewType)) 354if (slotNamesType != null && slotNamesType.Size == size && slotNamesType.ItemType is TextDataViewType) 379return LambdaColumnMapper.Create(env, registrationName, input, inputColName, outputColName, typeSrc, TextDataViewType.Instance, 895ReconcileKeyValues(env, views, keyCol, TextDataViewType.Instance); 901ReconcileVectorKeyValues(env, views, vectorKeyCol, TextDataViewType.Instance); 1028if (slotNamesType != null && slotNamesType.Size == vectorType.Size && slotNamesType.ItemType is TextDataViewType) 1237if (keyValuesType == null || !(keyValuesType.ItemType is TextDataViewType) || 1259dvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVals); 1260weightedDvBldr?.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVals); 1271dvBldr.AddColumn(MetricKinds.ColumnNames.FoldIndex, TextDataViewType.Instance, foldVals); 1272weightedDvBldr?.AddColumn(MetricKinds.ColumnNames.FoldIndex, TextDataViewType.Instance, foldVals); 1394host.Assert(type != null && type.IsKnownSize && type.ItemType is TextDataViewType); 1737if (warningTextColumn != null && warningTextColumn.HasValue && warningTextColumn.Value.Type is TextDataViewType)
Evaluators\MulticlassClassificationEvaluator.cs (5)
103if (mdType != null && mdType.IsKnownSize && mdType.ItemType is TextDataViewType) 212overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray()); 236confDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, confStratVal.ToArray()); 813assignedColKeyValues.AddKeyValues(_numClasses, TextDataViewType.Instance, CreateKeyValueGetter()); 823sortedClasses.AddKeyValues(_numClasses, TextDataViewType.Instance, CreateKeyValueGetter());
Evaluators\MultiOutputRegressionEvaluator.cs (5)
149overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray()); 553var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, t.Size); 566builder.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, getter); 568builder.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance, getter); 596if (type != null && type is TextDataViewType)
Evaluators\QuantileRegressionEvaluator.cs (3)
48Host.Check(type != null && type.IsKnownSize && type.ItemType is TextDataViewType, "Quantile regression score column must have slot names"); 75if (slotNamesType != null && slotNamesType.Size == scoreType.Size && slotNamesType.ItemType is TextDataViewType) 355var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _scoreSize);
Evaluators\RankingEvaluator.cs (4)
217overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray()); 228groupDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, groupStratVal.ToArray()); 232groupDvBldr.AddColumn(GroupId, TextDataViewType.Instance, groupName.ToArray()); 643_slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _truncationLevel);
Evaluators\RegressionEvaluatorBase.cs (1)
98overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratVal, TextDataViewType.Instance, stratVal.ToArray());
Prediction\CalibratorCatalog.cs (4)
114kindCol.Kind == scalar && kindCol.ItemType is TextDataViewType && 116valueKindCol.Kind == scalar && valueKindCol.ItemType is TextDataViewType) 290kindCol.Type is TextDataViewType && 292valueKindCol.Type is TextDataViewType)
Scorers\FeatureContributionCalculation.cs (1)
329builder.AddColumn(DefaultColumnNames.FeatureContributions, TextDataViewType.Instance, null);
Scorers\MulticlassClassificationScorer.cs (1)
481return labelNameType is VectorDataViewType vectorType && vectorType.Size == scoreType.GetVectorSize() && vectorType.ItemType == TextDataViewType.Instance;
Scorers\PredictedLabelScorerBase.cs (4)
178yield return TextDataViewType.Instance.GetPair(AnnotationUtils.Kinds.ScoreColumnKind); 181yield return TextDataViewType.Instance.GetPair(AnnotationUtils.Kinds.ScoreValueKind); 201return TextDataViewType.Instance; 203return TextDataViewType.Instance;
Scorers\ScoreSchemaFactory.cs (7)
30metadataBuilder.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, 32metadataBuilder.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance, 63probabilityMetadataBuilder.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, 65probabilityMetadataBuilder.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance, 125metadataBuilder.AddKeyValues(keyNames.Length, TextDataViewType.Instance, 127metadataBuilder.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, 129metadataBuilder.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance,
Transforms\ColumnConcatenatingEstimator.cs (1)
136meta.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Transforms\ColumnConcatenatingTransformer.cs (1)
652if (typeNames != null && typeNames.Size == vectorTypeSrc.Size && typeNames.ItemType is TextDataViewType)
Transforms\Hashing.cs (4)
254_kvTypes[invertIinfos[i]] = new VectorDataViewType(TextDataViewType.Instance, _keyValues[invertIinfos[i]].Length); 445Host.Assert(srcType.ItemType == TextDataViewType.Instance); 1894return itemType is TextDataViewType || itemType is KeyDataViewType || itemType is NumberDataViewType || 1967metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Transforms\InvertHashUtils.cs (4)
362ch.CheckDecode(vectorType.ItemType is TextDataViewType); 393var result = factory.TryGetCodec(new VectorDataViewType(TextDataViewType.Instance), out codec); 397ch.Assert(vectorType.ItemType == TextDataViewType.Instance); 469kvTypesLocal[iinfo] = new VectorDataViewType(TextDataViewType.Instance, keyValuesLocal[iinfo].Length);
Transforms\KeyToValue.cs (3)
475if (TypeOutput is TextDataViewType) 524labelEncoderOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, srcShape), "CastNodeOutput"); 557else if (TypeOutput == TextDataViewType.Instance)
Transforms\KeyToVector.cs (5)
316if (typeNames == null || !typeNames.IsKnownSize || !(typeNames.ItemType is TextDataViewType) || 327var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 339var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 380if (typeSlotSrc != null && typeSlotSrc.Size == typeSrc.Size && typeSlotSrc.ItemType is TextDataViewType) 831if (((colInfo.OutputCountVector && col.IsKey) || col.Kind != SchemaShape.Column.VectorKind.VariableVector) && keyMeta.ItemType is TextDataViewType)
Transforms\SlotsDroppingTransformer.cs (3)
503|| type == NumberDataViewType.Single || type == NumberDataViewType.Double || type is TextDataViewType; 847builder.Add(AnnotationUtils.Kinds.SlotNames, new VectorDataViewType(TextDataViewType.Instance, dstLength), slotNamesGetter); 916if (type == TextDataViewType.Instance)
Transforms\TransformBase.cs (3)
927if (type is TextDataViewType) 934if (type.GetItemType() is TextDataViewType) 941if (type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType)
Transforms\TypeConverting.cs (1)
359if (!(srcItemType is KeyDataViewType) && !(srcItemType is TextDataViewType))
Transforms\ValueMapping.cs (20)
870TextDataViewType.Instance, 1092if (itemType == TextDataViewType.Instance) 1113var labelEncoderOutput = (typeValue == NumberDataViewType.Single || typeValue == TextDataViewType.Instance || typeValue == NumberDataViewType.Int64) ? dstVariableName : 1126CastInputTo<Int64>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1137if (typeValue is TextDataViewType) 1140CastInputTo<Int32>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1144if (typeValue is TextDataViewType) 1147CastInputTo<Int16>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1151if (typeValue is TextDataViewType) 1154CastInputTo<UInt64>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1158if (typeValue is TextDataViewType) 1161CastInputTo<UInt32>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1165if (typeValue is TextDataViewType) 1168CastInputTo<UInt16>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1174CastInputTo<float>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1185CastInputTo<double>(ctx, out node, srcVariableName, opType, labelEncoderOutput, TextDataViewType.Instance); 1189else if (typeKey == TextDataViewType.Instance) 1191if (typeValue == TextDataViewType.Instance) 1200var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, (int)srcShape[1]), "castOutput"); 1258else if (typeValue == TextDataViewType.Instance)
Transforms\ValueToKeyMappingEstimator.cs (1)
196colInfo.AddKeyValueAnnotationsAsText ? TextDataViewType.Instance : col.ItemType, col.IsKey);
Transforms\ValueToKeyMappingTransformer.cs (3)
791var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, (int)srcShape[1]), "castOutput"); 825if (type.Equals(TextDataViewType.Instance)) 963if (!(itemType is TextDataViewType))
Transforms\ValueToKeyMappingTransformerImpl.cs (8)
55if (itemType is TextDataViewType) 105: base(TextDataViewType.Instance) 295Contracts.Assert(type is TextDataViewType || !autoConvert); 587: base(TextDataViewType.Instance, pool.Count) 1047if (IsTextMetadata && !(TypedMap.ItemType is TextDataViewType)) 1060builder.AddKeyValues(TypedMap.OutputType.GetCountAsInt32(_host), TextDataViewType.Instance, getter); 1146if (IsTextMetadata && !(srcMetaType is TextDataViewType)) 1158builder.AddKeyValues(keyCount, TextDataViewType.Instance, mgetter);
Utilities\ColumnCursor.cs (2)
62else if (typeof(T) == typeof(string) && colType is TextDataViewType) 83else if (elementType == typeof(string) && colVectorType.ItemType is TextDataViewType)
Microsoft.ML.DataView (3)
DataViewType.cs (3)
91private static volatile TextDataViewType _instance; 95public static TextDataViewType Instance 114Debug.Assert(!(other is TextDataViewType));
Microsoft.ML.EntryPoints (3)
CrossValidationMacro.cs (1)
378dvBldr.AddColumn(MetricKinds.ColumnNames.WarningText, TextDataViewType.Instance, warn.AsMemory());
FeatureCombiner.cs (1)
124if (type == null || !type.IsKnownSize || !(type.ItemType is TextDataViewType))
ScoreColumnSelector.cs (1)
93if (input.Data.Schema.TryGetAnnotation(TextDataViewType.Instance, AnnotationUtils.Kinds.ScoreValueKind, i,
Microsoft.ML.Fairlearn (2)
Metrics\FairlearnMetricCatalog.cs (2)
62if (sensitiveCol.Type == TextDataViewType.Instance) 192if (column.Type is TextDataViewType)
Microsoft.ML.FastTree (1)
Utils\RegressionTreeBaseUtils.cs (1)
102builder.AddColumn("IsLeaf", TextDataViewType.Instance, isLeaf.ToArray());
Microsoft.ML.ImageAnalytics (4)
ImageLoader.cs (4)
160if (!(inputSchema[srcCol].Type is TextDataViewType)) 161throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, TextDataViewType.Instance.ToString(), inputSchema[srcCol].Type.ToString()); 445if (!(col.ItemType is TextDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar) 446throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColumnName, TextDataViewType.Instance.ToString(), col.GetTypeString());
Microsoft.ML.IntegrationTests (1)
ModelFiles.cs (1)
235inputSchemaDefinition[nameof(ModelInput.CategoricalFeatures)].ColumnType = new VectorDataViewType(TextDataViewType.Instance, 5);
Microsoft.ML.OnnxTransformer (2)
OnnxTransform.cs (1)
628if (vectorType.ItemType is TextDataViewType)
OnnxTypeParser.cs (1)
154scalarType = TextDataViewType.Instance;
Microsoft.ML.Parquet (3)
ParquetLoader.cs (2)
355return TextDataViewType.Instance; 367return TextDataViewType.Instance;
PartitionedFileLoader.cs (1)
629var conv = Conversions.DefaultInstance.GetStandardConversion(TextDataViewType.Instance, type) as ValueMapper<ReadOnlyMemory<char>, TValue>;
Microsoft.ML.PerformanceTests (3)
HashBench.cs (3)
149InitMapMurmurHashV2("Hello".AsMemory(), TextDataViewType.Instance); 200InitDenseVecMap(tokens, TextDataViewType.Instance); 249InitMapMurmurHashV1("Hello".AsMemory(), TextDataViewType.Instance);
Microsoft.ML.Samples (1)
Dynamic\SimpleDataViewImplementation.cs (1)
165builder.AddColumn("Text", TextDataViewType.Instance);
Microsoft.ML.StandardTrainers (1)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
183if (!(labelMetadataType is VectorDataViewType vecType && vecType.ItemType == TextDataViewType.Instance && vecType.Size == _numClasses))
Microsoft.ML.TensorFlow (3)
TensorflowUtils.cs (3)
64metadataBuilder.Add(TensorflowOperatorTypeKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => value = op.OpType.AsMemory()); 75metadataBuilder.Add(TensorflowUpstreamOperatorsKind, new VectorDataViewType(TextDataViewType.Instance, op.NumInputs), 185return TextDataViewType.Instance;
Microsoft.ML.TensorFlow.Tests (6)
TensorflowTests.cs (6)
588Assert.True(metadataType is TextDataViewType); 600Assert.True(metadataType is TextDataViewType); 615Assert.True(metadataType is TextDataViewType); 630Assert.True(metadataType is TextDataViewType); 1373Assert.True(schema.GetColumnOrNull("input1").Value.Type is TextDataViewType); 1375Assert.True(schema.GetColumnOrNull("input2").Value.Type is TextDataViewType);
Microsoft.ML.TestFramework (1)
BaseTestBaseline.cs (1)
723else if (leftType == TextDataViewType.Instance)
Microsoft.ML.TestFrameworkCommon (1)
TestCommon.cs (1)
252if (!(t1.GetItemType() is TextDataViewType))
Microsoft.ML.Tests (8)
Scenarios\Api\TestApi.cs (4)
208var coltypeString = TextDataViewType.Instance; 235Assert.True(idv.Schema[0].Annotations.Schema[1].Type == TextDataViewType.Instance); 239Assert.True(idv.Schema[1].Annotations.Schema[0].Type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType);
SvmLightTests.cs (1)
163new VectorDataViewType(TextDataViewType.Instance, 3));
Transformers\ExpressionTransformerTests.cs (1)
57Assert.True(transformed.Schema["Expr6"].Type.GetItemType() == TextDataViewType.Instance);
Transformers\HashTests.cs (2)
295HashTestCore("".AsMemory(), TextDataViewType.Instance, 0, 0, 0, 0, 0); 296HashTestCore("hello".AsMemory(), TextDataViewType.Instance, 940, 951, 857, 770, 0);
Microsoft.ML.TimeSeries (5)
IidChangePointDetector.cs (1)
271new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)
IidSpikeDetector.cs (1)
247new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)
SRCNNAnomalyDetector.cs (1)
279new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)
SsaChangePointDetector.cs (1)
307new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)
SsaSpikeDetector.cs (1)
286new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)
Microsoft.ML.TorchSharp (37)
AutoFormerV2\ObjectDetectionTrainer.cs (9)
448TextDataViewType.Instance, false)); 453TextDataViewType.Instance, false)); 455TextDataViewType.Instance, false)); 459TextDataViewType.Instance, false)); 554TextDataViewType.Instance, false)); 556TextDataViewType.Instance, false)); 560TextDataViewType.Instance, false)); 759meta.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => { value = AnnotationUtils.Const.ScoreColumnKind.MulticlassClassification.AsMemory(); }); 761meta.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => { value = AnnotationUtils.Const.ScoreValueKind.Score.AsMemory(); });
NasBert\NasBertTrainer.cs (12)
330TextDataViewType.Instance, false)); 345TextDataViewType.Instance, false)); 367if (sentenceCol.ItemType != TextDataViewType.Instance) 369TextDataViewType.Instance.ToString(), sentenceCol.GetTypeString()); 385if (sentenceCol2.ItemType != TextDataViewType.Instance) 387TextDataViewType.Instance.ToString(), sentenceCol2.GetTypeString()); 404if (sentenceCol2.ItemType != TextDataViewType.Instance) 406TextDataViewType.Instance.ToString(), sentenceCol2.GetTypeString()); 423SentenceColumn = new SchemaShape.Column(options.Sentence1ColumnName, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false); 424SentenceColumn2 = options.Sentence2ColumnName == default ? default : new SchemaShape.Column(options.Sentence2ColumnName, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false); 525meta.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => { value = AnnotationUtils.Const.ScoreColumnKind.MulticlassClassification.AsMemory(); }); 527meta.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => { value = AnnotationUtils.Const.ScoreValueKind.Score.AsMemory(); });
Roberta\QATrainer.cs (16)
513TextDataViewType.Instance, false)); 515TextDataViewType.Instance, false)); 520TextDataViewType.Instance, false); 535TextDataViewType.Instance.ToString(), contextCol.GetTypeString()); 541TextDataViewType.Instance.ToString(), questionCol.GetTypeString()); 547TextDataViewType.Instance.ToString(), answerCol.GetTypeString()); 599TextDataViewType.Instance, false), 601TextDataViewType.Instance, false), 607TextDataViewType.Instance, false); 619if (contextCol.ItemType != TextDataViewType.Instance) 621TextDataViewType.Instance.ToString(), contextCol.GetTypeString()); 625if (questionCol.ItemType != TextDataViewType.Instance) 627TextDataViewType.Instance.ToString(), questionCol.GetTypeString()); 741meta.Add(AnnotationUtils.Kinds.ScoreColumnKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => { value = AnnotationUtils.Const.ScoreColumnKind.MulticlassClassification.AsMemory(); }); 743meta.Add(AnnotationUtils.Kinds.ScoreValueKind, TextDataViewType.Instance, (ref ReadOnlyMemory<char> value) => { value = AnnotationUtils.Const.ScoreValueKind.Score.AsMemory(); }); 746info[0] = new DataViewSchema.DetachedColumn(_parent.Options.PredictedAnswerColumnName, new VectorDataViewType(TextDataViewType.Instance));
Microsoft.ML.TorchSharp.Tests (11)
NerTests.cs (3)
77Assert.Equal(TextDataViewType.Instance, estimatorSchema[2].ItemType); 156Assert.Equal(TextDataViewType.Instance, estimatorSchema[2].ItemType); 230Assert.Equal(TextDataViewType.Instance, estimatorSchema[2].ItemType);
QATests.cs (2)
49Assert.Equal(TextDataViewType.Instance, estimatorSchema[4].ItemType); 58Assert.Equal(new VectorDataViewType(TextDataViewType.Instance), transformerSchema[4].Type);
TextClassificationTests.cs (6)
106Assert.Equal(TextDataViewType.Instance, estimatorSchema[3].ItemType); 115Assert.Equal(TextDataViewType.Instance, transformerSchema[3].Type); 244Assert.Equal(TextDataViewType.Instance, estimatorSchema[3].ItemType); 251Assert.Equal(TextDataViewType.Instance, transformerSchema[4].Type); 328Assert.Equal(TextDataViewType.Instance, estimatorSchema[3].ItemType); 335Assert.Equal(TextDataViewType.Instance, transformerSchema[5].Type);
Microsoft.ML.Transforms (50)
CountFeatureSelection.cs (1)
350=> type == NumberDataViewType.Single || type == NumberDataViewType.Double || type is TextDataViewType;
Dracula\CountTableTransformer.cs (1)
341newMetadataKinds.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Expression\LambdaBinder.cs (1)
82node.ResultType = TextDataViewType.Instance;
Expression\Node.cs (1)
662else if (type is TextDataViewType)
HashJoiningTransform.cs (1)
403new VectorDataViewType(TextDataViewType.Instance, ex.SlotMap.Length), GetSlotNames);
KeyToVectorMapping.cs (5)
229if (typeNames == null || !typeNames.IsKnownSize || !(typeNames.ItemType is TextDataViewType) || 244var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 262var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 296if (typeSlotSrc != null && typeSlotSrc.Size == srcVectorSize && typeSlotSrc.ItemType is TextDataViewType) 480if (col.Kind != SchemaShape.Column.VectorKind.VariableVector && keyMeta.ItemType is TextDataViewType)
MissingValueIndicatorTransform.cs (2)
152!(typeNames.ItemType is TextDataViewType)) 200if (typeNames == null || typeNames.Size != srcVectorType.Size || !(typeNames.ItemType is TextDataViewType))
MissingValueReplacing.cs (1)
418var strToT = Data.Conversion.Conversions.DefaultInstance.GetStandardConversion<ReadOnlyMemory<char>, T>(TextDataViewType.Instance, dstType.GetItemType(), out bool identity);
OptionalColumnTransform.cs (1)
568else if ((type == typeof(string)) || (columnType is TextDataViewType))
SvmLight\SvmLightLoader.cs (1)
413bldr.AddColumn("Text", TextDataViewType.Instance);
Text\NgramHashingTransformer.cs (2)
852types[iinfo] = new VectorDataViewType(TextDataViewType.Instance, vec.Length); 1228metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Text\NgramTransform.cs (2)
519var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _parent._ngramMaps[iinfo].Count); 1089metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Text\StopWordsRemovingTransformer.cs (9)
377_types[i] = new VectorDataViewType(TextDataViewType.Instance); 631type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType; 677if (col.Kind == SchemaShape.Column.VectorKind.Scalar || !(col.ItemType is TextDataViewType)) 679result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.VariableVector, TextDataViewType.Instance, false); 773private static readonly DataViewType _outputType = new VectorDataViewType(TextDataViewType.Instance); 871ch.CheckUserArg(typeSrc is TextDataViewType, nameof(Options.StopwordsColumn), "Must be a scalar text column"); 1080_types[i] = new VectorDataViewType(TextDataViewType.Instance); 1245if (col.Kind == SchemaShape.Column.VectorKind.Scalar || !(col.ItemType is TextDataViewType)) 1247result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, SchemaShape.Column.VectorKind.VariableVector, TextDataViewType.Instance, false);
Text\TextFeaturizingEstimator.cs (3)
639if (!(col.ItemType is TextDataViewType)) 644metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 654result[name] = new SchemaShape.Column(name, SchemaShape.Column.VectorKind.VariableVector, TextDataViewType.Instance, false);
Text\TextNormalizing.cs (3)
212_types[i] = srcType is VectorDataViewType ? new VectorDataViewType(TextDataViewType.Instance) : srcType; 333Host.Assert(srcType.GetItemType() is TextDataViewType); 527internal static bool IsColumnTypeValid(DataViewType type) => (type.GetItemType() is TextDataViewType);
Text\TokenizingByCharacters.cs (5)
240dataViewType = new VectorDataViewType(TextDataViewType.Instance, _sourceVectorLength[iinfo]); 242dataViewType = TextDataViewType.Instance; 291builder.AddKeyValues(CharsCount, TextDataViewType.Instance, getter); 646internal static bool IsColumnTypeValid(DataViewType type) => type.GetItemType() is TextDataViewType; 695metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Text\WordBagTransform.cs (3)
191if (!inputSchema.TryFindColumn(_columnName, out SchemaShape.Column outCol) && outCol.ItemType != TextDataViewType.Instance) 296new DataViewSchema.DetachedColumn(_parent._columnName, TextDataViewType.Instance) 476colShape.ItemType is TextDataViewType)
Text\WordEmbeddingsExtractor.cs (4)
304if (!(colType is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType)) 558Host.Assert(column.Type.GetItemType() is TextDataViewType); 938if (!(col.ItemType is TextDataViewType) || (col.Kind != SchemaShape.Column.VectorKind.VariableVector && col.Kind != SchemaShape.Column.VectorKind.Vector)) 939throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName, new VectorDataViewType(TextDataViewType.Instance).ToString(), col.GetTypeString());
Text\WordTokenizing.cs (4)
212_type = new VectorDataViewType(TextDataViewType.Instance); 242Host.Assert(srcType.GetItemType() is TextDataViewType); 420var reshapeOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, 1), column.Name); 454internal static bool IsColumnTypeValid(DataViewType type) => type.GetItemType() is TextDataViewType;
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
638TextDataViewType.Instance, false));