예제 #1
0
        /// <summary>
        /// Performs NER tagging of tokens.
        /// </summary>
        private void performNER()
        {
            java.util.List tokens;
            List <string>  values = new List <string>();

            object[] nerValues;

            foreach (Token token in listLatestTokenizedArticle)
            {
                values.Add(token.Value);
            }

            tokens = Sentence.toCoreLabelList(values.ToArray());

            nerValues = nerClassifier.classifySentence(tokens).toArray();

            for (int i = 0; i < listLatestTokenizedArticle.Count; i++)
            {
                listLatestTokenizedArticle[i].NamedEntity = ((CoreLabel)nerValues[i]).get(typeof(CoreAnnotations.AnswerAnnotation)).ToString();
            }
        }