🚀 GPT2-BioPT - a Language Model for Portuguese Biomedical text generation
GPT2-BioPT is a Portuguese-based language model tailored for biomedical text generation. It builds upon the OpenAI GPT - 2 model, fine - tuned from GPorTuguese - 2 using biomedical literature. This model offers a powerful tool for generating high - quality Portuguese biomedical texts.
✨ Features
- Based on GPT - 2: Leverages the robust architecture of the OpenAI GPT - 2 model.
- Transfer Learning and Fine - tuning: Utilizes transfer learning and fine - tuning techniques with 110MB of training data, which includes 16,209,373 tokens and 729,654 sentences.
📦 Installation
No specific installation steps are provided in the original README. If you want to use it with HuggingFace, you can follow the usage example below.
💻 Usage Examples
Basic Usage
from transformers import pipeline
chef = pipeline('text-generation', model="pucpr/gpt2-bio-pt", tokenizer="pucpr/gpt2-bio-pt", config={'max_length':800})
result = chef('O paciente chegou no hospital')[0]['generated_text']
print(result)
Example Output
O paciente chegou no hospital três meses após a operação, não houve complicações graves. Entre os grupos que apresentaram maior número de lesões, o exame da cavidade pélvica estava significantemente associado à ausência de complicações. Foi encontrada uma maior incidência de fraturas (...)
📚 Documentation
GPT - 2
Note: information copied/pasted from Model: gpt2 >> GPT - 2
The GPT - 2 model is a pretrained model on the English language using a causal language modeling (CLM) objective. It was introduced in this paper and first released at this page (February 14, 2019).
Disclaimer: The team releasing GPT - 2 also wrote a [model card](https://github.com/openai/gpt - 2/blob/master/model_card.md) for their model. Content from this model card has been written by the Hugging Face team to complete the information they provided and give specific examples of bias.
Model description
Note: information copied/pasted from Model: gpt2 >> Model description
GPT - 2 is a transformers model pretrained on a very large corpus of English data in a self - supervised fashion. It was trained on raw texts without human labeling, using an automatic process to generate inputs and labels from those texts. Specifically, it was trained to predict the next word in sentences.
More precisely, inputs are sequences of continuous text of a certain length, and the targets are the same sequence shifted one token (word or piece of word) to the right. The model uses an internal mask - mechanism to ensure that the predictions for the token i
only use the inputs from 1
to i
and not future tokens.
This way, the model learns an internal representation of the English language, which can be used to extract features useful for downstream tasks. It is particularly good at generating texts from a prompt.
📄 License
No license information is provided in the original README.
📚 Citation
@INPROCEEDINGS{9474713,
author={Schneider, Elisa Terumi Rubel and de Souza, João Vitor Andrioli and Gumiel, Yohan Bonescki and Moro, Claudia and Paraiso, Emerson Cabrera},
booktitle={2021 IEEE 34th International Symposium on Computer-Based Medical Systems (CBMS)},
title={A GPT-2 Language Model for Biomedical Texts in Portuguese},
year={2021},
volume={},
number={},
pages={474-479},
doi={10.1109/CBMS52027.2021.00056}}
❓ Questions
Post a Github issue on the [GPT2 - Bio - Pt repo](https://github.com/HAILab - PUCPR/gpt2 - bio - pt/).