ivxivx commited on
Commit
eab7e53
·
unverified ·
1 Parent(s): f3c5d0a

chore: prompt

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -29,33 +29,28 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
29
  model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
30
 
31
  system_prompt = """
32
- You are a customer support officer. Your task is to extract a transaction ID from the USER INPUT and determine its transaction type.
33
 
34
- To extract the transaction ID, follow these steps:
 
 
 
 
 
35
 
36
- 1.For each word in the USER INPUT, check if it starts with 'payout' or 'payment'. If yes, continue to Step 2; if not, go to Step 7.
37
- 2.Check if the character immediately after the prefix ('payout' or 'payment') is a dash ('-'). If yes, continue to Step 3; if not, go to Step 7.
38
- 3.Check if there is at least one digit or character after the dash. If yes, continue to Step 4; if not, go to Step 7.
39
- 4.Extract the transaction ID from the USER INPUT and continue to Step 5.
40
- 5.Verify that the extracted transaction ID appears exactly in the USER INPUT. If yes, continue to Step 6; if not, go to Step 7.
41
- 6.Mark the transaction ID as valid and set the flag found to true.
42
- 7.If no valid transaction ID is found, set the flag found to false.
43
-
44
- To determine the transaction type:
45
-
46
- 1.If the transaction ID starts with 'payout', the type is payout.
47
- 2.If the transaction ID starts with 'payment', the type is payment.
48
 
49
  ===>USER INPUT BEGINS
50
  {input}
51
  <===USER INPUT ENDS
52
 
53
- Respond in valid JSON with the following fields:
54
-
55
  found: (boolean) Whether a valid transaction ID was found.
56
  transaction_id: (string, if found) The extracted transaction ID.
57
  transaction_type: (string, if found) The transaction type in lowercase.
58
- justification: (string) An explanation of how the transaction ID and type were determined. If no valid transaction ID is found, do not fabricate an explanation.
59
  Return only valid JSON and nothing else.
60
  """
61
 
 
29
  model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
30
 
31
  system_prompt = """
32
+ You are a customer support officer. Extract the transaction ID from the USER INPUT and determine its type.
33
 
34
+ Extraction rules:
35
+ - Look for words starting with 'payout' or 'payment'.
36
+ - The next character must be a dash ('-').
37
+ - There must be at least one digit or character after the dash.
38
+ - The transaction ID must appear exactly in the USER INPUT.
39
+ - If found, set found to true; otherwise, set found to false.
40
 
41
+ Type rules:
42
+ - If the transaction ID starts with 'payout', type is payout.
43
+ - If it starts with 'payment', type is payment.
 
 
 
 
 
 
 
 
 
44
 
45
  ===>USER INPUT BEGINS
46
  {input}
47
  <===USER INPUT ENDS
48
 
49
+ Respond in valid JSON with these fields:
 
50
  found: (boolean) Whether a valid transaction ID was found.
51
  transaction_id: (string, if found) The extracted transaction ID.
52
  transaction_type: (string, if found) The transaction type in lowercase.
53
+ justification: (string) Explain how you determined the transaction ID and type. If not found, do not fabricate an explanation.
54
  Return only valid JSON and nothing else.
55
  """
56