🚀 mT5-large查询生成模型
本项目是一个基于mT5-large的查询生成模型,使用XOR QA数据进行训练。该模型可用于生成不同语言的查询问题,在跨语言密集检索等领域具有重要价值。
🚀 快速开始
本模型是一个使用XOR QA数据训练的mT5-large查询生成模型。它被应用于以下两篇论文的研究中:
💻 使用示例
基础用法
from transformers import pipeline
lang2mT5 = dict(
ar='Arabic',
bn='Bengali',
fi='Finnish',
ja='Japanese',
ko='Korean',
ru='Russian',
te='Telugu'
)
PROMPT = 'Generate a {lang} question for this passage: {title} {passage}'
title = 'Transformer (machine learning model)'
passage = 'A transformer is a deep learning model that adopts the mechanism of self-attention, differentially ' \
'weighting the significance of each part of the input (which includes the recursive output) data.'
model_name_or_path = 'ielabgroup/xor-tydi-docTquery-mt5-large'
input_text = PROMPT.format_map({'lang': lang2mT5['ja'],
'title': title,
'passage': passage})
generator = pipeline(model=model_name_or_path,
task='text2text-generation',
device="cuda:0",
)
results = generator(input_text,
do_sample=True,
max_length=64,
num_return_sequences=10,
)
for i, result in enumerate(results):
print(f'{i + 1}. {result["generated_text"]}')
📄 许可证
本项目采用Apache-2.0许可证。
📚 引用信息
如果您在研究中使用了本模型,请参考以下BibTeX引用:
@article{zhuang2022bridging,
title={Bridging the gap between indexing and retrieval for differentiable search index with query generation},
author={Zhuang, Shengyao and Ren, Houxing and Shou, Linjun and Pei, Jian and Gong, Ming and Zuccon, Guido and Jiang, Daxin},
journal={arXiv preprint arXiv:2206.10128},
year={2022}
}
@inproceedings{zhuang2023augmenting,
title={Augmenting Passage Representations with Query Generation for Enhanced Cross-Lingual Dense Retrieval},
author={Zhuang, Shengyao and Shou, Linjun and Zuccon, Guido},
booktitle={Proceedings of the 46th international ACM SIGIR conference on research and development in information retrieval},
year={2023}
}