Program: 131271
Project: 131271
Buggy source:
private void addEmbeddingFeatures(LocalObservations local,ObjFeatVec<String> fv){
  NerMention m1=local.getNe1();
  NerMention m2=local.getNe2();
  Span m1span=m1.getSpan();
  Span m2span=m2.getSpan();
  FeaturizedSentence fsent=new FeaturizedSentence(sent,null);
  String ne1=m1.getEntityType();
  String ne2=m2.getEntityType();
  String ne1ne2=ne1 + ne2;
switch (RelationsOptions.embFeatType) {
case FULL:
    Pair<List<LabeledSpan>,IntArrayList> chunkPair=getSpansFromBIO(sent.getChunks(),true);
  List<LabeledSpan> chunks=chunkPair.get1();
IntArrayList tokIdxToChunkIdx=chunkPair.get2();
int c1=tokIdxToChunkIdx.get(m1.getHead());
int c2=tokIdxToChunkIdx.get(m2.getHead());
int[] chunkHeads=getHeadsOfSpans(chunks,sent.getParents());
for (int b=c1 + 1; b <= c2 - 1; b++) {
int i=chunkHeads[b];
addEmbFeat("String_Node_Str",i,fv);
addEmbFeat("String_Node_Str" + ne1,i,fv);
addEmbFeat("String_Node_Str" + ne2,i,fv);
addEmbFeat("String_Node_Str" + ne1ne2,i,fv);
}
case FULL_NO_CHUNKS:
Span btwn=Span.getSpanBtwn(m1span,m2span);
for (int i=btwn.start(); i < btwn.end(); i++) {
addEmbFeat("String_Node_Str",i,fv);
addEmbFeat("String_Node_Str" + ne1,i,fv);
addEmbFeat("String_Node_Str" + ne2,i,fv);
addEmbFeat("String_Node_Str" + ne1ne2,i,fv);
}
FeaturizedTokenPair ftp=fsent.getFeatTokPair(m1.getHead(),m2.getHead());
List<Pair<Integer,Dir>> depPath=ftp.getDependencyPath();
if (depPath != null) {
for (Pair<Integer,DepTree.Dir> pair : depPath) {
int i=pair.get1();
addEmbFeat("String_Node_Str",i,fv);
addEmbFeat("String_Node_Str" + ne1,i,fv);
addEmbFeat("String_Node_Str" + ne2,i,fv);
addEmbFeat("String_Node_Str" + ne1ne2,i,fv);
}
}
 else {
log.warn("String_Node_Str");
}
addEmbFeat("String_Node_Str",m1.getHead() - 1,fv);
addEmbFeat("String_Node_Str",m1.getHead() + 1,fv);
addEmbFeat("String_Node_Str",m1.getHead() - 2,fv);
addEmbFeat("String_Node_Str",m1.getHead() + 2,fv);
addEmbFeat("String_Node_Str",m2.getHead() - 1,fv);
addEmbFeat("String_Node_Str",m2.getHead() + 1,fv);
addEmbFeat("String_Node_Str",m2.getHead() - 2,fv);
addEmbFeat("String_Node_Str",m2.getHead() + 2,fv);
case HEAD_TYPE:
addEmbFeat("String_Node_Str" + ne1,m1.getHead(),fv);
addEmbFeat("String_Node_Str" + ne2,m1.getHead(),fv);
addEmbFeat("String_Node_Str" + ne1ne2,m1.getHead(),fv);
addEmbFeat("String_Node_Str" + ne1,m2.getHead(),fv);
addEmbFeat("String_Node_Str" + ne2,m2.getHead(),fv);
addEmbFeat("String_Node_Str" + ne1ne2,m2.getHead(),fv);
case HEAD_ONLY:
addEmbFeat("String_Node_Str",m1.getHead(),fv);
addEmbFeat("String_Node_Str",m2.getHead(),fv);
}
}

Fixed version (ground truth):
private void addEmbeddingFeatures(LocalObservations local,ObjFeatVec<String> fv){
  NerMention m1=local.getNe1();
  NerMention m2=local.getNe2();
  Span m1span=m1.getSpan();
  Span m2span=m2.getSpan();
  FeaturizedSentence fsent=new FeaturizedSentence(sent,null);
  String ne1=m1.getEntityType();
  String ne2=m2.getEntityType();
  String ne1ne2=ne1 + ne2;
switch (RelationsOptions.embFeatType) {
case FULL:
    Pair<List<LabeledSpan>,IntArrayList> chunkPair=getSpansFromBIO(sent.getChunks(),true);
  List<LabeledSpan> chunks=chunkPair.get1();
IntArrayList tokIdxToChunkIdx=chunkPair.get2();
int c1=tokIdxToChunkIdx.get(m1.getHead());
int c2=tokIdxToChunkIdx.get(m2.getHead());
int[] chunkHeads=getHeadsOfSpans(chunks,sent.getParents());
for (int b=c1 + 1; b <= c2 - 1; b++) {
int i=chunkHeads[b];
addEmbFeat("String_Node_Str",i,fv);
addEmbFeat("String_Node_Str" + ne1,i,fv);
addEmbFeat("String_Node_Str" + ne2,i,fv);
addEmbFeat("String_Node_Str" + ne1ne2,i,fv);
}
case FULL_NO_CHUNKS:
Span btwn=new Span(m1.getHead() + 1,m2.getHead());
for (int i=btwn.start(); i < btwn.end(); i++) {
addEmbFeat("String_Node_Str",i,fv);
addEmbFeat("String_Node_Str" + ne1,i,fv);
addEmbFeat("String_Node_Str" + ne2,i,fv);
addEmbFeat("String_Node_Str" + ne1ne2,i,fv);
}
FeaturizedTokenPair ftp=fsent.getFeatTokPair(m1.getHead(),m2.getHead());
List<Pair<Integer,Dir>> depPath=ftp.getDependencyPath();
if (depPath != null) {
for (Pair<Integer,DepTree.Dir> pair : depPath) {
int i=pair.get1();
addEmbFeat("String_Node_Str",i,fv);
addEmbFeat("String_Node_Str" + ne1,i,fv);
addEmbFeat("String_Node_Str" + ne2,i,fv);
addEmbFeat("String_Node_Str" + ne1ne2,i,fv);
}
}
 else {
log.warn("String_Node_Str");
}
addEmbFeat("String_Node_Str",m1.getHead() - 1,fv);
addEmbFeat("String_Node_Str",m1.getHead() + 1,fv);
addEmbFeat("String_Node_Str",m1.getHead() - 2,fv);
addEmbFeat("String_Node_Str",m1.getHead() + 2,fv);
addEmbFeat("String_Node_Str",m2.getHead() - 1,fv);
addEmbFeat("String_Node_Str",m2.getHead() + 1,fv);
addEmbFeat("String_Node_Str",m2.getHead() - 2,fv);
addEmbFeat("String_Node_Str",m2.getHead() + 2,fv);
case HEAD_TYPE:
addEmbFeat("String_Node_Str" + ne1,m1.getHead(),fv);
addEmbFeat("String_Node_Str" + ne2,m1.getHead(),fv);
addEmbFeat("String_Node_Str" + ne1ne2,m1.getHead(),fv);
addEmbFeat("String_Node_Str" + ne1,m2.getHead(),fv);
addEmbFeat("String_Node_Str" + ne2,m2.getHead(),fv);
addEmbFeat("String_Node_Str" + ne1ne2,m2.getHead(),fv);
case HEAD_ONLY:
addEmbFeat("String_Node_Str",m1.getHead(),fv);
addEmbFeat("String_Node_Str",m2.getHead(),fv);
}
}