public static void PrintSentences(SentenceSegmenter segmenter, IEnumerable<string> paragraphs) { foreach (var paragraph in paragraphs) { PrintSentences(segmenter, paragraph); } }
public static DetailedEvaluation Evaluate(this SentenceSegmenter segmenter, string taggedParagraph, string tag = "#") { IEnumerable <int> realIndices = GetBoundaryIndices(taggedParagraph, tag); string untaggedParagraph = taggedParagraph.Replace(tag, ""); return(Evaluate(segmenter, untaggedParagraph, realIndices)); }
public static IEnumerable <DetailedEvaluation> Evaluate(this SentenceSegmenter segmenter, IEnumerable <string> taggedParagraphs, string tag = "#") { var evaluations = new List <DetailedEvaluation>(); foreach (string taggedParagraph in taggedParagraphs) { evaluations.Add(Evaluate(segmenter, taggedParagraph)); } return(evaluations); }
public static DetailedEvaluation Evaluate(this SentenceSegmenter segmenter, string paragraph, IEnumerable <int> realBoundaryIndices) { IEnumerable <int> predictedIndices = segmenter.GetBoundaryIndices(paragraph); // ReSharper disable PossibleMultipleEnumeration IEnumerable <int> misses = realBoundaryIndices.Except(predictedIndices); IEnumerable <int> falseAlarms = predictedIndices.Except(realBoundaryIndices); IEnumerable <int> hits = realBoundaryIndices.Intersect(predictedIndices); // ReSharper restore PossibleMultipleEnumeration int eosCandidateCount = GetEosCharCount(segmenter.EosCandidates, paragraph); return(new DetailedEvaluation(hits, misses, falseAlarms, eosCandidateCount, paragraph)); }
public static void PrintSentences(SentenceSegmenter segmenter, string paragraph) { var sentences = segmenter.GetSentences(paragraph); foreach (var sentence in sentences) { Console.WriteLine(sentence); } }
public static void EvaluateSbd(SentenceSegmenter segmenter) { var taggedParagraphs = File.ReadAllLines(TaggedInput); var evaluations = segmenter.Evaluate(taggedParagraphs); SentenceSegmenterEvaluator.GetTotalReport(evaluations, printFalseAlarms: true); }
public SentenceIterator(SentenceSegmenter segmenter, string paragraph) { _paragraph = paragraph; _segmenter = segmenter; }