예제 #1
0
        public static void Demonstrate(string text, POSMode partOfSpeechMode, NERMode namedEntityRecognitionMode, bool disableLogging = true)
        {
            if (disableLogging)
            {
                RedwoodConfiguration.current().clear().apply();
            }
            //Input
            //Console.WriteLine("Input: {0}\n\n\n", text);

            ////Tokenization
            //Console.WriteLine("Tokenization:");
            //Tokenisation.TokenizeText(text);
            //Console.WriteLine("\n\n\n");

            ////POS
            //Console.WriteLine("Part Of Speech:");
            //PartOfSpeech.Tag(text, partOfSpeechMode);
            //Console.WriteLine("\n\n\n");

            ////NER
            //Console.WriteLine("Named Entity Recognition:");
            //var ner = new NER(namedEntityRecognitionMode);
            //Console.WriteLine(ner.classifyToString(text));
            //Console.WriteLine("\n\n\n");


            ////Parser
            //Console.WriteLine("Parsed Text:");
            //Parser.ParseString(text);
            //Console.WriteLine("\n\n\n");

            //Find co-reference
            CorefAnnotator.FindCoreferenceResolution(text);
        }
예제 #2
0
        public NER(NERMode nerMode)
        {
            switch (nerMode)
            {
            case NERMode.FourClasses:
                model = @"/english.conll.4class.distsim.crf.ser.gz";
                break;

            case NERMode.SevenClasses:
                model = @"/english.muc.7class.distsim.crf.ser.gz";
                break;

            default:
                model = @"/english.all.3class.distsim.crf.ser.gz";
                break;
            }
        }