Skip to content

Commit

Permalink
Merge branch 'master' of origin
Browse files Browse the repository at this point in the history
  • Loading branch information
J38 authored and Stanford NLP committed Mar 7, 2017
1 parent ce7ffd3 commit 19954b0
Show file tree
Hide file tree
Showing 6 changed files with 2,310 additions and 1,455 deletions.
Expand Up @@ -63,7 +63,7 @@ protected Annotation mkLargeAnnotation() {
return ann;
}

@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "ConstantConditions"})
public static void sameAsRead(Annotation doc, Annotation readDoc) {
// Run the original document through the number normalizer
if (doc.containsKey(CoreAnnotations.SentencesAnnotation.class)) {
Expand Down
11 changes: 11 additions & 0 deletions src/edu/stanford/nlp/naturalli/NaturalLogicAnnotations.java
Expand Up @@ -46,6 +46,17 @@ public Class<Collection<SentenceFragment>> getType() {
}
}

/**
* A set of clauses contained in and entailed by this sentence.
*/
public static final class EntailedClausesAnnotation implements CoreAnnotation<Collection<SentenceFragment>> {
@SuppressWarnings("unchecked")
@Override
public Class<Collection<SentenceFragment>> getType() {
return (Class<Collection<SentenceFragment>>) ((Object) Collection.class);
}
}

/**
* The set of relation triples extracted from this sentence.
*/
Expand Down
1 change: 1 addition & 0 deletions src/edu/stanford/nlp/naturalli/OpenIE.java
Expand Up @@ -494,6 +494,7 @@ public void annotateSentence(CoreMap sentence, Map<CoreLabel, List<CoreLabel>> c
extractions.addAll(relationsInFragments(fragments, sentence));

// Set the annotations
sentence.set(NaturalLogicAnnotations.EntailedClausesAnnotation.class, new HashSet<>(clauses));
sentence.set(NaturalLogicAnnotations.EntailedSentencesAnnotation.class, fragments);
sentence.set(NaturalLogicAnnotations.RelationTriplesAnnotation.class,
new ArrayList<>(new HashSet<>(extractions))); // uniq the extractions
Expand Down
1 change: 1 addition & 0 deletions src/edu/stanford/nlp/pipeline/CoreNLP.proto
Expand Up @@ -75,6 +75,7 @@ message Sentence {
repeated RelationTriple openieTriple = 14; // The OpenIE triples in the sentence
repeated RelationTriple kbpTriple = 16; // The KBP triples in this sentence
repeated SentenceFragment entailedSentence = 15; // The entailed sentences, by natural logic
repeated SentenceFragment entailedClause = 35; // The entailed clauses, by natural logic
optional DependencyGraph enhancedDependencies = 17;
optional DependencyGraph enhancedPlusPlusDependencies = 18;
repeated Token character = 19;
Expand Down

0 comments on commit 19954b0

Please sign in to comment.