-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Questions Eval: some improvements on computing score and better pro…
…mpts
- Loading branch information
1 parent
a753dc6
commit 37f20d8
Showing
7 changed files
with
139 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python run.py -m model=gpt-4o,gpt-4o-mini samples=50,100 | ||
python run.py -m model=llama3.1-405b-local question_model=gpt-4o samples=50 num_questions=6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python run.py -m model=gpt-4o,gpt-4o-mini samples=20 num_questions=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
_target_: langchain_community.llms.huggingface_text_gen_inference.HuggingFaceTextGenInference | ||
inference_server_url: http://20:216:186:42:8080 | ||
inference_server_url: http://20.216.186.42:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_target_: langchain_community.chat_models.ChatOpenAI | ||
model_name: gpt-4o |
2 changes: 2 additions & 0 deletions
2
lib/questions_eval/configs/question_model/llama3.1-405b-local.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_target_: langchain_community.llms.huggingface_text_gen_inference.HuggingFaceTextGenInference | ||
inference_server_url: http://20.216.186.42:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,49 @@ | ||
# @package _global_ | ||
defaults: | ||
- _self_ | ||
- model: gpt-4o.yaml | ||
- model: gpt-4o-mini.yaml | ||
- question_model: gpt-4o.yaml | ||
|
||
samples: 1 | ||
num_questions: 2 | ||
samples: 2 | ||
num_questions: 5 | ||
|
||
prompts: | ||
transcription: >- | ||
Given the following medical instruction and description, generate a synthetic transcription: | ||
Instruction: {instruction} Description: {description} | ||
As a clinician assistant, you must write a clinical report given these patients information. | ||
keywords: {keywords}, {derived_keywords} | ||
description: {description} | ||
medical specialty: {medical_specialty} | ||
Synthetic Transcription: | ||
question: >- | ||
Given the following transcription, generate a yes/no question that can be answered using the | ||
information in the transcription. The question must be formulated in a way that the correct | ||
answer is always 'yes': | ||
Transcription: {transcription} | ||
Question: | ||
As a clinical assistant, please formulate {num_questions} critical, concise and closed-ended | ||
questions (in a YES/NO format) that thoroughly scrutinize the document. The questions | ||
generated should ALWAYS result in a ‘YES’ based on the given text. Questions should be | ||
about the content of the document and not include any qualifier of the clarity, justification | ||
or definition. | ||
**Note** | ||
The questions have to be STRICTLY closed-ended and should not be subjective or open to | ||
human interpretation. | ||
You should return in a JSON format. The JSON should be a list of dictionaries where each | ||
dictionary will have two keys: | ||
- ‘question’: specifying the question | ||
- ‘answer’: either YES or NO. | ||
The given text should be able to answer ‘YES’ for each generated question. | ||
Document: {transcription} | ||
JSON: | ||
evaluation: >- | ||
Compare the following pairs of transcriptions and questions: | ||
As a clinical assistant, answer the following questions with a YES or NO, grounded on the | ||
text content only. Do not use any external knowledge. If you cannot answer the question | ||
based on the provided text, please respond with ‘IDK’. | ||
**Note** | ||
You should respond either YES, NO or IDK. | ||
Transcription : {transcription} | ||
Document : {transcription} | ||
Question : {question} Based on the given transcription, answer the question with only 'yes', | ||
'no', or 'idk' (if you don't know or can't determine from the information provided). Answer: | ||
Question : {question} | ||
Answer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters