t5-base-legen / README.md
sankalp151's picture
Update README.md
a174cfd
---
license: mit
language:
- en
pipeline_tag: text2text-generation
tags:
- legal
---
# Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
This model is useful in the pipeline of complex information extraction. The model will generate discourse trees from complex sentences.
Discourse trees contain simple split sentences and relationship between these sentences.
## Model Details
### Model Description
<!-- Provide a longer summary of what this model is. -->
This model is useful in the pipeline of complex information extraction. The model will generate discourse trees from complex sentences.
Discourse trees contain simple split sentences and relationship between these sentences.
- **Developed by:** BITS Hyderabad
<!-- - **Funded by [optional]:** [More Information Needed] -->
<!-- - **Shared by [optional]:** [More Information Needed] -->
- **Model type:** Language model
- **Language(s) (NLP):** English
<!-- - **License:** [More Information Needed] -->
- **Finetuned from model [optional]:** [flan-t5-base](https://huggingface.co/google/flan-t5-base)
## Uses
### Direct Use
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
Model is finetuned and can directly be used.
[More Information Needed]
### Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
## How to Get Started with the Model
Use the code below to get started with the model.
```
# If using Google Colab, login to HuggingFace is needed. Doing the following will prompt to enter the access token
# which can be obtained from Settings > AccessTokens
from huggingface_hub import notebook_login
notebook_login()
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import spacy
tokenizer = AutoTokenizer.from_pretrained("bphclegalie/t5-base-legen", token = True)
model = AutoModelForSeq2SeqLM.from_pretrained("bphclegalie/t5-base-legen", token = True)
nlp = spacy.load("en_core_web_sm")
def get_discourse_tree(text):
sentences = " ".join([t.text for t in nlp(text)])
input_ids = tokenizer(text, max_length=384, truncation=True, return_tensors="pt").input_ids
outputs = model.generate(input_ids=input_ids, max_length=128)
answer = [tokenizer.decode(output, skip_special_tokens = True) for output in outputs]
return " ".join(answer)
```
[More Information Needed]
## Training Details
### Training Data
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
[More Information Needed]
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Preprocessing [optional]
[More Information Needed]
#### Training Hyperparameters
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
#### Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]
## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Dataset Card if possible. -->
[More Information Needed]
#### Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
[More Information Needed]
#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
[More Information Needed]
### Results
[More Information Needed]
#### Summary
## Technical Specifications [optional]
### Model Architecture and Objective
[More Information Needed]
## Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
[More Information Needed]
## More Information [optional]
[More Information Needed]
## Model Card Authors [optional]
[More Information Needed]
## Model Card Contact
[More Information Needed]