Edit model card

Model Card for Model ID

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

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
  • Model type: Language model
  • Language(s) (NLP): English
  • Finetuned from model [optional]: flan-t5-base

Uses

Direct Use

Model is finetuned and can directly be used.

[More Information Needed]

Recommendations

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

[More Information Needed]

Training Procedure

Preprocessing [optional]

[More Information Needed]

Training Hyperparameters

  • Training regime: [More Information Needed]

Speeds, Sizes, Times [optional]

[More Information Needed]

Evaluation

Testing Data, Factors & Metrics

Testing Data

[More Information Needed]

Factors

[More Information Needed]

Metrics

[More Information Needed]

Results

[More Information Needed]

Summary

Technical Specifications [optional]

Model Architecture and Objective

[More Information Needed]

Glossary [optional]

[More Information Needed]

More Information [optional]

[More Information Needed]

Model Card Authors [optional]

[More Information Needed]

Model Card Contact

[More Information Needed]

Downloads last month
12