Commit 823ae4da authored by  Joel  Oksanen's avatar Joel Oksanen
Browse files

Removed testing code changes

parent 1536e4ad
......@@ -23,10 +23,10 @@ class Vectorizer:
# dep features:
self.fc = FeatureCounter()
# train_dep_vectors = self.get_dep_vectors(train_instances, learning=True)
train_dep_vectors = self.get_dep_vectors(train_instances, learning=True)
# store vectors for training set:
train_vectors = train_indep_vectors
train_vectors = np.concatenate((train_indep_vectors, train_dep_vectors), axis=1)
train_vectors = self.transformer.fit_transform(train_vectors).toarray()
for i in range(len(train_instances)):
......@@ -43,9 +43,9 @@ class Vectorizer:
sent_vectors = [self.sentiment_scores(instance) for instance in instances]
indep_vectors = np.concatenate((bow_vectors, sent_vectors), axis=1)
# dep features:
# dep_vectors = self.get_dep_vectors(instances, learning=False)
dep_vectors = self.get_dep_vectors(instances, learning=False)
# store vectors:
vectors = indep_vectors
vectors = np.concatenate((indep_vectors, dep_vectors), axis=1)
vectors = self.transformer.fit_transform(vectors).toarray()
for i in range(len(instances)):
instances[i].vector = vectors[i]
......@@ -236,8 +236,4 @@ class Vectorizer:
f = self.sibling_negation(subtree.right_sibling()[0]) + '-'.join(n.leaves()) + '_cp_arg1'
features.append(f)
if features:
print(instance.text)
print(instance.tree)
print(features)
return features
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment