Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,172 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
<!-- Provide a longer summary of what this model is. -->
|
| 17 |
-
|
| 18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 19 |
-
|
| 20 |
-
- **Developed by:** [More Information Needed]
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
<!-- Provide the basic links for the model. -->
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
### Direct Use
|
| 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 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
|
| 84 |
### Training Procedure
|
| 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 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
datasets:
|
| 4 |
+
- aicinema69/CAT-2025
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
- hi
|
| 8 |
+
base_model:
|
| 9 |
+
- NousResearch/Llama-2-7b-chat-hf
|
| 10 |
---
|
| 11 |
+
# CLAT Mentor LLM - Legal Reasoning Assistant
|
| 12 |
|
| 13 |
+
[](https://huggingface.co/aicinema69/CLAT_Mentor_LLM)
|
| 14 |
+
[]()
|
| 15 |
+
[]()
|
| 16 |
|
| 17 |
+
## Model Description
|
| 18 |
|
| 19 |
+
CLAT Mentor LLM is a specialized language model fine-tuned for the legal domain, specifically designed to assist aspirants preparing for the Common Law Admission Test (CLAT) in India. This model enhances legal reasoning capabilities and provides context-aware responses to questions related to legal concepts, case laws, and CLAT examination topics.
|
| 20 |
|
| 21 |
+
## Key Capabilities
|
| 22 |
|
| 23 |
+
- **Legal Reasoning**: Analyzes legal scenarios and provides logical explanations
|
| 24 |
+
- **Case Law Analysis**: Identifies relevant precedents and explains their applications
|
| 25 |
+
- **CLAT Exam Guidance**: Offers targeted assistance for CLAT preparation
|
| 26 |
+
- **RAG-Compatible**: Optimized for Retrieval-Augmented Generation applications
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
## Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
- **Developed by**: Satyam Singh
|
| 31 |
+
- **Model type**: Transformer-based Language Model
|
| 32 |
+
- **Language**: English (with some Hindi support)
|
| 33 |
+
- **License**: Open Source
|
| 34 |
+
- **Finetuned from model**: [NousResearch/Llama-2-7b-chat-hf](https://huggingface.co/NousResearch/Llama-2-7b-chat-hf)
|
| 35 |
|
| 36 |
+
## Use Cases
|
| 37 |
|
| 38 |
### Direct Use
|
| 39 |
|
| 40 |
+
This model can be directly used for:
|
| 41 |
+
- Answering questions about legal concepts and principles
|
| 42 |
+
- Explaining case laws and their applications
|
| 43 |
+
- Providing guidance on CLAT exam preparation strategies
|
| 44 |
+
- Assisting with legal reasoning puzzles and logical deduction
|
| 45 |
|
| 46 |
+
### Downstream Use
|
| 47 |
|
| 48 |
+
The model is optimized for integration into:
|
| 49 |
+
- Legal education platforms
|
| 50 |
+
- CLAT preparation applications
|
| 51 |
+
- RAG-based legal research systems
|
| 52 |
+
- Educational chatbots for law aspirants
|
| 53 |
|
| 54 |
+
### Out-of-Scope Use
|
| 55 |
|
| 56 |
+
This model is not intended for:
|
| 57 |
+
- Providing legal advice that would replace a qualified attorney
|
| 58 |
+
- Generating legal documents for official use
|
| 59 |
+
- Making predictions about case outcomes in real legal proceedings
|
| 60 |
+
- Using in contexts where legal errors could have significant consequences
|
| 61 |
|
| 62 |
+
## Bias, Risks, and Limitations
|
| 63 |
|
| 64 |
+
- The model may reflect biases present in legal education materials and case law
|
| 65 |
+
- It has been trained primarily on Indian legal concepts and may have limited knowledge of other legal systems
|
| 66 |
+
- The model should not be used as a substitute for professional legal advice
|
| 67 |
+
- Outputs should be verified by legal professionals for critical applications
|
| 68 |
|
| 69 |
+
## Getting Started
|
| 70 |
|
| 71 |
+
### Using with Transformers Library
|
| 72 |
|
| 73 |
+
```python
|
| 74 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 75 |
|
| 76 |
+
# Load the model and tokenizer
|
| 77 |
+
tokenizer = AutoTokenizer.from_pretrained("aicinema69/CLAT_Mentor_LLM")
|
| 78 |
+
model = AutoModelForCausalLM.from_pretrained("aicinema69/CLAT_Mentor_LLM")
|
| 79 |
|
| 80 |
+
# Generate a response
|
| 81 |
+
prompt = "Explain the concept of precedent in Indian law."
|
| 82 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 83 |
+
outputs = model.generate(**inputs, max_length=200)
|
| 84 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 85 |
+
print(response)
|
| 86 |
+
```
|
| 87 |
|
| 88 |
+
### Using with Hugging Face Inference API
|
| 89 |
|
| 90 |
+
```python
|
| 91 |
+
import requests
|
| 92 |
|
| 93 |
+
API_URL = "https://api-inference.huggingface.co/models/aicinema69/CLAT_Mentor_LLM"
|
| 94 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 95 |
|
| 96 |
+
def query(payload):
|
| 97 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 98 |
+
return response.json()
|
| 99 |
|
| 100 |
+
output = query({
|
| 101 |
+
"inputs": "What topics should I focus on for the CLAT legal reasoning section?",
|
| 102 |
+
})
|
| 103 |
+
print(output)
|
| 104 |
+
```
|
| 105 |
|
| 106 |
## Training Details
|
| 107 |
|
| 108 |
### Training Data
|
| 109 |
|
| 110 |
+
This model was fine-tuned on the specialized dataset:
|
| 111 |
+
- Dataset: [aicinema69/CAT-2025](https://huggingface.co/datasets/aicinema69/CAT-2025)
|
| 112 |
+
- Dataset includes CLAT preparation materials, legal case summaries, and curated legal reasoning Q&A pairs
|
| 113 |
|
| 114 |
### Training Procedure
|
| 115 |
|
| 116 |
+
- **Fine-tuning method**: PEFT/LoRA (Parameter-Efficient Fine-Tuning)
|
| 117 |
+
- **Base model**: NousResearch/Llama-2-7b-chat-hf
|
| 118 |
+
- **Training regime**: 4-bit quantization (nf4)
|
| 119 |
+
- **Epochs**: 5 (originally planned for 20)
|
| 120 |
+
- **Batch size**: 4 per device
|
| 121 |
+
- **Optimizer**: AdamW (paged_adamw_32bit)
|
| 122 |
+
- **Learning rate**: 2e-4
|
| 123 |
+
- **Weight decay**: 0.001
|
| 124 |
+
- **LR scheduler**: cosine
|
| 125 |
+
- **Warmup ratio**: 0.03
|
| 126 |
+
|
| 127 |
+
#### LoRA Configuration
|
| 128 |
+
- **LoRA attention dimension (r)**: 64
|
| 129 |
+
- **LoRA alpha**: 16
|
| 130 |
+
- **LoRA dropout**: 0.1
|
| 131 |
+
|
| 132 |
+
#### Quantization Settings
|
| 133 |
+
- **Precision**: 4-bit
|
| 134 |
+
- **Quantization type**: nf4
|
| 135 |
+
- **Compute dtype**: float16
|
| 136 |
+
|
| 137 |
+
## Integration with CLAT Mentor Application
|
| 138 |
+
|
| 139 |
+
This model is a core component of the CLAT Mentor AI assistant, which combines:
|
| 140 |
+
- This fine-tuned LLM for domain-specific knowledge
|
| 141 |
+
- FAISS vector database for retrieval-augmented generation
|
| 142 |
+
- Streamlit-based interactive interface for user interaction
|
| 143 |
+
|
| 144 |
+
For the complete application code, visit: [GitHub Repository](https://github.com/SatyamSingh8306)
|
| 145 |
+
|
| 146 |
+
## Citation
|
| 147 |
+
|
| 148 |
+
If you use this model in your research or application, please cite:
|
| 149 |
+
|
| 150 |
+
```bibtex
|
| 151 |
+
@misc{singh2025clatmentor,
|
| 152 |
+
author = {Singh, Satyam},
|
| 153 |
+
title = {CLAT Mentor LLM: A Fine-tuned Language Model for Legal Reasoning},
|
| 154 |
+
year = {2025},
|
| 155 |
+
publisher = {Hugging Face},
|
| 156 |
+
howpublished = {\url{https://huggingface.co/aicinema69/CLAT_Mentor_LLM}}
|
| 157 |
+
}
|
| 158 |
+
```
|
| 159 |
+
|
| 160 |
+
## Contact
|
| 161 |
+
|
| 162 |
+
- **Developer**: Satyam Singh
|
| 163 |
+
- **LinkedIn**: [linkedin.com/in/satyam8306](https://linkedin.com/in/satyam8306)
|
| 164 |
+
- **GitHub**: [SatyamSingh8306](https://github.com/SatyamSingh8306)
|
| 165 |
+
- **Email**: satyamsingh7734@gmail.com
|
| 166 |
+
|
| 167 |
+
## Acknowledgements
|
| 168 |
+
|
| 169 |
+
- National Law Technology Institute (NLTI) for domain expertise
|
| 170 |
+
- NousResearch for the base Llama-2-7b-chat-hf model
|
| 171 |
+
- Hugging Face for the transformers library and model hosting platforms
|
| 172 |
+
- The PEFT library developers for enabling efficient fine-tuning methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|