Experimaestro specific pre-trained models can be found on the HuggingFace Hub searching the xpmir library. Models can then be loaded using
You can simply download a model from the Hub using xpmir.models.AutoModel. Thanks to the experimaestro framework, you can either use models in your own experiments or in pure inference mode using :pyload_from_hf_hub() <xpmir.models.AutoModel.load_from_hf_hub>
In this mode, you can reuse the model in your experiments -- e.g. to compare this model with your own, or using it in a complex IR pipeline (e.g. distillation). Please refer to the experimaestro-IR documentation <https://experimaestro-ir.readthedocs.io/>_ for more details:
from xpmir.models import AutoModel
# Model that can be re-used in experiments
model = AutoModel.load_from_hf_hub("xpmir/monobert")
In this mode, the model can be used right away to score documents:
from xpmir.models import AutoModel
# Use this if you want to actually use the model
model = AutoModel.load_from_hf_hub("xpmir/monobert", as_instance=True)
model.initialize(None)
model.rsv("walgreens store sales average", "The average Walgreens salary ranges...")
Cross-encoders models can also be created from any transformer model that has been trained to classify a query/document using :pycross_encoder_model <xpmir.models.AutoModel.cross_encoder_model>
:pyDense <xpmir.neural.dual.Dense>
models can also be created from transformers from the Sentence Transformers library (HuggingFace Hub list) using :pysentence_scorer <xpmir.models.AutoModel.sentence_scorer>
.