Skip to content

Commit

Permalink
Start to make changes for avoiding conjunction loop, but don't yet ac…
Browse files Browse the repository at this point in the history
…tivate them.
  • Loading branch information
manning authored and Stanford NLP committed Dec 21, 2014
1 parent 11f1cb5 commit 83af8b4
Show file tree
Hide file tree
Showing 21 changed files with 311 additions and 1,718 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static void checkTree(Tree tree) {
GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();

GrammaticalStructure gs = gsf.newGrammaticalStructure(tree);
Collection<TypedDependency> deps = gs.typedDependenciesCCprocessed(GrammaticalStructure.Extras.MAXIMAL);
Collection<TypedDependency> deps = gs.typedDependenciesCCprocessed(true);
// System.out.println(deps);

// collect all nodes in deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,11 @@ private void testAnnotators(String annotators) {
} catch (Exception e) { throw new RuntimeException(e); }
}

/*
@Test
public void testMentions() {
testAnnotators("tokenize,ssplit,pos,lemma,ner,mentions");
}
*/


@Test
public void testSentiment() {
testAnnotators("tokenize,ssplit,pos,parse,sentiment");
}

/*
@Test
public void testGetPossibleAnnotators() {
assertNotNull(possibleAnnotators());
Expand Down Expand Up @@ -382,13 +373,11 @@ public void testSerializeSSplitTokensRegression() {
public void testSerializeNatLog() {
testAnnotators("tokenize,ssplit,pos,lemma,parse,natlog");
}
*/

/**
* Is the protobuf annotator "CoreNLP complete?"
* That is, does it effectively save every combination of annotators possible?
*/
/*
@Test
public void testAllAnnotatorCombinations() {
String[] possibleAnnotators = possibleAnnotators();
Expand Down Expand Up @@ -431,6 +420,5 @@ public void testAllAnnotatorCombinations() {
testAnnotators(StringUtils.join(annotators, ","));
}
}
*/

}
5 changes: 2 additions & 3 deletions src/edu/stanford/nlp/dcoref/CoNLLMentionExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.trees.GrammaticalStructure;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.trees.TreeCoreAnnotations;
import edu.stanford.nlp.trees.TreeLemmatizer;
Expand Down Expand Up @@ -119,9 +118,9 @@ public Document nextDoc() throws Exception {
// generate the dependency graph
try {
SemanticGraph deps = SemanticGraphFactory.makeFromTree(tree,
SemanticGraphFactory.Mode.COLLAPSED, includeExtras ? GrammaticalStructure.Extras.MAXIMAL : GrammaticalStructure.Extras.NONE, threadSafe);
SemanticGraphFactory.Mode.COLLAPSED, includeExtras, threadSafe);
SemanticGraph basicDeps = SemanticGraphFactory.makeFromTree(tree,
SemanticGraphFactory.Mode.BASIC, includeExtras ? GrammaticalStructure.Extras.MAXIMAL : GrammaticalStructure.Extras.NONE, threadSafe);
SemanticGraphFactory.Mode.BASIC, includeExtras, threadSafe);
sentence.set(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class, basicDeps);
sentence.set(SemanticGraphCoreAnnotations.CollapsedDependenciesAnnotation.class, deps);
} catch(Exception e) {
Expand Down
2 changes: 1 addition & 1 deletion src/edu/stanford/nlp/pipeline/AnnotatorFactories.java
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public Annotator create() {

@Override
protected String additionalSignature() {
return DependencyParseAnnotator.signature(StanfordCoreNLP.STANFORD_DEPENDENCIES, properties);
return "";
}
};
}
Expand Down
3 changes: 1 addition & 2 deletions src/edu/stanford/nlp/pipeline/CharniakParserAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import edu.stanford.nlp.parser.common.ParserUtils;
import edu.stanford.nlp.parser.charniak.CharniakParser;
import edu.stanford.nlp.trees.EnglishGrammaticalStructureFactory;
import edu.stanford.nlp.trees.GrammaticalStructure;
import edu.stanford.nlp.trees.GrammaticalStructureFactory;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.util.CoreMap;
Expand Down Expand Up @@ -65,7 +64,7 @@ public void annotate(Annotation annotation) {
tree = ParserUtils.xTree(words);
}

ParserAnnotatorUtils.fillInParseAnnotations(VERBOSE, BUILD_GRAPHS, gsf, sentence, tree, GrammaticalStructure.Extras.NONE);
ParserAnnotatorUtils.fillInParseAnnotations(VERBOSE, BUILD_GRAPHS, gsf, sentence, tree);
}
} else {
throw new RuntimeException("unable to find sentences in: " + annotation);
Expand Down
18 changes: 2 additions & 16 deletions src/edu/stanford/nlp/pipeline/CoreNLP.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ message Sentence {
repeated Entity entity = 52;
repeated Relation relation = 53;
optional bool hasNumerizedTokensAnnotation = 54;
repeated NERMention mentions = 55;

extensions 100 to 255;
}
Expand All @@ -81,8 +80,8 @@ message Token {
optional string ner = 8; // The word's NER tag
optional string normalizedNER = 9; // The word's normalized NER tag
optional string lemma = 10; // The word's lemma
optional uint32 beginChar = 11; // The character offset begin, in the document
optional uint32 endChar = 12; // The character offset end, in the document
optional uint32 beginChar = 11; // The character offset begin
optional uint32 endChar = 12; // The character offset end
optional uint32 utterance = 13; // The utterance tag used in dcoref
optional string speaker = 14; // The speaker speaking this word
optional uint32 beginIndex = 15; // The begin index of, e.g., a span
Expand Down Expand Up @@ -276,16 +275,3 @@ message Polarity {
required NaturalLogicRelation projectCover = 6;
required NaturalLogicRelation projectIndependence = 7;
}

//
// An NER mention in the text
//
message NERMention {
optional uint32 sentenceIndex = 1;
required uint32 tokenStartInSentenceInclusive = 2;
required uint32 tokenEndInSentenceExclusive = 3;
required string ner = 4;
optional string normalizedNER = 5;
optional string entityType = 6;
optional Timex timex = 7;
}
Loading

0 comments on commit 83af8b4

Please sign in to comment.