if __name__ == "__main__":
// Train and evaluate on SST
X = []
Y = []
for i, a in enumerate(treebank.parsed_sents()[:30]):
x, y = clean(find_noun_verb_pairs(a))
X.append(x)
Y.append(y)
model = Association(possible_associations=["has_verb"], max_length=32, viable_edges={"noun_phrase": [["verb", "has_verb"], None], "verb": [None]})
trainX, testX, trainY, testY = train_test_split(X, Y, test_size=0.3, random_state=42)
model.fit(trainX, trainY)
After Change
if __name__ == "__main__":
// Train and evaluate on SST
data = TreebankNounVP()
X, Y = data.get_data()
model = Association(possible_associations=["has_verb"], max_length=32,
viable_edges={"noun_phrase": [["verb", "has_verb"], None], "verb": [None]})
trainX, testX, trainY, testY = train_test_split(X, Y, test_size=0.3, random_state=42)
model.fit(trainX, trainY)