コード例 #1
0
        /// <summary>Skip this mention? (search pruning)</summary>
        public virtual bool SkipThisMention(Document document, Mention m1, CorefCluster c, Dictionaries dict)
        {
            bool skip = false;

            // only do for the first mention in its cluster
            //    if(!flags.USE_EXACTSTRINGMATCH && !flags.USE_ROLEAPPOSITION && !flags.USE_PREDICATENOMINATIVES
            if (!flags.UseRoleapposition && !flags.UsePredicatenominatives && !flags.UseAcronym && !flags.UseApposition && !flags.UseRelativepronoun && !c.GetFirstMention().Equals(m1))
            {
                // CHINESE CHANGE
                return(true);
            }
            if (m1.appositions == null && m1.predicateNominatives == null && (m1.LowercaseNormalizedSpanString().StartsWith("a ") || m1.LowercaseNormalizedSpanString().StartsWith("an ")) && !flags.UseExactstringmatch)
            {
                skip = true;
            }
            // A noun phrase starting with an indefinite article - unlikely to have an antecedent (e.g. "A commission" was set up to .... )
            if (dict.indefinitePronouns.Contains(m1.LowercaseNormalizedSpanString()))
            {
                skip = true;
            }
            // An indefinite pronoun - unlikely to have an antecedent (e.g. "Some" say that... )
            foreach (string indef in dict.indefinitePronouns)
            {
                if (m1.LowercaseNormalizedSpanString().StartsWith(indef + " "))
                {
                    skip = true;
                    // A noun phrase starting with an indefinite adjective - unlikely to have an antecedent (e.g. "Another opinion" on the topic is...)
                    break;
                }
            }
            return(skip);
        }
コード例 #2
0
        /// <summary>Skip this mention? (search pruning)</summary>
        public virtual bool SkipThisMention(Document document, Mention m1, CorefCluster c, Dictionaries dict)
        {
            bool skip = false;

            // only do for the first mention in its cluster
            if (!flags.UseExactstringmatch && !flags.UseRoleapposition && !flags.UsePredicatenominatives && !flags.UseAcronym && !flags.UseApposition && !flags.UseRelativepronoun && !c.GetFirstMention().Equals(m1))
            {
                return(true);
            }
            SieveCoreferenceSystem.logger.Finest("DOING COREF FOR:\t" + m1.SpanToString());
            if (m1.appositions == null && m1.predicateNominatives == null && (m1.LowercaseNormalizedSpanString().StartsWith("a ") || m1.LowercaseNormalizedSpanString().StartsWith("an ")) && !flags.UseExactstringmatch)
            {
                skip = true;
            }
            // A noun phrase starting with an indefinite article - unlikely to have an antecedent (e.g. "A commission" was set up to .... )
            if (dict.indefinitePronouns.Contains(m1.LowercaseNormalizedSpanString()))
            {
                skip = true;
            }
            // An indefinite pronoun - unlikely to have an antecedent (e.g. "Some" say that... )
            foreach (string indef in dict.indefinitePronouns)
            {
                if (m1.LowercaseNormalizedSpanString().StartsWith(indef + " "))
                {
                    skip = true;
                    // A noun phrase starting with an indefinite adjective - unlikely to have an antecedent (e.g. "Another opinion" on the topic is...)
                    break;
                }
            }
            if (skip)
            {
                SieveCoreferenceSystem.logger.Finest("MENTION SKIPPED:\t" + m1.SpanToString() + "(" + m1.sentNum + ")" + "\toriginalRef: " + m1.originalRef + " in discourse " + m1.headWord.Get(typeof(CoreAnnotations.UtteranceAnnotation)));
            }
            return(skip);
        }