Downloads · 30 days
19
3% of all-time downloads
bphclegalie/t5-base-legen
t5-base-legen is a text generation model from bphclegalie. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
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 sen…
Downloads · 30 days
19
3% of all-time downloads
All-time downloads
726
Public
Repo size
2 GB
Likes
2
Public
Click a slice to open those files.
.bin990 MB · 100%
From the Hugging Face model README
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.
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 is finetuned and can directly be used.
[More Information Needed]
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]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]