File size: 620 Bytes
640a2b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

from phenotype_inference import PhenotypeClassifier, print_prediction

MODEL_PATH = "phenotype_tinytransformer_v1_temperature_scaled.pt"

classifier = PhenotypeClassifier(MODEL_PATH)

features = {
    "Gram Stain": "Negative",
    "Shape": "Rods",
    "Catalase": "Positive",
    "Oxidase": "Positive",
    "Motility": "Positive",
    "Indole": "Negative",
    "Citrate": "Positive",
    "Urease": "Negative",
    "Growth Temperature": "20//37",
    "Media Grown On": "Blood Agar; MacConkey Agar",
}

result = classifier.predict(features, top_k=10)

print_prediction(result)

print()
print("Raw output:")
print(result)