🚀 BART(大型模型),在自定義合同數據集上微調
BART模型在英文語料上進行預訓練,並針對服務條款摘要生成任務進行微調,可有效實現文本摘要生成。
🚀 快速開始
你可以使用此模型進行文本摘要生成。下面是如何使用 pipeline API 調用該模型:
from transformers import pipeline
summarizer = pipeline("summarization", model="ML-unipi/bart-large-tos")
ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared "I do" five more times, sometimes only within two weeks of each other.
In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her "first and only" marriage.
Barrientos, now 39, is facing two criminal counts of "offering a false instrument for filing in the first degree," referring to her false statements on the
2010 marriage license application, according to court documents.
Prosecutors said the marriages were part of an immigration scam.
On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
After leaving court, Barrientos was arrested and charged with theft of service and criminal trespass for allegedly sneaking into the New York subway through an emergency exit, said Detective
Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
All occurred either in Westchester County, Long Island, New Jersey or the Bronx. She is believed to still be married to four men, and at one time, she was married to eight men at once, prosecutors say.
Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
"""
print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
>>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
✨ 主要特性
- 模型架構:BART 是一種變壓器編解碼器(seq2seq)模型,具有雙向(類似 BERT)編碼器和自迴歸(類似 GPT)解碼器。
- 預訓練方式:通過(1)使用任意噪聲函數破壞文本,以及(2)學習一個模型來重建原始文本進行預訓練。
- 應用場景廣泛:在針對文本生成任務(如摘要、翻譯)進行微調時特別有效,也適用於理解任務(如文本分類、問答)。
📚 詳細文檔
模型描述
BART 是一種變壓器編解碼器(seq2seq)模型,具有雙向(類似 BERT)編碼器和自迴歸(類似 GPT)解碼器。BART 通過以下方式進行預訓練:(1)使用任意噪聲函數破壞文本;(2)學習一個模型來重建原始文本。
BART 在針對文本生成任務(如摘要、翻譯)進行微調時特別有效,但也適用於理解任務(如文本分類、問答)。此特定檢查點已在 CNN Daily Mail 上進行微調,這是一個包含大量文本 - 摘要對的數據集。
預期用途和限制
你可以使用此模型進行文本摘要生成。
📄 許可證
本項目採用 MIT 許可證。