예제 #1
0
        public static string PrintConllOutput(Document document, bool gold, bool filterSingletons)
        {
            IList <IList <Mention> > orderedMentions = gold ? document.goldMentions : document.predictedMentions;

            if (filterSingletons)
            {
                orderedMentions = orderedMentions.Stream().Map(null).Collect(Collectors.ToList());
            }
            return(CorefPrinter.PrintConllOutput(document, orderedMentions, gold));
        }
예제 #2
0
            public void Process(int id, Document document)
            {
                writerGold.Print(CorefPrinter.PrintConllOutput(document, true));
                writerBeforeCoref.Print(CorefPrinter.PrintConllOutput(document, false));
                long time = Runtime.CurrentTimeMillis();

                this._enclosing.corefAlgorithm.RunCoref(document);
                if (this._enclosing.verbose)
                {
                    Redwood.Log(this.GetName(), "Coref took " + (Runtime.CurrentTimeMillis() - time) / 1000.0 + "s");
                }
                CorefUtils.RemoveSingletonClusters(document);
                writerAfterCoref.Print(CorefPrinter.PrintConllOutput(document, false, true));
            }