File size: 4,371 Bytes
b3726fe
 
8850784
 
 
 
 
b3726fe
8850784
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a174cfd
 
 
 
 
 
 
8850784
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
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]