🚀 MVP模型
MVP模型是一種專為自然語言生成設計的模型,它採用多任務監督預訓練的方式,能適應多種生成和理解任務,為自然語言處理提供了強大的支持。
🚀 快速開始
MVP模型由田毅、李俊毅、趙文新和文繼榮在論文 MVP: Multi-task Supervised Pre-training for Natural Language Generation 中提出。
詳細信息和說明可查看 https://github.com/RUCAIBox/MVP。
✨ 主要特性
- 多任務適應:MVP經過有監督的預訓練,使用了多種標記數據集的混合。它採用標準的Transformer編解碼器架構,專門為自然語言生成而設計,可適應廣泛的生成任務,包括但不限於摘要生成、數據到文本生成、開放式對話系統、故事生成、問答、問題生成、面向任務的對話系統、常識生成、釋義生成、文本風格轉換和文本簡化。此外,該模型還能適應自然語言理解任務,如序列分類和(抽取式)問答。
💻 使用示例
基礎用法
摘要生成
>>> from transformers import MvpTokenizer, MvpForConditionalGeneration
>>> tokenizer = MvpTokenizer.from_pretrained("RUCAIBox/mvp")
>>> model = MvpForConditionalGeneration.from_pretrained("RUCAIBox/mvp")
>>> inputs = tokenizer(
... "Summarize: You may want to stick it to your boss and leave your job, but don't do it if these are your reasons.",
... return_tensors="pt",
... )
>>> generated_ids = model.generate(**inputs)
>>> tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
["Why You Shouldn't Quit Your Job"]
數據到文本生成
>>> from transformers import MvpTokenizerFast, MvpForConditionalGeneration
>>> tokenizer = MvpTokenizerFast.from_pretrained("RUCAIBox/mvp")
>>> model = MvpForConditionalGeneration.from_pretrained("RUCAIBox/mvp")
>>> inputs = tokenizer(
... "Describe the following data: Iron Man | instance of | Superhero [SEP] Stan Lee | creator | Iron Man",
... return_tensors="pt",
... )
>>> generated_ids = model.generate(**inputs)
>>> tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
['Stan Lee created the character of Iron Man, a fictional superhero appearing in American comic']
📚 詳細文檔
相關模型
- MVP:https://huggingface.co/RUCAIBox/mvp。
- 基於提示的模型:
- MVP - 多任務:[https://huggingface.co/RUCAIBox/mvp - multi - task](https://huggingface.co/RUCAIBox/mvp - multi - task)。
- MVP - 摘要生成:[https://huggingface.co/RUCAIBox/mvp - summarization](https://huggingface.co/RUCAIBox/mvp - summarization)。
- MVP - 開放式對話:[https://huggingface.co/RUCAIBox/mvp - open - dialog](https://huggingface.co/RUCAIBox/mvp - open - dialog)。
- MVP - 數據到文本生成:[https://huggingface.co/RUCAIBox/mvp - data - to - text](https://huggingface.co/RUCAIBox/mvp - data - to - text)。
- MVP - 故事生成:[https://huggingface.co/RUCAIBox/mvp - story](https://huggingface.co/RUCAIBox/mvp - story)。
- MVP - 問答:[https://huggingface.co/RUCAIBox/mvp - question - answering](https://huggingface.co/RUCAIBox/mvp - question - answering)。
- MVP - 問題生成:[https://huggingface.co/RUCAIBox/mvp - question - generation](https://huggingface.co/RUCAIBox/mvp - question - generation)。
- MVP - 面向任務的對話:[https://huggingface.co/RUCAIBox/mvp - task - dialog](https://huggingface.co/RUCAIBox/mvp - task - dialog)。
- 多任務模型:
- MTL - 摘要生成:[https://huggingface.co/RUCAIBox/mtl - summarization](https://huggingface.co/RUCAIBox/mtl - summarization)。
- MTL - 開放式對話:[https://huggingface.co/RUCAIBox/mtl - open - dialog](https://huggingface.co/RUCAIBox/mtl - open - dialog)。
- MTL - 數據到文本生成:[https://huggingface.co/RUCAIBox/mtl - data - to - text](https://huggingface.co/RUCAIBox/mtl - data - to - text)。
- MTL - 故事生成:[https://huggingface.co/RUCAIBox/mtl - story](https://huggingface.co/RUCAIBox/mtl - story)。
- MTL - 問答:[https://huggingface.co/RUCAIBox/mtl - question - answering](https://huggingface.co/RUCAIBox/mtl - question - answering)。
- MTL - 問題生成:[https://huggingface.co/RUCAIBox/mtl - question - generation](https://huggingface.co/RUCAIBox/mtl - question - generation)。
- MTL - 面向任務的對話:[https://huggingface.co/RUCAIBox/mtl - task - dialog](https://huggingface.co/RUCAIBox/mtl - task - dialog)。
📄 許可證
本項目採用Apache - 2.0許可證。
📚 引用
如果您在研究中使用了該模型,請使用以下BibTeX引用:
@article{tang2022mvp,
title={MVP: Multi-task Supervised Pre-training for Natural Language Generation},
author={Tang, Tianyi and Li, Junyi and Zhao, Wayne Xin and Wen, Ji-Rong},
journal={arXiv preprint arXiv:2206.12131},
year={2022},
url={https://arxiv.org/abs/2206.12131},
}