personalitylinmult.model¶
The public, pip-install-only entry point: load a champion model by id.
PersonalityModel.from_pretrained(model_id) downloads a champion checkpoint
from the public HF Hub model repo and wraps it for prediction – no MLflow, no
repo clone, no external config. This is deliberately the only public model
class: a checkpoint already knows whether it is a single-stream LinT or a
cross-modal LinMulT (see
FiPredictor), so exposing
separate PersonalityLinT/PersonalityLinMulT classes would force a
caller to track architecture per id for no benefit – this class reads it off
the checkpoint instead.
Model ids follow {features joined by "_", multiword feature names use "-"}_best-{metric},
e.g. "wavlm_best-ccc" (LinT, audio only) or
"wavlm-emotion2vec_best-ccc" (LinMulT, audio fusion) – the same convention
used for the MLflow registered-model names (see
personalitylinmult.inference.register_models) and the HF model repo
filenames.
Attributes¶
Module-level logger. |
|
The public HF Hub model repo champion checkpoints are published to. |
Classes¶
A champion FI model, loaded by id from the public HF Hub repo. |
Module Contents¶
- personalitylinmult.model.logger¶
Module-level logger.
- personalitylinmult.model.HF_MODEL_REPO = 'fodorad/personalitylinmult-fi-models'¶
The public HF Hub model repo champion checkpoints are published to.
- class personalitylinmult.model.PersonalityModel(predictor: personalitylinmult.inference.predictor.FiPredictor)[source]¶
A champion FI model, loaded by id from the public HF Hub repo.
- Parameters:
predictor (FiPredictor) – The loaded predictor to wrap.
- property feature_names: list[str]¶
Features this model consumes, in input order.
- property traits: list[str]¶
Trait names, in output-column order.
- classmethod from_pretrained(model_id: str, revision: str | None = None) PersonalityModel[source]¶
Download (or reuse the cached) champion checkpoint and load it.
- Parameters:
model_id (str) – A champion id, e.g.
"wavlm_best-ccc"or"avt_best-ccc". See the module docstring for the naming convention.revision (str | None) – HF Hub revision (branch/tag/commit);
Noneuses the repo’s default branch.
- Returns:
Ready to predict.
- Return type:
- predict(features: dict[str, numpy.ndarray]) dict[str, float][source]¶
Predict Big Five scores for one sample.
- Parameters:
features (dict[str, np.ndarray]) – One
(T, F)array per feature the model expects (seefeature_names).- Returns:
{trait: score}, in the model’s trait order.- Return type:
dict[str, float]