Пример #1
0
 public IsAResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "/imodel", mode, 20, nonReferentialResolver)
 {
     ShowExclusions = false;
     //predicativePattern = Pattern.compile("^(,|am|are|is|was|were|--)$");
     predicativePattern = new Regex("^(,|--)$");
 }
 public SpeechPronounResolver(string projectName, ResolverMode mode)
     : base(projectName, "fmodel", mode, 30)
 {
     NumberSentencesBack = 0;
     ShowExclusions = false;
     PreferFirstReferent = true;
 }
Пример #3
0
 public IsAResolver(string projectName, ResolverMode mode)
     : base(projectName, "/imodel", mode, 20)
 {
     ShowExclusions = false;
     //predicativePattern = Pattern.compile("^(,|am|are|is|was|were|--)$");
     predicativePattern = new Regex("^(,|--)$", RegexOptions.Compiled);
 }
 public static SingletonNonReferentialResolver GetInstance(string modelName, ResolverMode mode)
 {
     if (mResolver == null)
     {
         mResolver = new SingletonNonReferentialResolver(modelName, mode);
     }
     return(mResolver);
 }
 public static SingletonNonReferentialResolver GetInstance(string modelName, ResolverMode mode)
 {
     if (mResolver == null)
     {
         mResolver = new SingletonNonReferentialResolver(modelName, mode);
     }
     return mResolver;
 }
Пример #6
0
 public ProperNounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver) : base(projectName, "pnmodel", mode, 500, nonReferentialResolver)
 {
     if (!_acroMapLoaded)
     {
         initAcronyms(projectName + "/acronyms");
         _acroMapLoaded = true;
     }
     ShowExclusions = false;
 }
Пример #7
0
 public ProperNounResolver(string projectName, ResolverMode mode) : base(projectName, "pnmodel", mode, 500)
 {
     if (!acroMapLoaded)
     {
         initAcronyms(projectName + "/acronyms");
         acroMapLoaded = true;
     }
     ShowExclusions = false;
 }
Пример #8
0
		public ProperNounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver):base(projectName, "pnmodel", mode, 500, nonReferentialResolver)
		{
			if (!_acroMapLoaded)
			{
				initAcronyms(projectName + "/acronyms");
				_acroMapLoaded = true;
			}
			ShowExclusions = false;
		}
 public ProperNounResolver(string projectName, ResolverMode mode)
     : base(projectName, "pnmodel", mode, 500)
 {
     if (!acroMapLoaded)
     {
         initAcronyms(projectName + "/acronyms");
         acroMapLoaded = true;
     }
     ShowExclusions = false;
 }
 public DefaultNonReferentialResolver(string projectName, string name, ResolverMode mode)
 {
     mResolverMode = mode;
     mModelName    = projectName + "\\" + name + "_nr";
     if (mode == ResolverMode.Train)
     {
         mEvents = new List <SharpEntropy.TrainingEvent>();
     }
     else if (mode == ResolverMode.Test)
     {
         mModel = new SharpEntropy.GisModel(new SharpEntropy.IO.BinaryGisModelReader(mModelName + mModelExtension));
         mNonReferentialIndex = mModel.GetOutcomeIndex(MaximumEntropyResolver.Same);
     }
     else
     {
         throw new ArgumentException("unexpected mode " + mode);
     }
 }
        public DefaultNonReferentialResolver(string projectName, string name, ResolverMode mode)
        {
            mResolverMode = mode;
            mModelName = projectName + Path.DirectorySeparatorChar + name + "_nr";
            if (mode == ResolverMode.Train)
            {
                mEvents = new List<SharpEntropy.TrainingEvent>();
            }
            else if (mode == ResolverMode.Test)
            {

                mModel = new SharpEntropy.GisModel(new SharpEntropy.IO.BinaryGisModelReader(mModelName + mModelExtension));
                mNonReferentialIndex = mModel.GetOutcomeIndex(MaximumEntropyResolver.Same);
            }
            else
            {
                throw new ArgumentException("unexpected mode " + mode);
            }
        }
