Update app.py
Browse files492 unmodified lines493494495496497498496497498499500501492 unmodified lines
def extract_answer(full_response, instructions=None): try: # Remove the context information context_pattern = r"Context:.*?Entities:.*?}\s*" full_response = re.sub(context_pattern, "", full_response, flags=re.DOTALL) # Remove the context information more specifically context_pattern = r"Context:.*?Question:.*?Entities:.*?}\s*" full_response = re.sub(context_pattern, "", full_response, flags=re.DOTALL | re.IGNORECASE)
# List of patterns to remove patterns_to_remove = [app.py+3-3