Exemple #1
0
        static public Result GetResult(ICollection <Annotation> annotations, GoldType goldType)
        {
            switch (goldType)
            {
            case GoldType.Joint:
                return(GenerateJointJointResult(annotations));

            case GoldType.JointOnlyOne:
                return(GenerateJointOnlyOneResult(annotations));

            case GoldType.SeparateOverTrueLabelNumber:
                return(GenerateSeparateOverTrueLabelNumberResult(annotations));

            case GoldType.SeparateOverHalf:
                return(GenerateSeparateOverHalfResult(annotations));

            case GoldType.SeperateOverTrueLabelNumberAndHalf:
                return(JointTwoResults(GoldstandardFunction.GenerateSeparateOverTrueLabelNumberResult(annotations), GoldstandardFunction.GenerateSeparateOverHalfResult(annotations)));

            case GoldType.SeperateOverTrueLabelNumberAndHalfAndJoint:
                return(JointThreeResults(GoldstandardFunction.GenerateSeparateOverTrueLabelNumberResult(annotations), GoldstandardFunction.GenerateSeparateOverHalfResult(annotations), GoldstandardFunction.GenerateJointJointResult(annotations)));

            default:
                return(new Result());
            }
        }
Exemple #2
0
 //得到依赖黄金标准(最多一项,Majority Vote)
 static private void MajorityVoteGold(string allOrReminded)
 {
     foreach (Sentence sentence in Variable.Sentences)
     {
         ICollection <Annotation> annotations = new List <Annotation>();
         foreach (Annotator annotator in Variable.Annotators)
         {
             if (Variable.Data[annotator].ContainsKey(sentence))
             {
                 foreach (Annotation annotation in Variable.Data[annotator][sentence])
                 {
                     annotations.Add(annotation);//取到当前句子的所有标注
                 }
             }
         }
         sentence.BinaryGold = GoldstandardFunction.GetResult(annotations, Variable.GoldType);
     }
     Function.WriteGoldToFile(allOrReminded);
 }