diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-06-01 14:54:03 +0200 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-06-01 14:54:03 +0200 |
| commit | b372f5a5601734a150a32651c507a1e9ead575a5 (patch) | |
| tree | 14f8fa513bbae677304106c3969080e12f695e01 /classification/output.py | |
| parent | 0d401089e9e72a8d9fb9b41d920126aa9fb23b05 (diff) | |
| download | qemu-analysis-b372f5a5601734a150a32651c507a1e9ead575a5.tar.gz qemu-analysis-b372f5a5601734a150a32651c507a1e9ead575a5.zip | |
classifier: iterates through mailing list
Diffstat (limited to 'classification/output.py')
| -rw-r--r-- | classification/output.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/classification/output.py b/classification/output.py new file mode 100644 index 000000000..df64dbccd --- /dev/null +++ b/classification/output.py @@ -0,0 +1,12 @@ +from os import path, makedirs + +def output(text : str, labels : list, scores : list, identifier : str): + file_path = f"output/{labels[0]}/{identifier}" + makedirs(path.dirname(file_path), exist_ok = True) + + with open(file_path, "w") as file: + for label, score in zip(labels, scores): + file.write(f"{label}: {score:.3f}\n") + + file.write("\n") + file.write(text) |