"景先生毕设|www.jxszl.com

C# Annotation类代码示例

2023-12-29 17:04编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中Annotation类的典型用法代码示例。如果您正苦于以下问题:C#Annotation类的具体用法?C#Annotation怎么用?C#Annotation使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:Analyze /// ///ExecutesSentimentandEntitiesMentionedanalysis. /// publicIOutcomeAnalyze(StanfordCoreNLPpipeline,stringtext) { //Createannotateddocument Annotationdoc=newAnnotation(text); pipeline.annotate(doc); //Validate varsentences=doc.get(typeof(CoreAnnotations.SentencesAnnotation)); if(sentences==null) returnOutcomes.Outcomes .Failure() .WithMessage("Nosentencesdetected."); //Analyze varresult=newAnalysisResult() { Sentiment=GetSentiment((ArrayList)sentences), MentionedEntities=GetMentions(doc) }; returnOutcomes.Outcomes .Success() .WithValue(result); }
原文链接:http://www.jxszl.com/biancheng/C/556539.html