Update README.md
Browse files
README.md
CHANGED
@@ -7,7 +7,7 @@ tags: []
|
|
7 |
|
8 |
This repository contains the results of our merged rag relevance PEFT adapter model.
|
9 |
|
10 |
-
### Classification
|
11 |
|
12 |
Our merged model achieves the following performance on a binary classification task:
|
13 |
|
@@ -22,6 +22,45 @@ Our merged model achieves the following performance on a binary classification t
|
|
22 |
weighted avg 0.75 0.75 0.75 200
|
23 |
```
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
### Comparison with Other Models
|
26 |
|
27 |
We compared our merged model's performance on the RAG Eval benchmark against several other state-of-the-art language models:
|
|
|
7 |
|
8 |
This repository contains the results of our merged rag relevance PEFT adapter model.
|
9 |
|
10 |
+
### RAG Relevance Classification Metrics
|
11 |
|
12 |
Our merged model achieves the following performance on a binary classification task:
|
13 |
|
|
|
22 |
weighted avg 0.75 0.75 0.75 200
|
23 |
```
|
24 |
|
25 |
+
### Model Usage
|
26 |
+
For best results, we recommend starting with the following prompting strategy (and encourage tweaks as you see fit):
|
27 |
+
|
28 |
+
```python
|
29 |
+
def format_input_classification(query, text):
|
30 |
+
input = f"""
|
31 |
+
You are comparing a reference text to a question and trying to determine if the reference text
|
32 |
+
contains information relevant to answering the question. Here is the data:
|
33 |
+
[BEGIN DATA]
|
34 |
+
************
|
35 |
+
[Question]: {query}
|
36 |
+
************
|
37 |
+
[Reference text]: {text}
|
38 |
+
************
|
39 |
+
[END DATA]
|
40 |
+
Compare the Question above to the Reference text. You must determine whether the Reference text
|
41 |
+
contains information that can answer the Question. Please focus on whether the very specific
|
42 |
+
question can be answered by the information in the Reference text.
|
43 |
+
Your response must be single word, either "relevant" or "unrelated",
|
44 |
+
and should not contain any text or characters aside from that word.
|
45 |
+
"unrelated" means that the reference text does not contain an answer to the Question.
|
46 |
+
"relevant" means the reference text contains an answer to the Question."""
|
47 |
+
return input
|
48 |
+
|
49 |
+
|
50 |
+
text = format_input_classification("What is quanitzation?",
|
51 |
+
"Quantization is a method to reduce the memory footprint")
|
52 |
+
messages = [
|
53 |
+
{"role": "user", "content": text}
|
54 |
+
]
|
55 |
+
|
56 |
+
pipe = pipeline(
|
57 |
+
"text-generation",
|
58 |
+
model=base_model,
|
59 |
+
model_kwargs={"attn_implementation": attn_implementation, "torch_dtype": torch.float16},
|
60 |
+
tokenizer=tokenizer,
|
61 |
+
)
|
62 |
+
```
|
63 |
+
|
64 |
### Comparison with Other Models
|
65 |
|
66 |
We compared our merged model's performance on the RAG Eval benchmark against several other state-of-the-art language models:
|