Skip to content

Commit 9e16af7

Browse files
committed
Fixed warning in example [skip ci]
1 parent 2d752b3 commit 9e16af7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/TopicModeling/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class LdaInput
99

1010
class LdaOutput
1111
{
12-
public float[] Features { get; set; }
12+
public float[]? Features { get; set; }
1313
}
1414

1515
class Program
@@ -86,6 +86,6 @@ private static float[][] GenerateEmbeddings(string[] texts)
8686
.Append(mlContext.Transforms.Text.LatentDirichletAllocation("Features", "Tokens", numberOfTopics: 20));
8787
var model = pipeline.Fit(dataView);
8888
var engine = mlContext.Model.CreatePredictionEngine<LdaInput, LdaOutput>(model);
89-
return input.Select((v) => engine.Predict(v).Features).ToArray();
89+
return input.Select((v) => engine.Predict(v).Features!).ToArray();
9090
}
9191
}

0 commit comments

Comments
 (0)