Beispiel #1
0
 /// <summary>
 /// Initializes the resolvers used by this linker.
 /// </summary>
 /// <param name="mode">
 /// The mode in which this linker is being used.
 /// </param>
 /// <param name="fixedNonReferentialProbability">
 /// </param>
 protected internal virtual void InitializeResolvers(LinkerMode mode, double fixedNonReferentialProbability)
 {
     if (mode == LinkerMode.Train)
     {
         MentionFinder.PrenominalNamedEntitiesCollection = false;
         MentionFinder.CoordinatedNounPhrasesCollection  = false;
     }
     SingularPronounIndex = 0;
     if (LinkerMode.Test == mode || LinkerMode.Eval == mode)
     {
         if (fixedNonReferentialProbability < 0)
         {
             Resolvers = new MaximumEntropyResolver[] { new SingularPronounResolver(CoreferenceProjectName, ResolverMode.Test), new ProperNounResolver(CoreferenceProjectName, ResolverMode.Test), new DefiniteNounResolver(CoreferenceProjectName, ResolverMode.Test), new IsAResolver(CoreferenceProjectName, ResolverMode.Test), new PluralPronounResolver(CoreferenceProjectName, ResolverMode.Test), new PluralNounResolver(CoreferenceProjectName, ResolverMode.Test), new CommonNounResolver(CoreferenceProjectName, ResolverMode.Test), new SpeechPronounResolver(CoreferenceProjectName, ResolverMode.Test) };
         }
         else
         {
             INonReferentialResolver nrr = new FixedNonReferentialResolver(fixedNonReferentialProbability);
             Resolvers = new MaximumEntropyResolver[] { new SingularPronounResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new ProperNounResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new DefiniteNounResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new IsAResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new PluralPronounResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new PluralNounResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new CommonNounResolver(CoreferenceProjectName, ResolverMode.Test, nrr), new SpeechPronounResolver(CoreferenceProjectName, ResolverMode.Test, nrr) };
         }
         if (LinkerMode.Eval == mode)
         {
             //String[] names = {"Pronoun", "Proper", "Def-NP", "Is-a", "Plural Pronoun"};
             //eval = new Evaluation(names);
         }
         MaximumEntropyResolver.SimilarityModel = SimilarityModel.TestModel(CoreferenceProjectName + "/sim");
     }
     else if (LinkerMode.Train == mode)
     {
         Resolvers    = new AbstractResolver[9];
         Resolvers[0] = new SingularPronounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[1] = new ProperNounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[2] = new DefiniteNounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[3] = new IsAResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[4] = new PluralPronounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[5] = new PluralNounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[6] = new CommonNounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[7] = new SpeechPronounResolver(CoreferenceProjectName, ResolverMode.Train);
         Resolvers[8] = new PerfectResolver();
     }
     else
     {
         System.Console.Error.WriteLine("DefaultLinker: Invalid Mode");
     }
 }
Beispiel #2
0
 public static void GetMappings(AbstractResolver container)
 {
     container.For<IRepositorioDeClientes>().Use<ClienteDao>();
 }