stanford nlp - Quote Annotator get author -


in following text:

john said, "there's elephant outside window."

is there simple way figure out quote "there's elephant outside window." belongs john?

we've added module handling this.

you'll need latest code github.

here sample code:

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 elephant outside window.\"");     properties props = new properties();     props.setproperty("annotators", "tokenize,ssplit,pos,lemma,ner,entitymentions,quote,quoteattribution");     stanfordcorenlp pipeline = new stanfordcorenlp(props);     pipeline.annotate(document);     (coremap quote : document.get(coreannotations.quotationsannotation.class)) {       system.out.println(quote);       system.out.println(quote.get(quoteattributionannotator.mentionannotation.class));     }   } } 

this still under development, add code make easier actual text span links quote soon.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -