python的数据处理一
def load_data(filename):
features = []
labels = []
f = open(filename, encoding='utf-8')
medical = json.load(f)
for medical in medical:
feature = []
label = []
for ner_message in medical[1:]:
for index, message in enumerate(ner_message[0]):
feature.append(message)
label.append(ner_message[1])
features.append(feature)
labels.append(label)
return features, labels