🚀 BART(大型模型),在亞馬遜評論(英語)上微調
BART模型最初在CNN - DailyMail數據集上進行預訓練,之後在亞馬遜網站的英文購買評論數據上進行了重新訓練。這樣做的目的是構建一個專門用於總結亞馬遜網站用戶評論的流程。
🚀 快速開始
本模型旨在用於總結網站上的用戶評論。以下是使用pipeline API調用此模型的示例:
from transformers import pipeline
summarizer = pipeline("summarization", model="mabrouk/amazon-review-summarizer-bart")
review = """ I really like this book. It takes a step-by-step approach to introduce the reader to the IBM Q Experience, to the basics underlying quantum computing, and to the reality of the noise involved in the current machines. This introduction is technical and shows the user how to use the IBM system either directly through the GUI on their website or by running Python code on one's own machine. The text provides examples of small exercises to try and stimulates ideas of new things to try. The IBM Q Exp Qiskit software modules are identified and introduced - Terra, Aer, Ignis, and Aqua, as well as the backends that one can choose to do the computing. The book ends with two great chapters on quantum algorithms.
"""
print(summarizer(review, min_length = 60))
>>> [{'summary': 'This book is a great resource, and a great read, to learn about quantum and start writing your first programs, or to brush up on your programming skills. I loved that there is a quiz at the end of every chapter so you can check and see how...'}]
✨ 主要特性
根據Hugging Face的介紹,BART是一種Transformer編解碼器(seq2seq)模型,具有雙向(類似BERT)編碼器和自迴歸(類似GPT)解碼器。BART的預訓練過程包括:(1)使用任意噪聲函數對文本進行損壞;(2)學習一個模型來重構原始文本。
📦 安裝指南
文檔未提及安裝步驟,故跳過此章節。
💻 使用示例
基礎用法
from transformers import pipeline
summarizer = pipeline("summarization", model="mabrouk/amazon-review-summarizer-bart")
review = """ I really like this book. It takes a step-by-step approach to introduce the reader to the IBM Q Experience, to the basics underlying quantum computing, and to the reality of the noise involved in the current machines. This introduction is technical and shows the user how to use the IBM system either directly through the GUI on their website or by running Python code on one's own machine. The text provides examples of small exercises to try and stimulates ideas of new things to try. The IBM Q Exp Qiskit software modules are identified and introduced - Terra, Aer, Ignis, and Aqua, as well as the backends that one can choose to do the computing. The book ends with two great chapters on quantum algorithms.
"""
print(summarizer(review, min_length = 60))
>>> [{'summary': 'This book is a great resource, and a great read, to learn about quantum and start writing your first programs, or to brush up on your programming skills. I loved that there is a quiz at the end of every chapter so you can check and see how...'}]
📚 詳細文檔
數據集
鏈接:亞馬遜評論語料庫
參考資料
預訓練模型:facebook/bart-large-cnn
重新訓練數據集:亞馬遜評論語料庫
🔧 技術細節
文檔未提供具體的技術實現細節,故跳過此章節。
📄 許可證
文檔未提及許可證信息,故跳過此章節。