Пример #1
0
        private string IdentifyCoreferents(IEnumerable <string> sentences)
        {
            if (_coreferenceFinder == null)
            {
                _coreferenceFinder = new OpenNLP.Tools.Lang.English.TreebankLinker(_modelPath + "coref");
            }

            var parsedSentences = new List <OpenNLP.Tools.Parser.Parse>();

            foreach (string sentence in sentences)
            {
                OpenNLP.Tools.Parser.Parse sentenceParse = ParseSentence(sentence);
                parsedSentences.Add(sentenceParse);
            }
            return(_coreferenceFinder.GetCoreferenceParse(parsedSentences.ToArray()));
        }
Пример #2
0
        private string IdentifyCoreferents(string[] sentences)
        {
            if (mCoreferenceFinder == null)
            {
                mCoreferenceFinder = new OpenNLP.Tools.Lang.English.TreebankLinker(mModelPath + "coref");
            }

            System.Collections.Generic.List <OpenNLP.Tools.Parser.Parse> parsedSentences = new System.Collections.Generic.List <OpenNLP.Tools.Parser.Parse>();

            foreach (string sentence in sentences)
            {
                OpenNLP.Tools.Parser.Parse sentenceParse = ParseSentence(sentence);
                string findNames = FindNames(sentenceParse);
                parsedSentences.Add(sentenceParse);
            }
            return(mCoreferenceFinder.GetCoreferenceParse(parsedSentences.ToArray()));
        }
Пример #3
0
        public static string IdentifyCoreferents(string[] sentences)
        {
            if (mCoreferenceFinder == null)
            {
                mCoreferenceFinder = new OpenNLP.Tools.Lang.English.TreebankLinker(mModelPath + "coref");
            }

            System.Collections.Generic.List<OpenNLP.Tools.Parser.Parse> parsedSentences = new System.Collections.Generic.List<OpenNLP.Tools.Parser.Parse>();

            foreach (string sentence in sentences)
            {
                OpenNLP.Tools.Parser.Parse sentenceParse = ParseSentence(sentence);
                string findNames = FindNames(sentenceParse);
                parsedSentences.Add(sentenceParse);
            }
            return mCoreferenceFinder.GetCoreferenceParse(parsedSentences.ToArray());
        }
Пример #4
0
        private string IdentifyCoreferents(IEnumerable<string> sentences)
        {
            if (_coreferenceFinder == null)
            {
                _coreferenceFinder = new OpenNLP.Tools.Lang.English.TreebankLinker(_modelPath + "coref");
            }

            var parsedSentences = new List<OpenNLP.Tools.Parser.Parse>();

            foreach (string sentence in sentences)
            {
                OpenNLP.Tools.Parser.Parse sentenceParse = ParseSentence(sentence);
                parsedSentences.Add(sentenceParse);
            }
            return _coreferenceFinder.GetCoreferenceParse(parsedSentences.ToArray());
        }