Update README.md
Browse files
README.md
CHANGED
@@ -52,19 +52,25 @@ Model for predicting relations between entities in the financial documents.
|
|
52 |
```python
|
53 |
finetune_name = 'Askinkaty/llama-finance-relations'
|
54 |
|
|
|
55 |
finetined_model = AutoPeftModelForCausalLM.from_pretrained(
|
56 |
pretrained_model_name_or_path=finetune_name,
|
57 |
torch_dtype=torch.float16,
|
58 |
low_cpu_mem_usage=True,
|
|
|
59 |
)
|
60 |
|
|
|
|
|
|
|
|
|
61 |
|
62 |
-
base_model = "meta-llama/Llama-3.2-1B-Instruct"
|
63 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
64 |
-
base_model.config.pad_token_id = base_model.config.eos_token_id
|
65 |
|
|
|
|
|
66 |
|
67 |
-
pipeline = pipeline('text-generation', model=base_model, tokenizer=tokenizer)
|
68 |
pipeline.model = model.to(device)
|
69 |
```
|
70 |
|
@@ -141,18 +147,40 @@ LORA parameters:
|
|
141 |
Test set sampled from Samples from [ReFinD dataset](https://refind-re.github.io/).
|
142 |
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
#### Metrics
|
148 |
|
149 |
-
Accuracy. Other metrics: work in progress.
|
150 |
-
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
154 |
|
155 |
-
Accuracy: 0.71
|
156 |
|
157 |
|
158 |
- PEFT 0.14.0
|
|
|
52 |
```python
|
53 |
finetune_name = 'Askinkaty/llama-finance-relations'
|
54 |
|
55 |
+
|
56 |
finetined_model = AutoPeftModelForCausalLM.from_pretrained(
|
57 |
pretrained_model_name_or_path=finetune_name,
|
58 |
torch_dtype=torch.float16,
|
59 |
low_cpu_mem_usage=True,
|
60 |
+
device_map="auto",
|
61 |
)
|
62 |
|
63 |
+
base_model_name = "meta-llama/Llama-3.2-1B-Instruct"
|
64 |
+
base_model = AutoModelForCausalLM.from_pretrained(base_model_name,
|
65 |
+
torch_dtype=torch.float16,
|
66 |
+
low_cpu_mem_usage=True)
|
67 |
|
|
|
68 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
69 |
|
70 |
+
base_model.config.pad_token_id = base_model.config.eos_token_id
|
71 |
+
model.config.pad_token_id = model.config.eos_token_id
|
72 |
|
73 |
+
pipeline = pipeline('text-generation', model=base_model, tokenizer=tokenizer, max_length=1024, device=device)
|
74 |
pipeline.model = model.to(device)
|
75 |
```
|
76 |
|
|
|
147 |
Test set sampled from Samples from [ReFinD dataset](https://refind-re.github.io/).
|
148 |
|
149 |
|
|
|
|
|
|
|
150 |
#### Metrics
|
151 |
|
|
|
|
|
152 |
|
153 |
+
```
|
154 |
+
Overall Performance:
|
155 |
+
Precision: 0.77
|
156 |
+
Recall: 0.69
|
157 |
+
F1 Score: 0.71
|
158 |
+
|
159 |
+
Classification Report:
|
160 |
+
precision recall f1-score support
|
161 |
+
|
162 |
+
no_relation 0.00 0.00 0.00 0
|
163 |
+
title 0.00 0.00 0.00 0
|
164 |
+
operations_in 0.65 0.66 0.66 100
|
165 |
+
employee_of 0.00 0.00 0.00 0
|
166 |
+
agreement_with 0.58 0.88 0.70 100
|
167 |
+
formed_on 0.00 0.00 0.00 0
|
168 |
+
member_of 0.99 0.96 0.97 96
|
169 |
+
subsidiary_of 0.00 0.00 0.00 0
|
170 |
+
shares_of 0.00 0.00 0.00 0
|
171 |
+
revenue_of 0.60 0.27 0.38 95
|
172 |
+
loss_of 0.64 0.37 0.47 100
|
173 |
+
headquartered_in 0.99 0.73 0.84 100
|
174 |
+
acquired_on 0.00 0.00 0.00 0
|
175 |
+
founder_of 0.74 0.77 0.76 83
|
176 |
+
formed_in 0.96 0.91 0.93 100
|
177 |
+
|
178 |
+
accuracy 0.69 774
|
179 |
+
macro avg 0.41 0.37 0.38 774
|
180 |
+
weighted avg 0.77 0.69 0.71 774
|
181 |
|
182 |
+
```
|
183 |
|
|
|
184 |
|
185 |
|
186 |
- PEFT 0.14.0
|