law-ai commited on
Commit
7a2772f
1 Parent(s): 4c30273

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -14
README.md CHANGED
@@ -7,7 +7,7 @@ license: mit
7
  ---
8
 
9
  ### InLegalBERT
10
- Model and tokenizer files for the InLegalBERT model.
11
 
12
  ### Training Data
13
  For building the pre-training corpus of Indian legal text, we collected a large corpus of case documents from the Indian Supreme Court and many High Courts of India.
@@ -20,33 +20,41 @@ This model is initialized with the [LEGAL-BERT-SC model](https://huggingface.co/
20
  We further train this model on our data for 300K steps on the Masked Language Modeling (MLM) and Next Sentence Prediction (NSP) tasks.
21
 
22
  ### Model Overview
 
23
  This model has the same configuration as the [bert-base-uncased model](https://huggingface.co/bert-base-uncased):
24
  12 hidden layers, 768 hidden dimensionality, 12 attention heads, ~110M parameters.
25
 
26
  ### Usage
27
- Using the tokenizer (same as [LegalBERT](https://huggingface.co/nlpaueb/legal-bert-base-uncased))
28
  ```python
29
- from transformers import AutoTokenizer
30
  tokenizer = AutoTokenizer.from_pretrained("law-ai/InLegalBERT")
31
- ```
32
- Using the model to get embeddings/representations for a sentence
33
- ```python
34
- from transformers import AutoModel
35
  model = AutoModel.from_pretrained("law-ai/InLegalBERT")
 
 
36
  ```
37
 
38
  ### Fine-tuning Results
 
 
 
 
 
39
 
40
  ### Citation
41
  ```
42
- @inproceedings{paul-2022-ptinlegal,
43
- title = "Pre-training Transformers on Indian Legal Text",
44
- author = "Paul, Shounak and
45
- Mandal, Arpan and
46
- Goyal, Pawan and
47
- Ghosh, Saptarshi",
48
- eprinttype = {arXiv}
 
49
  }
 
50
  ```
51
 
52
  ### About Us
 
7
  ---
8
 
9
  ### InLegalBERT
10
+ Model and tokenizer files for the InLegalBERT model from the paper [Pre-training Transformers on Indian Legal Text](https://arxiv.org/abs/2209.06049).
11
 
12
  ### Training Data
13
  For building the pre-training corpus of Indian legal text, we collected a large corpus of case documents from the Indian Supreme Court and many High Courts of India.
 
20
  We further train this model on our data for 300K steps on the Masked Language Modeling (MLM) and Next Sentence Prediction (NSP) tasks.
21
 
22
  ### Model Overview
23
+ This model uses the same tokenizer as [LegalBERT](https://huggingface.co/nlpaueb/legal-bert-base-uncased).
24
  This model has the same configuration as the [bert-base-uncased model](https://huggingface.co/bert-base-uncased):
25
  12 hidden layers, 768 hidden dimensionality, 12 attention heads, ~110M parameters.
26
 
27
  ### Usage
28
+ Using the model to get embeddings/representations for a piece of text
29
  ```python
30
+ from transformers import AutoTokenizer, AutoModel
31
  tokenizer = AutoTokenizer.from_pretrained("law-ai/InLegalBERT")
32
+ text = "Replace this string with yours"
33
+ encoded_input = tokenizer(text, return_tensors="pt")
 
 
34
  model = AutoModel.from_pretrained("law-ai/InLegalBERT")
35
+ output = model(**encoded_input)
36
+ last_hidden_state = output.last_hidden_state
37
  ```
38
 
39
  ### Fine-tuning Results
40
+ We have fine-tuned all pre-trained models on 3 legal tasks with Indian datasets:
41
+ * Legal Statute Identification ([ILSI Dataset](https://arxiv.org/abs/2112.14731))[Multi-label Text Classification]: Identifying relevant statutes (law articles) based on the facts of a court case
42
+ * Semantic Segmentation ([ISS Dataset](https://arxiv.org/abs/1911.05405))[Sentence Tagging]: Segmenting the document into 7 functional parts (semantic segments) such as Facts, Arguments, etc.
43
+ * Court Judgment Prediction ([ILDC Dataset](https://arxiv.org/abs/2105.13562))[Binary Text Classification]: Predicting whether the claims/petitions of a court case will be accepted/rejected
44
+ This InLegalBERT beats LegalBERT as well as all other baselines/variants we have used. For details, see our [paper](https://arxiv.org/abs/2209.06049).
45
 
46
  ### Citation
47
  ```
48
+ @article{paul-2022-pretraining,
49
+ doi = {10.48550/ARXIV.2209.06049},
50
+ url = {https://arxiv.org/abs/2209.06049},
51
+ author = {Paul, Shounak and Mandal, Arpan and Goyal, Pawan and Ghosh, Saptarshi},
52
+ title = {Pre-training Transformers on Indian Legal Text},
53
+ publisher = {arXiv},
54
+ year = {2022},
55
+ copyright = {Creative Commons Attribution 4.0 International}
56
  }
57
+
58
  ```
59
 
60
  ### About Us