2017-04-14 7 views

答えて

2

これを処理するモジュールを追加しました。

GitHubから最新のコードを入手する必要があります。ここで

は、いくつかのサンプルコードです:これはまだ開発中である

package edu.stanford.nlp.examples; 

import edu.stanford.nlp.coref.*; 
import edu.stanford.nlp.coref.data.*; 
import edu.stanford.nlp.ling.CoreAnnotations; 
import edu.stanford.nlp.util.*; 

import edu.stanford.nlp.pipeline.*; 

import java.util.*; 


public class QuoteAttributionExample { 

    public static void main(String[] args) { 
    Annotation document = 
     new Annotation("John said, \"There's an elephant outside the window.\""); 
    Properties props = new Properties(); 
    props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,entitymentions,quote,quoteattribution"); 
    StanfordCoreNLP pipeline = new StanfordCoreNLP(props); 
    pipeline.annotate(document); 
    for (CoreMap quote : document.get(CoreAnnotations.QuotationsAnnotation.class)) { 
     System.out.println(quote); 
     System.out.println(quote.get(QuoteAttributionAnnotator.MentionAnnotation.class)); 
    } 
    } 
} 

、我々はおそらく、それが簡単にすぐに見積もりにリンクする実際のテキストのスパンを取得するために作るためにいくつかのコードを追加します。

関連する問題