Files
llm-pii-poc/tests/PiiRedaction.Infrastructure.Tests/Onnx/NerLabelConfigTests.cs

29 lines
856 B
C#
Raw Normal View History

using FluentAssertions;
using PiiRedaction.Core.Detection;
using PiiRedaction.Core.Models;
using PiiRedaction.Infrastructure.Onnx;
namespace PiiRedaction.Infrastructure.Tests.Onnx;
[TestFixture]
public sealed class NerLabelConfigTests
{
[TestCase("B-PER", true)]
[TestCase("I-PER", true)]
[TestCase("B-PERSON", true)]
[TestCase("B-ORG", false)]
public void English_IsPersonLabel_MatchesExpected(string label, bool expected)
{
NerLabelConfig.English.IsPersonLabel(label).Should().Be(expected);
}
[TestCase("B-person-politician", true)]
[TestCase("I-person-artist", true)]
[TestCase("B-location", false)]
[TestCase("O", false)]
public void Tamil_IsPersonLabel_MatchesFineGrainedTags(string label, bool expected)
{
NerLabelConfig.Tamil.IsPersonLabel(label).Should().Be(expected);
}
}