Пример #12
0
 /// <summary>
 /// Creates a maximum-entropy-based resolver with the specified model name, using the
 /// specified mode, which will look the specified number of entities back for a referent and
 /// prefer the first referent if specified.
 /// </summary>
 /// <param name="modelDirectory">
 /// The name of the directory where the resover models are stored.
 /// </param>
 /// <param name="name">
 /// The name of the file where this model will be read or written.
 /// </param>
 /// <param name="mode">
 /// The mode this resolver is being using in (training, testing).
 /// </param>
 /// <param name="numberOfEntitiesBack">
 /// The number of entities back in the text that this resolver will look
 /// for a referent.
 /// </param>
 /// <param name="preferFirstReferent">
 /// Set to true if the resolver should prefer the first referent which is more
 /// likly than non-reference.  This only affects testing.
 /// </param>
 /// <param name="nonReferentialResolver">
 /// Determines how likly it is that this entity is non-referential.
 /// </param>
 protected MaximumEntropyResolver(string modelDirectory, string name, ResolverMode mode, int numberOfEntitiesBack, bool preferFirstReferent, INonReferentialResolver nonReferentialResolver) : base(numberOfEntitiesBack)
 {
     mPreferFirstReferent    = preferFirstReferent;
     mNonReferentialResolver = nonReferentialResolver;
     mResolverMode           = mode;
     mModelName = modelDirectory + "/" + name;
     if (mResolverMode == ResolverMode.Test)
     {
         mModel     = new SharpEntropy.GisModel(new SharpEntropy.IO.BinaryGisModelReader(mModelName + mModelExtension));
         mSameIndex = mModel.GetOutcomeIndex(Same);
     }
     else if (mResolverMode == ResolverMode.Train)
     {
         mEvents = new List <SharpEntropy.TrainingEvent>();
     }
     else
     {
         System.Console.Error.WriteLine("Unknown mode: " + mResolverMode);
     }
     //add one for non-referent possibility
     mCandidateProbabilities = new double[GetNumberEntitiesBack() + 1];
 }
 public PluralNounResolver(string projectName, ResolverMode mode)
     : base(projectName, "plmodel", mode, 80, true)
 {
     ShowExclusions = false;
 }
Пример #14
0
 public PluralNounResolver(string projectName, ResolverMode mode) : base(projectName, "plmodel", mode, 80, true)
 {
     ShowExclusions = false;
 }
Пример #15
0
 public PluralNounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver) : base(projectName, "plmodel", mode, 80, true, nonReferentialResolver)
 {
     ShowExclusions = false;
 }
Пример #16
0
 public SpeechPronounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "fmodel", mode, 30, nonReferentialResolver)
 {
     ShowExclusions      = false;
     PreferFirstReferent = true;
 }
Пример #17
0
 public CommonNounResolver(string projectName, ResolverMode resolverMode, INonReferentialResolver nonReferentialResolver) : base(projectName, "cmodel", resolverMode, 80, true, nonReferentialResolver)
 {
     ShowExclusions      = false;
     PreferFirstReferent = true;
 }
Пример #18
0
 public SingularPronounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver) : base(projectName, "pmodel", mode, 30, nonReferentialResolver)
 {
     NumberSentencesBack = 2;
 }
Пример #19
0
 public IsAResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver) : base(projectName, "/imodel", mode, 20, nonReferentialResolver)
 {
     ShowExclusions = false;
     //predicativePattern = Pattern.compile("^(,|am|are|is|was|were|--)$");
     predicativePattern = new Regex("^(,|--)$");
 }
Пример #20
0
 /// <summary>
 /// Creates a maximum-entropy-based resolver with the specified model name, using the
 /// specified mode, which will look the specified number of entities back for a referent.
 /// </summary>
 /// <param name="modelDirectory">
 /// The name of the directory where the resolver models are stored.
 /// </param>
 /// <param name="modelName">
 /// The name of the file where this model will be read or written.
 /// </param>
 /// <param name="mode">
 /// The mode this resolver is being using in (training, testing).
 /// </param>
 /// <param name="numberEntitiesBack">
 /// The number of entities back in the text that this resolver will look
 /// for a referent.
 /// </param>
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack) : this(modelDirectory, modelName, mode, numberEntitiesBack, false)
 {
 }
Пример #21
0
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack, bool preferFirstReferent) : this(modelDirectory, modelName, mode, numberEntitiesBack, preferFirstReferent, new DefaultNonReferentialResolver(modelDirectory, modelName, mode))
 {
 }
Пример #22
0
 public PluralPronounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "tmodel", mode, 30, nonReferentialResolver)
 {
 }
 private SingletonNonReferentialResolver(string projectName, ResolverMode mode) : base(projectName, "nonref", mode)
 {
 }
Пример #24
0
 public PluralPronounResolver(string projectName, ResolverMode mode)
     : base(projectName, "tmodel", mode, 30)
 {
 }
 public DefiniteNounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "defmodel", mode, 80, nonReferentialResolver)
 {
     //preferFirstReferent = true;
 }
Пример #26
0
 public IsAResolver(string projectName, ResolverMode mode) : base(projectName, "/imodel", mode, 20)
 {
     ShowExclusions = false;
     //predicativePattern = Pattern.compile("^(,|am|are|is|was|were|--)$");
     predicativePattern = new Regex("^(,|--)$", RegexOptions.Compiled);
 }
 public PluralNounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "plmodel", mode, 80, true, nonReferentialResolver)
 {
     ShowExclusions = false;
 }
 private SingletonNonReferentialResolver(string projectName, ResolverMode mode)
     : base(projectName, "nonref", mode)
 {
 }
Пример #29
0
 public SingularPronounResolver(string projectName, ResolverMode mode) : base(projectName, "pmodel", mode, 30)
 {
     NumberSentencesBack = 2;
 }
Пример #30
0
 public PluralPronounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver) : base(projectName, "tmodel", mode, 30, nonReferentialResolver)
 {
 }
 public SpeechPronounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "fmodel", mode, 30, nonReferentialResolver)
 {
     ShowExclusions = false;
     PreferFirstReferent = true;
 }
