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

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -