Text Classification
Transformers
Safetensors
English
bert
fill-mask
question-answering
evaluation
text
Instructions to use zli12321/answer_equivalence_bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zli12321/answer_equivalence_bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="zli12321/answer_equivalence_bert")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("zli12321/answer_equivalence_bert") model = AutoModelForMaskedLM.from_pretrained("zli12321/answer_equivalence_bert") - Notebooks
- Google Colab
- Kaggle
Zongxia Li commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -41,6 +41,32 @@ Exact Match: False
|
|
| 41 |
'''
|
| 42 |
```
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
#### Transformer Match
|
| 45 |
Our fine-tuned BERT model is this repository. Our Package also supports downloading and matching directly. distilroberta, distilbert, and roberta are also supported now! 🔥🔥🔥
|
| 46 |
|
|
|
|
| 41 |
'''
|
| 42 |
```
|
| 43 |
|
| 44 |
+
#### Prompting LLM For Evaluation
|
| 45 |
+
|
| 46 |
+
Note: The prompting function can be used for any prompting purposes.
|
| 47 |
+
|
| 48 |
+
###### OpenAI
|
| 49 |
+
```python
|
| 50 |
+
from qa_metrics.prompt_llm import *
|
| 51 |
+
set_openai_api_key(YOUR_OPENAI_KEY)
|
| 52 |
+
prompt = 'question: What is the Capital of France?\nreference: Paris\ncandidate: The capital is Paris\nIs the candidate answer correct based on the question and reference answer? Please only output correct or incorrect.'
|
| 53 |
+
prompt_gpt(prompt=prompt, model_engine='gpt-3.5-turbo', temperature=0.1, max_token=10)
|
| 54 |
+
|
| 55 |
+
'''
|
| 56 |
+
'correct'
|
| 57 |
+
'''
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
###### Anthropic
|
| 61 |
+
```python
|
| 62 |
+
set_anthropic_api_key(YOUR_OPENAI_KEY)
|
| 63 |
+
prompt_claude(prompt=prompt, model_engine='claude-v1', anthropic_version="2023-06-01", max_tokens_to_sample=100, temperature=0.7)
|
| 64 |
+
|
| 65 |
+
'''
|
| 66 |
+
'correct'
|
| 67 |
+
'''
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
#### Transformer Match
|
| 71 |
Our fine-tuned BERT model is this repository. Our Package also supports downloading and matching directly. distilroberta, distilbert, and roberta are also supported now! 🔥🔥🔥
|
| 72 |
|