Rajat.bans commited on
Commit
09c3be4
1 Parent(s): 2834406

Improved system prompt for question formation

Browse files
Files changed (1) hide show
  1. rag.py +4 -3
rag.py CHANGED
@@ -16,8 +16,8 @@ DB_FAISS_PATH = "./vectorstore/db_faiss_ads_20May_20Jun_webmd_healthline_Health_
16
  data_file_path = "./data/142_adclick_20May_20Jun_webmd_healthline_Health_dupRemoved0.8_someAdsCampaign.tsv"
17
  embedding_model_hf = "BAAI/bge-m3"
18
  qa_model_name = "gpt-3.5-turbo"
19
- default_threshold = 0.95
20
- relation_check_best_value_thresh = 0.8
21
  number_of_ads_to_fetch_from_db = 15
22
  bestRelationSystemPrompt = """You are an advertising concierge for text ads on websites. Given an INPUT(PAGE_TITLE) and the available ad inventory (ADS_DATA), your task is to determine whether there are some relevant ADS to INPUT are present in ADS_DATA. ADS WHICH DON'T MATCH USER'S INTENT SHOULD BE CONSIDERED IRRELEVANT
23
 
@@ -48,7 +48,8 @@ The ADS_DATA provided to you is as follows:
48
  bestQuestionSystemPrompt = """1. You are an advertising concierge for text ads on websites. Given an INPUT(PAGE_TITLE) and the available ad inventory (ADS_DATA), your task is to form a relevant QUESTION to ask the user visiting the webpage. This question should help identify the user's intent behind visiting the webpage.
49
  2. From the ADS_DATA, discard all ads that are not related to the INPUT or do not match the user's intent behind visiting the page. Also, remove any ads that are distantly related to the user's intent.
50
  3. FROM REMAINING ADS ONLY, group together those that are similar in type. For each grouped ads form an OPTION which should be both the answer for the QUESTION and related to ads in this group.
51
- 4. Provide your REASONING behind choosing the QUESTION and the OPTIONS. Now provide the QUESTION and the OPTIONS. Along with each OPTION, provide the ads from ADS_DATA that you associated with it.
 
52
 
53
  ---------------------------------------
54
 
 
16
  data_file_path = "./data/142_adclick_20May_20Jun_webmd_healthline_Health_dupRemoved0.8_someAdsCampaign.tsv"
17
  embedding_model_hf = "BAAI/bge-m3"
18
  qa_model_name = "gpt-3.5-turbo"
19
+ default_threshold = 0.75
20
+ relation_check_best_value_thresh = 0.6
21
  number_of_ads_to_fetch_from_db = 15
22
  bestRelationSystemPrompt = """You are an advertising concierge for text ads on websites. Given an INPUT(PAGE_TITLE) and the available ad inventory (ADS_DATA), your task is to determine whether there are some relevant ADS to INPUT are present in ADS_DATA. ADS WHICH DON'T MATCH USER'S INTENT SHOULD BE CONSIDERED IRRELEVANT
23
 
 
48
  bestQuestionSystemPrompt = """1. You are an advertising concierge for text ads on websites. Given an INPUT(PAGE_TITLE) and the available ad inventory (ADS_DATA), your task is to form a relevant QUESTION to ask the user visiting the webpage. This question should help identify the user's intent behind visiting the webpage.
49
  2. From the ADS_DATA, discard all ads that are not related to the INPUT or do not match the user's intent behind visiting the page. Also, remove any ads that are distantly related to the user's intent.
50
  3. FROM REMAINING ADS ONLY, group together those that are similar in type. For each grouped ads form an OPTION which should be both the answer for the QUESTION and related to ads in this group.
51
+ 4. Try to generate QUESTION within 70 characters and keep either 2, 3 or 4 number of OPTIONS.
52
+ 5. Provide your REASONING behind choosing the QUESTION and the OPTIONS. Now provide the QUESTION and the OPTIONS. Along with each OPTION, provide the ads from ADS_DATA that you associated with it.
53
 
54
  ---------------------------------------
55