🚀 stjiris/t5-portuguese-legal-summarization
這是一個在“unicamp - dl/ptt5 - base - portuguese - vocab” T5模型基礎上進行微調的模型,利用各種判例及其摘要進行訓練,可用於法律領域的文本摘要任務。
🚀 快速開始
本項目是作為 [Project IRIS](https://www.inesc - id.pt/projects/PR07005/) 的一部分而開展的工作。相關論文為 A Semantic Search System for Supremo Tribunal de Justiça。
項目相關鏈接
✨ 主要特性
該模型是在“unicamp - dl/ptt5 - base - portuguese - vocab” T5模型基礎上進行微調得到的,使用了各種判例及其摘要進行訓練。
💻 使用示例
基礎用法
from transformers import T5Tokenizer, T5ForConditionalGeneration
model_checkpoint = "stjiris/t5-portuguese-legal-summarization"
t5_model = T5ForConditionalGeneration.from_pretrained(model_checkpoint)
t5_tokenizer = T5Tokenizer.from_pretrained(model_checkpoint)
preprocess_text = "These are some big words and text and words and text, again, that we want to summarize"
t5_prepared_Text = "summarize: "+preprocess_text
tokenized_text = t5_tokenizer.encode(t5_prepared_Text, return_tensors="pt").to(device)
summary_ids = t5_model.generate(tokenized_text,
num_beams=4,
no_repeat_ngram_size=2,
min_length=512,
max_length=1024,
early_stopping=True)
output = t5_tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print ("\n\nSummarized text: \n",output)
📄 許可證
本項目採用 MIT 許可證。
📚 引用與作者
貢獻者
@rufimelo99
引用信息
如果您使用了本項目的成果,請引用以下文獻:
@InProceedings{MeloSemantic,
author="Melo, Rui
and Santos, Pedro A.
and Dias, Jo{\~a}o",
editor="Moniz, Nuno
and Vale, Zita
and Cascalho, Jos{\'e}
and Silva, Catarina
and Sebasti{\~a}o, Raquel",
title="A Semantic Search System for the Supremo Tribunal de Justi{\c{c}}a",
booktitle="Progress in Artificial Intelligence",
year="2023",
publisher="Springer Nature Switzerland",
address="Cham",
pages="142--154",
abstract="Many information retrieval systems use lexical approaches to retrieve information. Such approaches have multiple limitations, and these constraints are exacerbated when tied to specific domains, such as the legal one. Large language models, such as BERT, deeply understand a language and may overcome the limitations of older methodologies, such as BM25. This work investigated and developed a prototype of a Semantic Search System to assist the Supremo Tribunal de Justi{\c{c}}a (Portuguese Supreme Court of Justice) in its decision-making process. We built a Semantic Search System that uses specially trained BERT models (Legal-BERTimbau variants) and a Hybrid Search System that incorporates both lexical and semantic techniques by combining the capabilities of BM25 and the potential of Legal-BERTimbau. In this context, we obtained a {\$}{\$}335{\backslash}{\%}{\$}{\$}335{\%}increase on the discovery metric when compared to BM25 for the first query result. This work also provides information on the most relevant techniques for training a Large Language Model adapted to Portuguese jurisprudence and introduces a new technique of Metadata Knowledge Distillation.",
isbn="978-3-031-49011-8"
}
@article{ptt5_2020,
title={PTT5: Pretraining and validating the T5 model on Brazilian Portuguese data},
author={Carmo, Diedre and Piau, Marcos and Campiotti, Israel and Nogueira, Rodrigo and Lotufo, Roberto},
journal={arXiv preprint arXiv:2008.09144},
year={2020}
}