You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
590 B
20 lines
590 B
from feature_extraction.features import extract_features_from_text
|
|
|
|
|
|
class DataInstance:
|
|
"""
|
|
Model Class for carrying Training and Testing data from tsv/csv file.
|
|
Also carries the extracted features.
|
|
"""
|
|
|
|
def __init__(self, r_id, text, true_label):
|
|
self.did = r_id
|
|
self.text = text
|
|
self.true_label = true_label
|
|
self.predicted_label = None
|
|
self.features = extract_features_from_text(text)
|
|
|
|
def print(self):
|
|
print('\nTrue Label :: ', self.true_label, ' Text :: ', self.text)
|
|
print('Features :: ', self.features)
|