File size: 4,579 Bytes
7013379 2b42302 7013379 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
class CFG_APP:
DEBUG = True
K_TOTAL = 20 # Number of paragraphs
THRESHOLD = 0.3
DEVICE = "cpu"
BOT_NAME = "CSRD_GPT"
MODEL_NAME = "gpt-3.5-turbo"
DEFAULT_LANGUAGE = "English"
DATA_FOLDER = "data/"
EMBEDDING_MODEL = "sentence-transformers/multi-qa-mpnet-base-dot-v1"
MAX_TOKENS_REF_QUESTION = 128 # Number of tokens in reformulated question
MAX_TOKENS_ANSWER = 1024 # Number of tokens in answers
MAX_TOKENS_API = 3100
INIT_PROMPT = (
f"You are {BOT_NAME}, an expert in CSRD regulations, an AI Assistant by Nexialog Consulting. "
"You are given a question and extracted parts of regulation reports."
"Provide a clear and structured answer based only on the context provided. "
"When relevant, use bullet points and lists to structure your answers."
)
SOURCES_PROMPT = (
"When relevant, use facts and numbers from the following documents in your answer. "
"Whenever you use information from a document, reference it at the end of the sentence by naming it Exc (ex: [exc 2])."
"Very important ! Never use the word Document or Doc for referencing an Excerpt, always exc. "
"You don't have to use all documents, only if it makes sense in the conversation. "
"If no relevant information to answer the question is present in the documents, "
"just say you don't have enough information to answer."
)
DEFAULT_QUESTIONS = (
"What are the key requirements of the CSRD for companies in the EU?",
"How does the CSRD differ from the previous Non-Financial Reporting Directive (NFRD)?",
"Which types of companies are affected by the CSRD, and what are the thresholds for compliance?",
"How will the CSRD impact the way companies report on sustainability and environmental issues?",
"Are there specific guidelines or standards that companies must follow under the CSRD for reporting sustainability measures?",
"Comment la CSRD va-t-elle influencer la transparence et la responsabilité des entreprises en matière de pratiques durables ?",
"Quelles sont les conséquences pour les entreprises qui ne respectent pas les normes de la CSRD ?",
"La CSRD exige-t-elle des entreprises de rapporter sur des indicateurs spécifiques de durabilité environnementale et sociale ?",
"Comment la mise en œuvre de la CSRD peut-elle bénéficier à la performance globale des entreprises ?",
"Quel rôle jouent les auditeurs et les conseillers en matière de conformité aux exigences de la CSRD ?",
)
REFORMULATION_PROMPT = """
Important ! Give the output as a standalone question followed by the detected language whatever the form of the query.
Reformulate the following user message to be a short standalone question in English, in the context of an educational discussion about regulations in banks. Then detect the language of the query
Sometimes, explanations of some abbreviations will be given in parentheses, keep them.
---
query: C'est quoi les régles que les banques américaines doivent suivre ?
standalone question: What are the key regulations that banks in the United States must follow?
language: French
---
query: what are the main effects of bank regulations?
standalone question: What are the main causes of bank regulations change in the last century?
language: English
---
query: UL (Unexpected Loss)
standalone question: What does UL (Unexpected Loss) stand for?
language: English
"""
HYDE_PROMPT ="""
Important ! Give the output as an answer to the query. First you will translate the query in English and then answer it, in English, in 2 sentences maximum using the right vocabulary of the context of the query.
Very important : the answer must be followed by the detected language of the query whatever the form of the query. You must keep the question at the begining of the answer.
Here is an example of the template you must follow to create your answer :
---
query : C'est quoi les régles que les banques américaines doivent suivre ?
output : What are the rules that American banks must follow ? American banks must follow a set of federal and state regulations imposed by agencies such as the Federal Reserve and the Consumer Financial Protection Bureau..
language : French
"""
DOC_METADATA_PATH = f"{DATA_FOLDER}/doc_metadata.json"
|