Exemplo n.º 1
0
        /// <summary>A helper so that we can see how the servlet sees the world, modulo model paths, at least.</summary>
        /// <exception cref="Javax.Servlet.ServletException"/>
        /// <exception cref="System.IO.IOException"/>
        public static void Main(string[] args)
        {
            OpenIEServlet servlet = new OpenIEServlet();

            servlet.Init();
            IOUtils.Console(null);
        }
Exemplo n.º 2
0
        /// <summary>A debugging method to try entity linking sentences from the console.</summary>
        /// <exception cref="System.IO.IOException"/>
        public static void Main(string[] args)
        {
            Properties props = StringUtils.ArgsToProperties(args);

            props.SetProperty("annotators", "tokenize,ssplit,pos,lemma,ner,entitymentions,entitylink");
            StanfordCoreNLP pipeline = new StanfordCoreNLP(props);

            IOUtils.Console("sentence> ", null);
        }
        /// <summary>A debugging method to try relation extraction from the console.</summary>
        /// <exception cref="System.IO.IOException">If any IO problem</exception>
        public static void Main(string[] args)
        {
            Properties props = StringUtils.ArgsToProperties(args);

            props.SetProperty("annotators", "tokenize,ssplit,pos,lemma,ner,regexner,parse,mention,coref,kbp");
            props.SetProperty("regexner.mapping", "ignorecase=true,validpospattern=^(NN|JJ).*,edu/stanford/nlp/models/kbp/regexner_caseless.tab;edu/stanford/nlp/models/kbp/regexner_cased.tab");
            StanfordCoreNLP pipeline = new StanfordCoreNLP(props);

            IOUtils.Console("sentence> ", null);
        }
Exemplo n.º 4
0
 /// <summary>Runs an interactive shell where input text is processed with the given pipeline.</summary>
 /// <param name="pipeline">The pipeline to be used</param>
 /// <exception cref="System.IO.IOException">If IO problem with stdin</exception>
 private static void Shell(StanfordCoreNLPClient pipeline)
 {
     log.Info("Entering interactive shell. Type q RETURN or EOF to quit.");
     StanfordCoreNLP.OutputFormat outputFormat = StanfordCoreNLP.OutputFormat.ValueOf(pipeline.properties.GetProperty("outputFormat", "text").ToUpper());
     IOUtils.Console("NLP> ", null);
 }