This commit is contained in:
teslim
2025-05-21 16:15:56 +01:00
parent ae25b7cf0c
commit ff0882ca9f
2 changed files with 47 additions and 22 deletions
+2
View File
@@ -267,6 +267,8 @@ def get_vision_mission_extraction_from_questionnaire_executive():
"<p>Vision: To create safe, broadly beneficial AI systems that ensure the advantages of artificial general intelligence (AGI) are shared equitably across society. Our vision emphasizes the importance of safety and alignment, ensuring that AI systems align with human values and remain under human control. We aspire to collaborate with other research and policy institutions to address global challenges associated with advanced AI, prioritizing the safe development of increasingly capable systems that act in the best interests of humanity.</p>", "<p>Vision: To create safe, broadly beneficial AI systems that ensure the advantages of artificial general intelligence (AGI) are shared equitably across society. Our vision emphasizes the importance of safety and alignment, ensuring that AI systems align with human values and remain under human control. We aspire to collaborate with other research and policy institutions to address global challenges associated with advanced AI, prioritizing the safe development of increasingly capable systems that act in the best interests of humanity.</p>",
"<p>Company Goals:</p><p>1. Audit Department:<br> a. Enhance Risk Management and Internal Controls: Strengthen the organizations risk posture by identifying, assessing, and recommending improvements to internal controls.<br> b. Ensure Regulatory and Policy Compliance: Monitor adherence to relevant laws, regulations, standards, and internal policies.<br> c. Support Organizational Governance: Provide independent assurance to senior management and the board on the effectiveness of governance processes.<br> d. Drive Operational Efficiency: Identify inefficiencies and areas for process improvement during audits.<br> e. Leverage Technology and Data Analytics: Use automated tools and analytics for continuous auditing and real-time risk monitoring.<br> f. Develop Audit Talent and Capabilities: Invest in training and upskilling for the audit team.<br> g. Enhance Stakeholder Communication: Improve reporting clarity, timeliness, and relevance to stakeholders.<br><br>2. Finance Department:<br> a. Ensure Financial Stability and Sustainability: Maintain strong cash flow and optimize working capital.<br> b. Improve Financial Planning and Analysis (FP&A): Provide accurate forecasting and budgeting to support strategic decision-making.<br> c. Enhance Cost Management and Operational Efficiency: Identify cost-saving opportunities and drive efficient use of financial resources.<br> d. Ensure Regulatory and Compliance Integrity: Maintain full compliance with financial regulations and internal controls.<br> e. Enable Strategic Investment and Capital Allocation: Evaluate and fund initiatives that align with the organizations long-term growth strategy.<br> f. Improve Financial Reporting and Transparency: Deliver timely and accurate financial reports for stakeholders.<br> g. Leverage Financial Technology and Automation: Implement tools to streamline financial operations.<br> h. Develop Finance Talent and Leadership: Upskill finance staff and promote cross-functional knowledge.<br><br>3. Account Department:<br> a. Maintain Accurate and Timely Financial Records: Ensure all transactions are recorded properly.<br> b. Ensure Regulatory and Tax Compliance: Comply with all financial regulations and timely tax filings.<br> c. Streamline Month-End and Year-End Closing Processes: Reduce the time and complexity of closing periods.<br> d. Support Strategic Financial Planning: Provide reliable data for budgeting and forecasting.<br> e. Implement Automation and Digital Tools: Use accounting software and RPA to increase efficiency.<br> f. Strengthen Internal Controls and Risk Management: Ensure robust controls over financial transactions.<br> g. Improve Financial Transparency and Reporting Quality: Produce clear and consistent reports for stakeholders.<br> h. Develop Accounting Team Skills and Expertise: Provide continuous learning and leadership development for accounting staff.<br></p>" "<p>Company Goals:</p><p>1. Audit Department:<br> a. Enhance Risk Management and Internal Controls: Strengthen the organizations risk posture by identifying, assessing, and recommending improvements to internal controls.<br> b. Ensure Regulatory and Policy Compliance: Monitor adherence to relevant laws, regulations, standards, and internal policies.<br> c. Support Organizational Governance: Provide independent assurance to senior management and the board on the effectiveness of governance processes.<br> d. Drive Operational Efficiency: Identify inefficiencies and areas for process improvement during audits.<br> e. Leverage Technology and Data Analytics: Use automated tools and analytics for continuous auditing and real-time risk monitoring.<br> f. Develop Audit Talent and Capabilities: Invest in training and upskilling for the audit team.<br> g. Enhance Stakeholder Communication: Improve reporting clarity, timeliness, and relevance to stakeholders.<br><br>2. Finance Department:<br> a. Ensure Financial Stability and Sustainability: Maintain strong cash flow and optimize working capital.<br> b. Improve Financial Planning and Analysis (FP&A): Provide accurate forecasting and budgeting to support strategic decision-making.<br> c. Enhance Cost Management and Operational Efficiency: Identify cost-saving opportunities and drive efficient use of financial resources.<br> d. Ensure Regulatory and Compliance Integrity: Maintain full compliance with financial regulations and internal controls.<br> e. Enable Strategic Investment and Capital Allocation: Evaluate and fund initiatives that align with the organizations long-term growth strategy.<br> f. Improve Financial Reporting and Transparency: Deliver timely and accurate financial reports for stakeholders.<br> g. Leverage Financial Technology and Automation: Implement tools to streamline financial operations.<br> h. Develop Finance Talent and Leadership: Upskill finance staff and promote cross-functional knowledge.<br><br>3. Account Department:<br> a. Maintain Accurate and Timely Financial Records: Ensure all transactions are recorded properly.<br> b. Ensure Regulatory and Tax Compliance: Comply with all financial regulations and timely tax filings.<br> c. Streamline Month-End and Year-End Closing Processes: Reduce the time and complexity of closing periods.<br> d. Support Strategic Financial Planning: Provide reliable data for budgeting and forecasting.<br> e. Implement Automation and Digital Tools: Use accounting software and RPA to increase efficiency.<br> f. Strengthen Internal Controls and Risk Management: Ensure robust controls over financial transactions.<br> g. Improve Financial Transparency and Reporting Quality: Produce clear and consistent reports for stakeholders.<br> h. Develop Accounting Team Skills and Expertise: Provide continuous learning and leadership development for accounting staff.<br></p>"
], ],
"vision": "To create safe, broadly beneficial AI systems that ensure the advantages of artificial general intelligence (AGI) are shared equitably across society. Our vision emphasizes the importance of safety and alignment, ensuring that AI systems align with human values and remain under human control. We aspire to collaborate with other research and policy institutions to address global challenges associated with advanced AI, prioritizing the safe development of increasingly capable systems that act in the best interests of humanity.",
"department_goals": [ "department_goals": [
{ {
+45 -22
View File
@@ -1,32 +1,45 @@
import os import os
from spire.doc import Document, FileFormat from docx import Document as DocxDocument
from langchain_community.document_loaders import PyPDFLoader from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet
from langchain_community.document_loaders import PyPDFLoader, UnstructuredWordDocumentLoader
def convert_word_to_pdf(doc_path: str) -> str: def convert_word_to_pdf(doc_path: str) -> str:
""" """
Convert a .doc or .docx file to PDF using Spire.Doc. Convert a .docx file to PDF using python-docx and reportlab.
Args: Args:
doc_path (str): The path to the .doc or .docx file. doc_path (str): The path to the .docx file.
Returns: Returns:
str: The path to the converted PDF file. str: The path to the converted PDF file.
""" """
pdf_path = os.path.splitext(doc_path)[0] + '.pdf' pdf_path = os.path.splitext(doc_path)[0] + '.pdf'
# Create a Document object
document = Document()
# Load the Word document # Load the Word document
document.LoadFromFile(doc_path) doc = DocxDocument(doc_path)
# Save as PDF
document.SaveToFile(pdf_path, FileFormat.PDF) # Create a PDF
document.Close() pdf = SimpleDocTemplate(pdf_path, pagesize=letter)
styles = getSampleStyleSheet()
flowables = []
# Extract text from paragraphs and add to PDF
for para in doc.paragraphs:
if para.text:
p = Paragraph(para.text, styles['Normal'])
flowables.append(p)
flowables.append(Spacer(1, 12))
# Build the PDF
pdf.build(flowables)
return pdf_path return pdf_path
def load_document(file_path: str): def load_document(file_path: str):
""" """
Utility function to load a PDF, DOCX, or DOC file by first converting it to PDF. Utility function to load a PDF, DOCX, or DOC file.
Args: Args:
file_path (str): The path to the file to load. file_path (str): The path to the file to load.
@@ -34,15 +47,25 @@ def load_document(file_path: str):
Returns: Returns:
List[Document]: A list of Document objects representing the contents of the file. List[Document]: A list of Document objects representing the contents of the file.
""" """
extension = os.path.splitext(file_path)[1].lower()
if extension in ['.doc', '.docx']: try:
# Convert .doc or .docx to PDF first extension = os.path.splitext(file_path)[1].lower()
pdf_path = convert_word_to_pdf(file_path)
loader = PyPDFLoader(pdf_path) if extension == '.docx':
elif extension == '.pdf': # For .docx files, use UnstructuredWordDocumentLoader directly
loader = PyPDFLoader(file_path) loader = UnstructuredWordDocumentLoader(file_path)
else: return loader.load()
raise ValueError(f"Unsupported file type: {extension}. Only .pdf, .docx, and .doc are supported.") elif extension == '.doc':
# Convert .doc to .pdf first
return loader.load() pdf_path = convert_word_to_pdf(file_path)
loader = PyPDFLoader(pdf_path)
return loader.load()
elif extension == '.pdf':
loader = PyPDFLoader(file_path)
return loader.load()
else:
raise ValueError(f"Unsupported file type: {extension}. Only .pdf, .docx, and .doc are supported.")
except Exception as e:
print(f"Error loading document: {str(e)}")
return None