public void Add(ParserEvaluationScore parserEvaluationScore) { LAS = (LAS * wordCount + parserEvaluationScore.LAS * parserEvaluationScore.wordCount) / (wordCount + parserEvaluationScore.wordCount); UAS = (UAS * wordCount + parserEvaluationScore.UAS * parserEvaluationScore.wordCount) / (wordCount + parserEvaluationScore.wordCount); LS = (LS * wordCount + parserEvaluationScore.LS * parserEvaluationScore.wordCount) / (wordCount + parserEvaluationScore.wordCount); wordCount += parserEvaluationScore.wordCount; }
public ParserEvaluationScore CompareParses(UniversalDependencyTreeBankCorpus corpus) { var score = new ParserEvaluationScore(); for (var i = 0; i < sentences.Count; i++) { score.Add(((UniversalDependencyTreeBankSentence)sentences[i]).CompareParses( (UniversalDependencyTreeBankSentence)corpus.GetSentence(i))); } return(score); }
public ParserEvaluationScore CompareParses(UniversalDependencyTreeBankSentence sentence) { var score = new ParserEvaluationScore(); for (var i = 0; i < words.Count; i++) { var relation1 = ((UniversalDependencyTreeBankWord)words[i]).GetRelation(); var relation2 = ((UniversalDependencyTreeBankWord)sentence.GetWord(i)).GetRelation(); if (relation1 != null && relation2 != null) { score.Add(relation1.CompareRelations(relation2)); } } return(score); }