finishes classification scripts

This commit is contained in:
Michael Beck
2023-08-16 10:06:16 +02:00
parent 2535683cdc
commit 4e08cde317
2 changed files with 21 additions and 0 deletions

View File

@@ -110,3 +110,14 @@ print(f"Time per tweet classification: {timePerTweet}")
dfClassify.to_csv(senCSVcClassificationResultPath, encoding='utf-8')
# %%
## corrections
def encode_labels(label):
if label == 'real':
return 'True'
elif label == 'fake':
return 'False'
return 0
dfClassify['output_label_topicCov'] = dfClassify['output_label_topicCov'].apply(encode_labels)
dfClassify.to_csv(senCSVcClassificationResultPath, encoding='utf-8')
#still wrong, will be corrected in ClassificationFake.py