2 instantiations of NGram
Microsoft.Extensions.AI.Evaluation.NLP (2)
Common\NGramExtensions.cs (2)
15
where T : IEquatable<T> =>
new
(values);
34
yield return new
NGram
<T>(output);
10 references to NGram
Microsoft.Extensions.AI.Evaluation.NLP (10)
Common\BLEUAlgorithm.cs (5)
71
var hypCounts = new MatchCounter<
NGram
<string>>(hyp);
73
Dictionary<
NGram
<string>, int> maxCounts = [];
77
IEnumerable<
NGram
<string>> refGrams = rf.CreateNGrams(n);
78
var refCounts = new MatchCounter<
NGram
<string>>(refGrams);
93
Dictionary<
NGram
<string>, int> clippedCounts = [];
Common\NGram.cs (3)
16
internal readonly struct NGram<T> : IEquatable<
NGram
<T>>, IEnumerable<T>
34
public bool Equals(
NGram
<T> other)
37
public override bool Equals(object? obj) => obj is
NGram
<T> other && Equals(other);
Common\NGramExtensions.cs (2)
14
public static
NGram
<T> CreateNGram<T>(this ReadOnlySpan<T> values)
22
internal static IEnumerable<
NGram
<T>> CreateNGrams<T>(this IEnumerable<T> input, int n)