Пример #32
0
 public DefiniteNounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "defmodel", mode, 80, nonReferentialResolver)
 {
     //preferFirstReferent = true;
 }
Пример #33
0
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack, INonReferentialResolver nonReferentialResolver) : this(modelDirectory, modelName, mode, numberEntitiesBack, false, nonReferentialResolver)
 {
 }
 /// <summary>
 /// Creates a maximum-entropy-based resolver with the specified model name, using the 
 /// specified mode, which will look the specified number of entities back for a referent and
 /// prefer the first referent if specified.
 /// </summary>
 /// <param name="modelDirectory">
 /// The name of the directory where the resover models are stored.
 /// </param>
 /// <param name="name">
 /// The name of the file where this model will be read or written.
 /// </param>
 /// <param name="mode">
 /// The mode this resolver is being using in (training, testing).
 /// </param>
 /// <param name="numberOfEntitiesBack">
 /// The number of entities back in the text that this resolver will look
 /// for a referent.
 /// </param>
 /// <param name="preferFirstReferent">
 /// Set to true if the resolver should prefer the first referent which is more
 /// likly than non-reference.  This only affects testing.
 /// </param>
 /// <param name="nonReferentialResolver">
 /// Determines how likly it is that this entity is non-referential.
 /// </param>
 protected MaximumEntropyResolver(string modelDirectory, string name, ResolverMode mode, int numberOfEntitiesBack, bool preferFirstReferent, INonReferentialResolver nonReferentialResolver)
     : base(numberOfEntitiesBack)
 {
     mPreferFirstReferent = preferFirstReferent;
     mNonReferentialResolver = nonReferentialResolver;
     mResolverMode = mode;
     mModelName = modelDirectory + "/" + name;
     if (mResolverMode == ResolverMode.Test)
     {
         mModel = new SharpEntropy.GisModel(new SharpEntropy.IO.BinaryGisModelReader(mModelName + mModelExtension));
         mSameIndex = mModel.GetOutcomeIndex(Same);
     }
     else if (mResolverMode == ResolverMode.Train)
     {
         mEvents = new List<SharpEntropy.TrainingEvent>();
     }
     else
     {
         System.Console.Error.WriteLine("Unknown mode: " + mResolverMode);
     }
     //add one for non-referent possibility
     mCandidateProbabilities = new double[GetNumberEntitiesBack() + 1];
 }
Пример #35
0
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack, bool preferFirstReferent, double nonReferentialProbability) : this(modelDirectory, modelName, mode, numberEntitiesBack, preferFirstReferent, new FixedNonReferentialResolver(nonReferentialProbability))
 {
 }
 public SingularPronounResolver(string projectName, ResolverMode mode)
     : base(projectName, "pmodel", mode, 30)
 {
     NumberSentencesBack = 2;
 }
Пример #37
0
 public PluralPronounResolver(string projectName, ResolverMode mode) : base(projectName, "tmodel", mode, 30)
 {
 }
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack, bool preferFirstReferent)
     : this(modelDirectory, modelName, mode, numberEntitiesBack, preferFirstReferent, new DefaultNonReferentialResolver(modelDirectory, modelName, mode))
 {
 }
Пример #39
0
 public SpeechPronounResolver(string projectName, ResolverMode mode) : base(projectName, "fmodel", mode, 30)
 {
     NumberSentencesBack = 0;
     ShowExclusions      = false;
     PreferFirstReferent = true;
 }
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack, bool preferFirstReferent, double nonReferentialProbability)
     : this(modelDirectory, modelName, mode, numberEntitiesBack, preferFirstReferent, new FixedNonReferentialResolver(nonReferentialProbability))
 {
 }
 /// <summary>
 /// Creates a maximum-entropy-based resolver with the specified model name, using the 
 /// specified mode, which will look the specified number of entities back for a referent.
 /// </summary>
 /// <param name="modelDirectory">
 /// The name of the directory where the resolver models are stored.
 /// </param>
 /// <param name="modelName">
 /// The name of the file where this model will be read or written.
 /// </param>
 /// <param name="mode">
 /// The mode this resolver is being using in (training, testing).
 /// </param>
 /// <param name="numberEntitiesBack">
 /// The number of entities back in the text that this resolver will look
 /// for a referent.
 /// </param>
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack)
     : this(modelDirectory, modelName, mode, numberEntitiesBack, false)
 {
 }
 public CommonNounResolver(string projectName, ResolverMode resolverMode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "cmodel", resolverMode, 80, true, nonReferentialResolver)
 {
     ShowExclusions = false;
     PreferFirstReferent = true;
 }
 public SingularPronounResolver(string projectName, ResolverMode mode, INonReferentialResolver nonReferentialResolver)
     : base(projectName, "pmodel", mode, 30, nonReferentialResolver)
 {
     NumberSentencesBack = 2;
 }
 protected MaximumEntropyResolver(string modelDirectory, string modelName, ResolverMode mode, int numberEntitiesBack, INonReferentialResolver nonReferentialResolver)
     : this(modelDirectory, modelName, mode, numberEntitiesBack, false, nonReferentialResolver)
 {
 }