More experimentation

Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
Andras Schmelczer 2022-04-03 21:46:35 +02:00
parent 1c501db81a
commit 83d870d2ea
43 changed files with 749 additions and 496 deletions

View file

@ -1,15 +1,21 @@
import json
from random import shuffle
from devtools import debug
from predict_domain import predict_domain
from good_ai import LargeFile, process_batch
from good_ai import process_batch
if __name__ == "__main__":
with open("data/s2-corpus-1583.json") as f:
with open(".cache/ss-data-0/s2-corpus-1583.json") as f:
raw = json.load(f)
LargeFile.configure_credentials_from_file("s3.ini")
shuffle(raw)
data = {f'{r["title"]} {r["abstract"]}': r["domain"] for r in raw[:5]}
print(process_batch(predict_domain, ["We have found a new type of chemical."]))
results = process_batch(predict_domain, data.keys())
for predicted, actual in zip(results, data.values()):
print(", ".join(actual))
debug(predicted)
print()