2023-09-19 07:03:20 +02:00
|
|
|
import ray
|
2023-07-26 13:53:11 +02:00
|
|
|
|
|
|
|
from madewithml import predict
|
|
|
|
|
|
|
|
|
|
|
|
def get_label(text, predictor):
|
2023-09-19 07:03:20 +02:00
|
|
|
sample_ds = ray.data.from_items([{"title": text, "description": "", "tag": "other"}])
|
|
|
|
results = predict.predict_proba(ds=sample_ds, predictor=predictor)
|
|
|
|
return results[0]["prediction"]
|