private void NodeFeatureVectorConstruction() { ModelFeatures Features = new ModelFeatures(); for (int i = 0; i < anotationPairList.Count; i++) { Console.WriteLine(i + "th pair constructed!"); List <int> featureVector = new List <int>(); featureVector.Add(Features.BFeatureAdjacent(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureBlankCellMiddle(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureChildindentationGreater(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureChildindexGreater(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureChildSizeSmaller(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureContainColonAndTotal(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureIndentationLarger(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureIndentationMiddle(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureIndentationShorter(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureParentRoot(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureStyleAdjacent(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureBoldDiffer(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureItalicDiffer(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); featureVector.Add(Features.BFeatureUnderlineDiffer(this.celllist, anotationPairList[i].indexParent, anotationPairList[i].indexChild)); NodePotentialFeatureVector nodepotentialfeaturevector = new NodePotentialFeatureVector(featureVector); anotationPairList[i].nodepotentialfeaturevector = nodepotentialfeaturevector; } }
private void EdgeFeatureVectorConstruction() { ModelFeatures Features = new ModelFeatures(); for (int i = 0; i < anotationPairEdgeList.Count; i++) { Console.WriteLine(i + "th edge constructed!"); List <int> featureVector = new List <int>(); featureVector.Add(Features.EFeatureStylisticAffinity(this.celllist, anotationPairEdgeList[i].pair1.indexParent, anotationPairEdgeList[i].pair1.indexChild, anotationPairEdgeList[i].pair2.indexParent, anotationPairEdgeList[i].pair2.indexChild)); featureVector.Add(Features.EFeatureMetaDataAffinity(this.celllist, anotationPairEdgeList[i].pair1.indexParent, anotationPairEdgeList[i].pair1.indexChild, anotationPairEdgeList[i].pair2.indexParent, anotationPairEdgeList[i].pair2.indexChild)); featureVector.Add(Features.EFeatureAdjacentDependency(this.celllist, anotationPairEdgeList[i].pair1.indexParent, anotationPairEdgeList[i].pair1.indexChild, anotationPairEdgeList[i].pair2.indexParent, anotationPairEdgeList[i].pair2.indexChild)); EdgePotentialFeatureVector edgepotentialfeaturevector = new EdgePotentialFeatureVector(featureVector, this.anotationPairList.IndexOf(anotationPairEdgeList[i].pair1), this.anotationPairList.IndexOf(anotationPairEdgeList[i].pair2)); anotationPairEdgeList[i].edgepotentialfeaturevector = edgepotentialfeaturevector; } }