Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

TRL Model

This model is TRL language model and is a part of a study explained here on document expansion using Doc2Query. The model has been fine-tuned with reinforcement learning to guide the model outputs according to a value, function, or human feedback. The model can be used for text generation. Please cite the paper below if you use it.

To use this model for inference, first install the TRL library:

pip install trl

You can then generate text as follows:

from transformers import pipeline

generator = pipeline("text-generation", model="watheq/d2q_monoELECTRA_1400")
outputs = generator("Coffee is a beverage brewed from roasted coffee beans. Coffee has a stimulating effect on humans, primarily due to its caffeine content.")

If you want to use the model for training or to obtain the outputs from the value head, load the model as follows:

from transformers import AutoTokenizer
from trl import AutoModelForCausalLMWithValueHead

tokenizer = AutoTokenizer.from_pretrained("watheq/d2q_monoELECTRA_1400")
model = AutoModelForCausalLMWithValueHead.from_pretrained("watheq/d2q_monoELECTRA_1400")

inputs = tokenizer("Coffee is a beverage brewed from roasted coffee beans. Coffee has a stimulating effect on humans, primarily due to its caffeine content.", return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"])

Citation

If you used any piece of this repository, please consider citing our work :

@inproceedings{mansour2024revisit,
  title={Revisiting Document Expansion and Filtering for Effective First-Stage Retrieval},
  author={Mansour, Watheq and Zhuang, Shengyao and Zhuang, Guido and Mackenzie, Joel},
  booktitle = {Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year={2024},
  publisher = {Association for Computing Machinery},
  series = {SIGIR '24}
}

license: cc-by-4.0

Downloads last month
2
Safetensors
Model size
223M params
Tensor type
F32
·