Legal Pegasus
模型概述
該模型是基於google/pegasus-cnn_dailymail微調的法律領域版本,專注於法律文檔的抽象摘要生成任務,支持1024個標記的輸入序列長度。
模型特點
法律領域優化
專門針對法律文檔進行微調,能夠更好地理解和摘要法律相關內容
長文本支持
支持最大1024個標記的輸入序列長度,適合處理較長的法律文檔
高質量摘要
相比基礎模型,在法律文檔摘要任務上ROUGE指標有顯著提升
模型能力
法律文本理解
抽象摘要生成
長文本處理
使用案例
法律文檔處理
訴訟公告摘要
自動生成訴訟公告的簡潔摘要
ROUGE-1得分57.39,顯著優於通用摘要模型
起訴書摘要
從複雜起訴書中提取關鍵信息生成摘要
ROUGE-L得分30.91,法律術語保留準確
🚀 用於法律文檔摘要的PEGASUS
legal-pegasus 是 google/pegasus-cnn_dailymail 在 法律領域 的微調版本,經過訓練可執行 抽象摘要 任務。輸入序列的最大長度為 1024 個標記。
🚀 快速開始
安裝依賴
本項目依賴 transformers
庫,你可以使用以下命令進行安裝:
pip install transformers
代碼示例
以下是使用該模型進行法律文檔摘要的代碼示例:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("nsi319/legal-pegasus")
model = AutoModelForSeq2SeqLM.from_pretrained("nsi319/legal-pegasus")
text = """On March 5, 2021, the Securities and Exchange Commission charged AT&T, Inc. with repeatedly violating Regulation FD, and three of its Investor Relations executives with aiding and abetting AT&T's violations, by selectively disclosing material nonpublic information to research analysts. According to the SEC's complaint, AT&T learned in March 2016 that a steeper-than-expected decline in its first quarter smartphone sales would cause AT&T's revenue to fall short of analysts' estimates for the quarter. The complaint alleges that to avoid falling short of the consensus revenue estimate for the third consecutive quarter, AT&T Investor Relations executives Christopher Womack, Michael Black, and Kent Evans made private, one-on-one phone calls to analysts at approximately 20 separate firms. On these calls, the AT&T executives allegedly disclosed AT&T's internal smartphone sales data and the impact of that data on internal revenue metrics, despite the fact that internal documents specifically informed Investor Relations personnel that AT&T's revenue and sales of smartphones were types of information generally considered "material" to AT&T investors, and therefore prohibited from selective disclosure under Regulation FD. The complaint further alleges that as a result of what they were told on these calls, the analysts substantially reduced their revenue forecasts, leading to the overall consensus revenue estimate falling to just below the level that AT&T ultimately reported to the public on April 26, 2016. The SEC's complaint, filed in federal district court in Manhattan, charges AT&T with violations of the disclosure provisions of Section 13(a) of the Securities Exchange Act of 1934 and Regulation FD thereunder, and charges Womack, Evans and Black with aiding and abetting these violations. The complaint seeks permanent injunctive relief and civil monetary penalties against each defendant. The SEC's investigation was conducted by George N. Stepaniuk, Thomas Peirce, and David Zetlin-Jones of the SEC's New York Regional Office. The SEC's litigation will be conducted by Alexander M. Vasilescu, Victor Suthammanont, and Mr. Zetlin-Jones. The case is being supervised by Sanjay Wadhwa."""
input_tokenized = tokenizer.encode(text, return_tensors='pt',max_length=1024,truncation=True)
summary_ids = model.generate(input_tokenized,
num_beams=9,
no_repeat_ngram_size=3,
length_penalty=2.0,
min_length=150,
max_length=250,
early_stopping=True)
summary = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids][0]
### Summary Output
# The Securities and Exchange Commission today charged AT&T, Inc. and three of its Investor Relations executives with aiding and abetting the company's violations of the antifraud provisions of Section 10(b) of the Securities Exchange Act of 1934 and Rule 10b-5 thereunder. According to the SEC's complaint, the company learned in March 2016 that a steeper-than-expected decline in its first quarter smartphone sales would cause its revenue to fall short of analysts' estimates for the quarter. The complaint alleges that to avoid falling short of the consensus revenue estimate for the third consecutive quarter, the executives made private, one-on-one phone calls to analysts at approximately 20 separate firms. On these calls, the SEC alleges that Christopher Womack, Michael Black, and Kent Evans allegedly disclosed internal smartphone sales data and the impact of that data on internal revenue metrics. The SEC further alleges that as a result of what they were told, the analysts substantially reduced their revenue forecasts, leading to the overall consensus Revenue Estimate falling to just below the level that AT&t ultimately reported to the public on April 26, 2016. The SEC is seeking permanent injunctive relief and civil monetary penalties against each defendant.
📦 訓練數據
該模型在 sec-litigation-releases 數據集上進行訓練,該數據集包含超過 2700 份訴訟公告和投訴。
📊 評估結果
模型 | rouge1 | rouge1 精度 | rouge2 | rouge2 精度 | rougeL | rougeL 精度 |
---|---|---|---|---|---|---|
legal-pegasus | 57.39 | 62.97 | 26.85 | 28.42 | 30.91 | 33.22 |
pegasus-cnn_dailymail | 43.16 | 45.68 | 13.75 | 14.56 | 18.82 | 20.07 |
📄 許可證
本項目採用 MIT 許可證。
Bart Large Cnn
MIT
基於英語語料預訓練的BART模型,專門針對CNN每日郵報數據集進行微調,適用於文本摘要任務
文本生成 英語
B
facebook
3.8M
1,364
Parrot Paraphraser On T5
Parrot是一個基於T5的釋義框架,專為加速訓練自然語言理解(NLU)模型而設計,通過生成高質量釋義實現數據增強。
文本生成
Transformers

P
prithivida
910.07k
152
Distilbart Cnn 12 6
Apache-2.0
DistilBART是BART模型的蒸餾版本,專門針對文本摘要任務進行了優化,在保持較高性能的同時顯著提升了推理速度。
文本生成 英語
D
sshleifer
783.96k
278
T5 Base Summarization Claim Extractor
基於T5架構的模型,專門用於從摘要文本中提取原子聲明,是摘要事實性評估流程的關鍵組件。
文本生成
Transformers 英語

T
Babelscape
666.36k
9
Unieval Sum
UniEval是一個統一的多維評估器,用於自然語言生成任務的自動評估,支持多個可解釋維度的評估。
文本生成
Transformers

U
MingZhong
318.08k
3
Pegasus Paraphrase
Apache-2.0
基於PEGASUS架構微調的文本複述模型,能夠生成語義相同但表達不同的句子。
文本生成
Transformers 英語

P
tuner007
209.03k
185
T5 Base Korean Summarization
這是一個基於T5架構的韓語文本摘要模型,專為韓語文本摘要任務設計,通過微調paust/pko-t5-base模型在多個韓語數據集上訓練而成。
文本生成
Transformers 韓語

T
eenzeenee
148.32k
25
Pegasus Xsum
PEGASUS是一種基於Transformer的預訓練模型,專門用於抽象文本摘要任務。
文本生成 英語
P
google
144.72k
198
Bart Large Cnn Samsum
MIT
基於BART-large架構的對話摘要模型,專為SAMSum語料庫微調,適用於生成對話摘要。
文本生成
Transformers 英語

B
philschmid
141.28k
258
Kobart Summarization
MIT
基於KoBART架構的韓語文本摘要模型,能夠生成韓語新聞文章的簡潔摘要。
文本生成
Transformers 韓語

K
gogamza
119.18k
12
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98