Analysis of financial reports in companies using machine learning

. The article aims to develop new algorithms for the automated analysis of financial reports based on machine learning algorithms, which increase the efficiency and accuracy of converting financial information into a text form. In this context, special attention is paid to deep learning methods and neural networks that contribute to automating and analyzing financial reports and their further interpretation. The article examines the problems of generating text data from financial statements, describes the general characteristics of this process


Introduction
Growing volumes of financial data and their complexity require more efficient tools for their processing and analysis.Traditional economic analysis methods often require significant time and resources, which can limit the speed of decision-making.Machine learning provides opportunities to automate and optimize analysis processes, increasing the accuracy and speed of information processing.It, in turn, contributes to a better understanding of the company's financial condition and increases the effectiveness of management decisions.
Applying modules developed based on machine learning to analyze financial reports opens up vast opportunities for identifying trends, anomalies and risks that traditional research cannot detect.In addition, these technologies allow the automation of routine analysis processes, which frees up resources to focus on more complex tasks and strategic planning.
Machine learning (ML) is a subfield of artificial intelligence (AI) [29] that focuses on the development of algorithms and statistical models that allow computer systems to improve their performance automatically through experience and the use of data.Machine learning models learn from data.It means that they analyze data sets and identify patterns and patterns, which are used to make decisions or predictions.
The main types of machine learning: ➢ supervised learning (Supervised Learning) [30,33]; this model learns on pre-marked data, where the input and output data are known.The goal is to understand the relationships and structures to predict the output for new inputs.➢ learning without a teacher (Unsupervised Learning) [30,34]; this model works with unlabeled data, trying to find hidden structures or regularities in the data without first specifying the output results.The main methods of unsupervised learning are clustering, dimensionality reduction (popular dimensionality reduction methods are principal component analysis (PCA) and t-distributed stochastic neighbour nesting (t-SNE) [35]), associative rules, and anomaly detection.➢ semi-supervised learning (Semi-Supervised Learning) [31] and reinforcement learning (Reinforcement Learning) [32], this is a combination of approaches that use both labelled and unlabeled data or where the model is trained based on rewards for specific actions or decisions.➢ deep learning (Deep Learning) [36] is an essential subfield of machine learning, which is based on the use of artificial neural network architectures of deep learning.It uses various types of neural networks, such as convolutional neural networks (CNNs) [37] for image and video processing, recurrent neural networks (RNNs) [38] for sequential data such as text or time series, and other specialized architectures.It requires significant computational resources, especially for training large models on large data sets, often provided by specialized hardware such as GPUs or TPUs [39].➢ ensemble methods in machine learning [40] represent a strategy combining several training models to improve predictions' overall efficiency, accuracy and reliability.This approach is based on the principle that an ensemble of diverse models often performs better than a single model, even if those individual models could be more powerful.Two of the most famous ensemble methods are Random Forest [41,43] and Gradient Boosting [42,44].
Machine learning includes various algorithms such as decision trees, neural networks, support vector machines, ensemble methods, etc., each of which has its characteristics and areas of application.Machine learning continues to evolve, opening up new opportunities for automation, efficiency gains, and deep insights from data across various industries.
Machine learning opens up vast opportunities for generating text data based on analysing companies' financial reports, making a significant contribution to automation processes and increasing the efficiency and quality of analysis.
1. Automating primary analysis using machine learning algorithms is becoming increasingly common in financial research [62].This approach allows companies and financial analysts to process large amounts of financial data efficiently, identifying key indicators and extracting meaningful information.
Machine learning algorithms can quickly process large amounts of data, significantly reducing the time required for initial analysis.It frees up analysts' time to focus on more complex aspects of financial analysis.
Automation helps reduce the chance of errors that can occur with manual data entry.Machine learning algorithms are capable of accurately identifying and classifying financial information.
Machine learning can be used to identify and extract key financial metrics such as revenue, expenses, profitability, liquidity, and others.
Automated data processing prepares the foundation for deeper analysis, including forecasting and modeling financial indicators.
Machine learning makes it easy to scale the analysis process and adapt to growing data volumes and changes in data structure.
Using machine learning to automate the primary analysis of financial data opens up new opportunities to improve the productivity, accuracy and depth of economic analysis in companies and organizations.
2. Improving the quality of financial statement analysis using deep learning techniques is one of the key areas of application of these technologies in the financial sector.Using neural networks and other deep learning methods makes it possible to reveal complex patterns and relationships in data that may not be obvious with traditional analysis approaches.
Deep learning allows you to analyze large volumes of financial data, revealing complex dependencies and relationships that may be hidden in standard financial indicators.It includes trend analysis, anomaly detection, and forecasting of financial indicators.
Neural networks and other deep learning models can process quantitative and qualitative data, including text reports and notes.It allows you to get a deeper understanding of the company's overall financial picture.
Deep learning can be used to predict financial performance, helping to identify potential risks and opportunities.It includes forecasting revenues, expenses, stock prices and other critical financial parameters.
The use of deep learning methods allows for the automation of several analytical tasks, such as the classification and clustering of financial data, which contributes to increasing the efficiency of analytical departments.
By providing more profound and accurate analytical insights, deep learning supports the decision-making process at the company's management level.
Thanks to these capabilities, deep learning opens up new perspectives for financial analysts and managers, providing them with powerful tools for more efficient and informed analysis of financial statements.
3. Generating reports and generalizations using machine learning models, especially those using natural language processing (NLP) methods, is an essential direction in modern financial data analysis.This approach can significantly simplify and optimize the process of preparing financial statements, providing higher availability and comprehensibility of information for making business decisions.
NLP models can automate reporting by extracting key information from financial documents and presenting it in a structured, understandable format.It includes summarizing vital economic indicators and identifying significant trends and changes in the company's financial condition.
Machine learning models can summarize large amounts of financial data into concise conclusions.It helps management and investors quickly get an overall picture of the company's financial health and performance.
Automation of report generation provides a more accessible presentation of complex financial information, contributing to better understanding and decision-making at various levels of management.
Machine learning models can integrate with other enterprise systems, such as ERP or CRM, to provide automated data flow and reporting.
Machine learning models allow you to customize the format and content of reports based on specific business needs and stakeholder requirements.
Using machine learning models to generate reports and generalizations in financial analysis increases the efficiency of information processing, making the process more automated, fast and accurate.It contributes to improving the quality of financial planning, research and decision-making at all levels of management.
4. Forecasting financial trends and developing forecasts for the future are key elements of strategic planning and management for any company.Machine learning algorithms, particularly regression models, play an essential role in this process.
Machine learning algorithms can analyze historical financial data, revealing trends and patterns that may not be obvious to a human analyst.It includes analysis of cyclical fluctuations, seasonal changes and other important factors.
Regression models and other machine learning analytics tools can be used to predict key financial metrics such as revenue, expenses, profitability, and ROI.
Machine learning models help assess potential risks and opportunities associated with various financial strategies by simulating different scenarios and analyzing their possible consequences [62].
Predictive models allow companies to make more informed decisions about investments, budgets and other essential aspects of financial management.
Machine learning can help companies quickly adapt to market conditions by analyzing current trends and predicting future changes.
Applying machine learning to forecast financial trends and analysis helps companies plan and manage their operations more effectively, providing a competitive advantage and a more stable financial future.
5. An individual approach to analysis, which is provided by machine learning methods, is a significant advantage for companies, as it allows them to adapt analytical solutions to the unique conditions and requirements of each specific organization.The use of machine learning for personalized analysis includes the following aspects: Machine learning allows you to develop models that take into account unique aspects of the business processes of a particular company, such as business cycles, the specifics of the client base, or internal management procedures.
Models can be customized to match the structure of a company's financial and management reporting, providing more accurate and relevant analysis.
Machine learning allows you to consider the specifics of the company's industry, adapting analytical models to the particulars of the market, competitive environment and regulatory requirements.
Machine learning models can be flexibly adapted to business changes, such as business expansion, strategy change or new market conditions, ensuring scalability of solutions.
Thanks to machine learning, companies can optimize their analytical models to solve specific problems, such as credit risk assessment, pricing optimization or inventory management [62].
A customized approach to analysis using machine learning increases the accuracy and relevance of analytical findings.It gives companies the critical flexibility to adapt to a rapidly changing business environment.
6. Detecting anomalies and risks using machine learning models is a critical aspect of financial analysis, as it helps companies identify and respond to potential problems promptly, thereby preventing financial losses.
These models analyze large data sets and identify anomalies that may indicate abnormal behavior or risks.
Machine learning models can detect abnormal or out-of-character transactions in financial statements that may indicate errors, fraud, or other financial problems.
Machine learning allows the analysis of deviations from standard patterns or historical trends, which can indicate potential risks to the business.
The use of predictive models helps financial institutions assess credit and investment risks, providing better lending and portfolio investment decisions.
Machine learning-based systems can continuously monitor financial data, sending alerts if anomalies are detected, allowing companies to respond to potential problems quickly.
Machine learning models are used to identify signs of fraud in financial transactions, which helps companies minimize financial losses from fraudulent activities.
Machine learning models can adapt to changes in the financial environment and update their criteria to detect anomalies, ensuring relevance and accuracy of risk detection.
Using machine learning to detect anomalies and risks is a powerful tool for financial analysts to improve financial operations and planning security and reliability.
Therefore, machine learning in analyzing companies' financial reports opens new horizons for more profound and more effective use of data, providing companies with competitive advantages and supporting informed decision-making.

Literature review
Detecting anomalies and risks using machine learning models is a critical aspect of financial analysis, as it helps companies identify and respond to potential problems promptly, thereby preventing financial losses.
These models analyze large data sets and identify anomalies that may indicate abnormal behavior or risks.
Machine learning models can detect abnormal or out-of-character transactions in financial statements that may indicate errors, fraud, or other financial problems.
Machine learning allows the analysis of deviations from standard patterns or historical trends, which can indicate potential risks to the business.
The use of predictive models helps financial institutions assess credit and investment risks, providing better lending and portfolio investment decisions.
Machine learning-based systems can continuously monitor financial data, sending alerts if anomalies are detected, allowing companies to respond to potential problems quickly.
Machine learning models are used to identify signs of fraud in financial transactions, which helps companies minimize financial losses from fraudulent activities.
Machine learning models can adapt to changes in the financial environment and update their criteria to detect anomalies, ensuring relevance and accuracy of risk detection.
Using machine learning to detect anomalies and risks is a powerful tool for financial analysts to improve financial operations and planning security and reliability.
Therefore, the application of Text generation using neural networks has become one of the most impressive advances in artificial intelligence and natural language processing (NLP).Deep neural networks allow you to create complex and meaningful text sequences used in various areas, from automatic content creation to chatbots.
The most famous technologies in this field are: 1. Recurrent Neural Networks (RNN) [45,47] and their improved version of Long Short-Term Memory (LSTM) [46].The main feature of these networks is the ability to store information about the previous state, which allows them to process sequential data such as text or time series efficiently.

Transformer Models [48]
, developed by researchers from Google, are based on the attention mechanism [49], which allows models to process large blocks of text efficiently, providing a better understanding of the context and relationships between words.Unlike sequential networks such as RNNs and LSTMs, transformers can process large data blocks in parallel, significantly increasing computational speed and data processing efficiency.Transformers became the basis for developing advanced models in the field of NLP.The most famous among them are GPT (Generative Pre-trained Transformer) from OpenAI [50], which is effectively used for text generation, and BERT (Bidirectional Encoder Representations from Transformers) from Google [51], which can analyze connections in text in two directions, improving understanding of context and semantics.Machine learning in analyzing companies' financial reports opens new horizons for more profound and more effective use of data, providing companies with competitive advantages and supporting informed decision-making.
3. GPT-4 (Generative Pre-trained Transformer 4) from OpenAI [52] is the successor of the GPT-3 model [53] and one of the most modern developments in the field of text generation.Thanks to an advanced natural language processing engine, GPT-4 can analyze the context and connections in the text more deeply, providing more accurate and relevant answers.The model is widely used in various areas, including automatic content creation, translation, summarization of readers, and answers to questions, as well as in areas where creative text processing is required, for example, when creating literary works or scripts.GPT-4 can interact with users in real-time, adapting to their requests and needs, which makes the model particularly useful in developing chatbots and interactive systems.
4. BERT (Bidirectional Encoder Representations from Transformers) [51] and its variations significantly contributed to the field of natural language processing.BERT uses a transformative architecture to build powerful models capable of understanding the context and nuances of natural language.BERT is first trained on a large amount of text data (such as the Wikipedia text corpus) and then adapted (fine-tuned) to specific NLP tasks such as text classification, question answering, or emotional color analysis.
5. RoBERTa (Robustly Optimized BERT Pretraining Approach) [54] developed by Facebook AI, this model is a variation of BERT that incorporates changes in the pretraining process to improve efficiency and accuracy.
6.The DistilBERT [55] model is a simplified and optimized version of BERT that retains most of the accuracy of the original model but requires significantly fewer computing resources.DistilBERT is ideal for situations where resources are limited or high processing speed is required.
7. The Seq2Seq (Sequence to Sequence) architecture [56] is a significant innovation in machine learning, which has found wide application in natural language processing.This model was specifically designed for text translation, but its functionality has proven effective for other tasks, such as automatic text generation.Key features and applications of the Seq2Seq architecture include: 8. Conditional Random Fields (CRFs) [57] are a class of statistical models widely used in natural language processing.These models are used for structured prediction, especially when context and dependencies between sequential data should be considered.Applied in Named Entity Recognition (NER) [58], CRFs are effectively used to detect and classify named entities in text, such as names of persons, organizations, and geographical names.They allow the model to consider contextual relationships between words in a sentence, increasing recognition accuracy.9. Autoencoders [59] and Variational Autoencoders (VAEs) [60] are types of neural networks used in the field of machine learning to reduce the dimensionality of data and its generation.These models have unique properties and applications, especially in word processing.Autoencoders are a neural network that learns to encode input data into a compact representation and then reconstruct the output data from that representation.The main goal is to reduce the dimensionality of the data while preserving its key characteristics.Autoencoders are often used for anomaly detection, noise reduction, or as part of more complex data processing systems.Variational Autoencoders (VAEs) are an extension of conventional autoencoders that use Bayesian statistics principles to generate data.Unlike traditional autoencoders, which only reconstruct the input data, VAEs can generate new data similar to the one used for training.It makes them particularly useful for tasks where new data samples need to be created, such as in text generation.
10. Attention Mechanism [61] is an innovative approach in the field of machine learning, especially in the field of natural language processing.Its development significantly increased the efficiency of neural networks, particularly in tasks related to understanding and generating text.In text-generating models, the attention mechanism helps create more meaningful and contextually relevant text sequences, ensuring better idea representation and content coherence.
As of 2023, several key services and platforms specialise in generating textual data based on the analysis of companies' financial statements.These services use advanced artificial intelligence technologies to automate and optimize financial data analysis.The most famous platforms are: 1. Quill by Narrative Science [17] this platform automatically uses artificial intelligence to transform data into understandable text reports.Quill is particularly useful for turning complex datasets into an easy-tounderstand narrative.Quill by Narrative Science is an artificial intelligence platform specialising in automatically transforming structured data into natural language text.This technology is based on machine learning algorithms and natural language processing and is intended for use in various industries, including finance, business intelligence, marketing and others.
2. Yseop [18] -This service automates the writing of reports and documentation, using natural language processing to generate detailed reports from financial data.Yseop effectively uncovers key insights and trends from large volumes of data.Yseop is an innovative solution in artificial intelligence, specialising in automated text generation and reporting.This platform uses Natural Language Processing (NLP) and machine learning technologies to transform structured data into detailed, well-articulated text reports.
3. Tableau [19] is better known as a data visualization tool; it also offers automated data analysis and interpretation capabilities that can be used to create reports and dashboards.Tableau is one of the leading data visualization platforms that provides users with intuitive tools to analyze and interpret large data sets.Although Tableau's primary function is data visualization, the platform can also be used to generate textual data based on analysis of companies' financial statements.Although Tableau does not generate text reports in the traditional sense, it allows users to visualize financial data as graphs, charts, maps, and other visual formats.It may include revenue trends, cost analysis, benchmarking, etc.
4. Power BI from Microsoft [20] is a powerful data analysis tool that provides users with the ability not only to visualize but also to analyze financial data and generate informative reports from this data.This flexible and scalable platform allows it to be used effectively in various business environments, from small businesses to large corporations.Power BI provides a wide range of data visualization options, including graphs, maps, histograms, and other tools that you can use to create vivid and intuitive reports.By integrating with various data sources, Power BI can process large amounts of financial information, enabling users to deeply analyze financial metrics, identify trends, and perform benchmarking.
5. ClickAI [21] uses artificial intelligence to automate data analysis processes, including financial reports.
ClickAI is an advanced service that automates data analysis using artificial intelligence technologies.The main goal of this platform is to provide users with tools to effectively analyze and interpret large amounts of data, including financial reports.Using ClickAI to analyze financial statements includes identifying key economic indicators and analyzing profitability, costs and other essential aspects of a business.It helps companies gain meaningful insights that can be used to improve efficiency and make informed decisions.These services vary greatly in functionality, cost, ease of use, and integration with other systems.The choice of a specific service will depend on the business's particular needs, the volume and complexity of financial data, and the advantages of visualization and analysis of this data.In local markets, the possibilities of specialized services that directly focus on generating textual data based on the analysis of companies' financial statements may be limited.However, national companies and financial analysts can use international platforms and tools adapted to their needs.In addition, there may be local developers or startups that offer suitable solutions.So, among the commonly known tools that may be available and useful in local markets, we should mention: 1. Tableau and Microsoft Power BI for visualization and fundamental data analysis [19].

IBM Watson and Google
Cloud AI have powerful natural language processing tools and can be adapted for financial data analysis [22].
IBM Watson can analyze large amounts of financial data, identifying key indicators, trends and anomalies.It includes the ability to recognize and interpret financial figures such as income, expenses, assets, liabilities, etc.Using natural language processing technologies, IBM Watson can automatically generate detailed, understandable text reports based on the analysis of financial data.These reports may include descriptions of key financial results, comparative analysis with prior periods or competitors, and conclusions and recommendations.
Google Cloud AI offers a wide range of tools and services that can be used to generate text data based on the analysis of companies' financial reports.Tools such as Google Cloud Natural Language [23] can be used to analyze the textual content of financial statements.They can detect sentiment, highlight key phrases, categorize content, and analyze syntactic structure to help better understand report content.Google Cloud analytics tools such as BigQuery [24] provide the ability to process and analyze large data sets.It may include financial figures, historical financial data, market trends, etc. Services such as AutoML [25] allow developers and analysts to create machine-learning models without deep field knowledge.It can be used to forecast financial performance, analyze risks and identify anomalies in economic data.

Excel [26]
with additional plugins for data analysis.Many local companies actively use Excel for financial modeling, and with the help of additional tools, this program can be effectively used for fundamental data analysis.Excel's standard capabilities can be greatly expanded with the help of plugins and applications.It includes tools for more sophisticated data analysis, process automation, and advanced visualizations.
With the help of additional tools, such as Power Query [27] and Power Pivot [28], Excel can process more data and perform more complex analytical operations, such as data fusion, filtering, transformation, and data aggregation.

Local developments from local IT companies.
There may be specialized solutions developed by local companies that offer financial statement analysis.It is important to note that local companies may have specific needs related to local legislation and the specifics of doing business, so these aspects should be considered when choosing the appropriate service.In addition, there may be a need to localize interfaces and functionality of services to work with national languages and data.

Methodology
The generation of textual data based on analysing companies' financial statements is a process that includes using artificial intelligence technologies to process, analyze and interpret large volumes of financial information.This process is becoming increasingly relevant in the context of the growing need for automation and optimization of economic analysis.
The main goal of this approach is to transform complex and often unstructured financial statement data into clear, logically structured and easily interpretable text conclusions.Using machine learning and natural language processing algorithms, the systems can analyze quantitative data such as revenues, expenses, balance sheet totals, and qualitative indicators, including risks, strategic initiatives and management conclusions.An essential component of this process is the system's ability to adapt to specific reporting standards and financial norms, which can vary significantly depending on the country and industry.It involves using models that consider international financial standards, regulatory requirements and industry specifics.Such systems increase the efficiency of the financial analysis process and ensure greater transparency and objectivity of conclusions.They can automatically generate reports that include financial performance synthesis, trend detection, and recommendations.It should be noted that although these systems simplify the processing of financial information, they require regular updating and adjustment to consider changes in market conditions, financial regulations and business models.Thus, the role of specialists in financial analysis remains essential, especially in the context of interpretation and use of conclusions obtained with the help of artificial intelligence [16].The generation of textual data based on the analysis of financial statements of companies involves several critical challenges arising from the complexity of the data, the requirements for accuracy and reliability, as well as the specific challenges associated with the use of artificial intelligence technologies: 1. Accuracy and reliability are two of the main problems in ensuring high accuracy of text generation.Financial statements contain complex and precise information, and a small error in transcription or analysis can lead to erroneous conclusions.
2. Dependence on the quality of the data because the quality of the generated text directly depends on the quality of the input data.If financial statements are incomplete, contain errors or are presented in an unstructured format, this can significantly complicate generating accurate text.
3. Financial documents often contain specific terminology, which can be a challenge for artificial intelligence systems, which can only sometimes correctly interpret and use such specialized vocabulary.
4. Automated systems may have difficulty with contextual understanding of text.They can correctly identify key figures and facts but cannot always interpret the content correctly or identify essential relationships between different report elements.
5. Given the strict regulatory requirements in financial reporting, ensuring compliance of automatically generated texts with legislative and regulatory standards is necessary.
6.When working with financial data, it is essential to ensure the confidentiality and security of information, as they often contain sensitive data.
7. Despite the automation of the process, it is necessary to involve specialists to check and validate the generated texts to ensure their accuracy and compliance with standards.
Text generation and analysis is a complex task that requires specialized artificial intelligence models.Developing your model from scratch can be time-consuming and require significant computing resources and expertise.For example, to train language models like GPT-3, the minimum system requirements include an advanced GPU with at least 16 GB, a high-performance processor, at least 32 GB of RAM, and plenty of free storage space, typically on high-speed SSDs.It also requires a fast Internet connection and specialized frameworks such as TensorFlow or PyTorch.The time needed to train and implement a model depends on scale, dataset size, and problem complexity.Still, given these minimum requirements, the process can take anywhere from a few weeks to a few months.
According to an article on the DOU website [63], about 1.5 billion USD were spent on training the GPT-3 model.It includes the cost of equipment, electricity and salaries of the engineers and researchers who worked on the project.The GPT-3 model was trained on a 1024 Nvidia Tesla P100 server computer cluster.Each server was equipped with 16 GB of RAM and 120 GB of flash memory.The total capacity of the cluster was 1000 teraflops.Training of the GPT-3 model lasted 345 days.During this time, the model was selected on 500 billion-word data.
Summing up the above, significant financial and computational resources are needed to implement your model.Therefore, it was decided to choose ready-made models and use them considering the specifics of the task.Several important factors are to consider when using AI models through their API.Consider one of the most popular models for API text analysis and generation that can be used, GPT from OpenAI [64].
To use the API, you need to get an API key; this key will allow you to send requests and receive responses from the GPT model whose tariff plan was selected.The GPT-3.5 Turbo model (see Figure 1) is suitable for software implementation of work tasks.
Figure 1.Tariff plans for using the model [65] Source: Compiled by the author.
Each word is considered a separate token in the mode, as are spaces and punctuation marks.For text analysis using the gpt-3.5-turbo-106model with 500 tokens at the input and 500 tokens at the output, the cost will be as follows: ➢ input costs: $0.0005; ➢ initial cost: $0.0010; ➢ total cost: $0.0015.
Therefore, one text analysis with an answer in this scenario will cost $0.0015.A limited number of requests is not significant, but if the number of requests and their complexity increase, both the response and the price for this request will increase.Given that the volumes of financial reports can be significant, there are better options than using artificial intelligence analysis to perform the tasks.
Another way of using artificial intelligence is the integration of ready-made libraries that allow the use of artificial intelligence.
The GPT4All library [66] is an open-source solution designed to run large language models (LLMs) on local processors and a wide range of GPUs.It allows users to train, deploy and use these models without ownership restrictions.One of the notable advantages is compatibility with consumer-grade processors and support for M1 macOS devices, allowing for broader access.This library will enable users to train and deploy their language models, allowing them to tailor them to their unique needs.Continuous updates, such as GGUF support for extended model formats and support for local output to various GPUs via Nomic Vulkan, ensure that the library remains relevant, adaptable and able to meet changing needs.It is worth noting that GPT4All offers models from 3 GB to 8 GB.It shows their potential but also highlights the significant memory resources they require.In addition, the large model sizes indicate that GPT4All can lead to computationally intensive tasks requiring powerful hardware to run efficiently.Considering the specificity of analyzing financial statements, although speed is not the main criterion, better results can be achieved using analogue libraries.
The Bard API [67], a Python package, receives responses from Google Bard using cookie values.The Python pip package manager is used for installation.For authentication, the method involves extracting the __Secure-1PSID cookie value from the browser session on the official Bard website.This value is not an official API key and may change frequently, so you should check and update it regularly to avoid errors.Regarding usage, the Bard API provides an easy way to send text to Bard and receive responses, with the ability to handle delays and errors by setting delays.However, this process can be cumbersome as it involves dealing with cookies and potentially using proxies to avoid being blocked or solving CAPTCHAs.Proxies can be configured to rotate IP addresses, which helps bypass CAPTCHAs but adds another layer of complexity to the setup.To summarize, although the Bard API provides a method of interacting with Google Bard, the need to set cookies, change them frequently, enter CAPTCHAs, and potentially configure proxies makes this method less convenient for continuous use.The gpt4free library [68] is an open-source collection that offers access to several state-of-the-art language models.It supports GPT-4 and GPT-3.5 and allows you to use various providers that serve as interfaces to these models.The library includes the following providers: ➢ Bing (g4f.Provider.Bing): Offers GPT-4 with streaming capabilities but does not require authentication; ➢ GeekGpt (g4f.Provider.GeekGpt): Supports both GPT-3.5 and GPT-4 with streaming capability; ➢ GptChatly (g4f.Provider.GptChatly): Provides access to GPT-3.5 and GPT-4, but without streaming support; ➢ Liaobots (g4f.Provider.Liaobots): Supports GPT-3.5 and GPT-4, as well as streaming; ➢ Phind (g4f.Provider.Phind): Supports only GPT-4 with streaming features; ➢ Raycast (g4f.Provider.Raycast): Offers both GPT-3.5 and GPT-4 streaming and requires authentication.
These providers are the sources from which the gpt4free library can receive and execute language model responses.The library encapsulates the complexity of interacting with different APIs by presenting a unified and simplified interface that allows you to incorporate advanced AI language processing into your systems.gpt4free differs from GPT4All and Bard API because it offers a hassle-free installation process, a wide range of powerful language models, and a simple approach to accessing different model providers.It makes gpt4free a very affordable and practical choice for the task at hand.After choosing a model, you can create the necessary tasks that need to be solved during the software implementation of gpt4free: 1. Develop an algorithm according to which the library will process the necessary request and issue a correct answer; 2. Develop a convenient and intuitive user interface for demonstrating the module's operation; 3. Process the answer from the model and output it in a convenient and correct format; 4. Conduct testing and evaluate the results of the developed software module.

Results
The following libraries were used for the software implementation of the module: ➢ The Streamlit library is used to develop interactive web applications and data visualization.It provides an easy way to create a web interface; ➢ The OS module provides functionality related to the operating system.It allows you to interact with the file system, get information about the application's execution environment, run shell commands and other OS-related operations; ➢ The datetime module provides functionality for working with dates and times.It allows you to get the current date and time, perform functions with dates, and format and parse date and time strings; ➢ PyPDF2: The PyPDF2 library is used to work with files in PDF format.It provides features for reading, writing and editing PDF files, such as extracting text, merging and splitting pages, setting protection and much more; ➢ g4f library for using the AI model.
➢ The primary function in the module, summarize_text, is designed for automatic analysis, but before analyzing it, you need to consider the auxiliary function main (see Figure 2).

Figure 2. Listing of the main function
The code creates a short financial report of a company from PDF text.It first displays the page title and creates a PDF download box.After checking the file download and displaying a success message, the file is analyzed.
The code extracts the text from each PDF page, processes it, removes extraneous characters, adds the reader to a list, and then combines the list items into a new text.It concludes by summarizing the text using the summarize_text function to generate a report.The summarize_text function (see Figure 3) is intended for automatic text analysis.The function's input parameter is text, which contains a list of paragraphs of text.We go through each element in the text list in the for loop.We create a prompt variable that includes a text instruction for the model that explains its task.This task consists of analyzing the financial report and the text.We ask the model using the get_completion function, passing it a prompt.We receive the model's response, which contains a text summary.We add the outline to the summary_chunks variable.We wait 5 seconds before moving to the next paragraph of text using time.After the loop is finished, we create the main_prompt variable, which contains general instructions for the model on summarizing the text.We ask the model again using the get_completion function, passing main_prompt to it.We receive the model's answer, which contains the result of text summaries from all paragraphs.We return the result from the function.This function is used for automatic parsing of text divided into sections.It relies on the gpt-3.5-turbomodel to generate summaries based on the instructions provided.
The process takes time due to execution delays and waiting for the model.When the function terminates, the total sum of the text summaries is returned.
Let's consider the key requests to the prompt model (Figure 4) and main_prompt in more detail because they directly interact with the model.➢ The text is provided below, separated by paragraphs with triple back apostrophes.
main_prompt specifies the task (Figure 5) and translates it into the language the user wants to receive the final text.Requests are created in English because the model understands it better and processes the proposal faster.This request is based on the following tasks: ➢ To be a text analyzer (summarize the text); ➢ Get the text from the pages of the book, starting from the beginning and ending at the end; ➢ The task consists of summarizing the text from these pages and assessing the financial status of the company mentioned in the text.
➢ Do not be talkative.A straightforward answer is required; ➢ Start the summary with Summary financial report of the company company_name (Replace with the name of the company from the text provided below, separated bit by bit by triple back apostrophes); ➢ The text is provided below, separated bit by bit by triple back apostrophes; ➢ Translate the result into the language the user wants to receive the final text.
The completed software implementation allows the module to analyze financial reports according to the template and reporting format.The analysis result is also recorded in a text document for convenience.Given that the module is written in Python, it can easily be integrated into an existing system, making it adaptable and flexible.
The developed module has an integrated interface (Figure 6), which displays the code's reaction to the user's actions and provides the user with the necessary information about the analysis process.To check the operation of the module and its effectiveness, the financial reports of the companies were selected: When the module is launched, the user can select a report and download it for analysis; the module will notify him of this.
After analyzing the financial reports of the companies Microsoft, Alphabet, and Apple, a good result was obtained in the form of a structured text that clearly describes the financial report's key points.Regardless of the variety of received information, its type and volume, the module performs its functions quickly and efficiently.
The analysis results and a demonstration of the company report pages are given in the appendices.

Conclusions
The generation of textual data based on the analysis of financial statements of companies is a process that includes the use of artificial intelligence technologies to process, analyze and interpret large volumes of financial information.Its main goal is to transform complex and often unstructured data of financial statements into clear, logically structured and easily interpreted text conclusions.Using machine learning and natural language processing algorithms, the systems are able to analyze quantitative data such as revenues, expenses, balance sheet totals, as well as qualitative indicators, including risks, strategic initiatives and management conclusions.
This process is becoming more and more relevant in the context of the growing need for automation and optimization of financial analysis.An important part of it is the ability of the system to adapt to specific reporting standards and financial norms, which can vary significantly depending on the country and the field of activity.This involves the use of models that take into account international financial standards, regulatory requirements and industry specifics.Such systems not only increase the efficiency of the financial analysis process, but also ensure greater transparency and objectivity of conclusions.They can be used to automatically generate reports that include financial performance synthesis, trend detection, and recommendations.
However, the generation of textual data based on the analysis of financial statements of companies is accompanied by certain challenges, which include the need to ensure high accuracy, adequacy of the context, and consideration of cultural and ethical aspects in the generated content.From an ethical point of view, text generation imposes responsibility for the use of technology in order to preserve the veracity of information, prevent disinformation, and protect personal data.The problem is also the need to limit abuse in systems that can generate manipulative or harmful content.Creating content that appears authentic requires a responsible approach to its use to avoid misinformation, abuse, or manipulation of public opinion.It is also important to ensure the privacy and protection of user data.
Scientists need to focus on increasing the efficiency of algorithms, ensuring the ability of systems to understand the subtle nuances of human language, and taking into account the socio-cultural and ethical aspects of the society in which these technologies are used.
A service for analyzing financial reports of companies using machine learning technologies must meet the following requirements: 1. Accuracy of analysisservices must ensure high accuracy in identifying and interpreting financial data, including recognizing specific terminology and complex financial concepts.
2. Depth of Insights -The platform must be able to extract essential information from reports, analyze trends, identify key performance indicators (KPIs) and provide deep insights that can be useful for decision-making.
3. Integration with other systems.Often, services can integrate with other business systems, such as ERP (Enterprise Resource Planning) or CRM (Customer Relationship Management), which allows you to automate workflows and improve overall process efficiency.
4. The user interface should be intuitive and convenient so that users with different levels of expertise can efficiently work with the service.
5. Due to the sensitivity of financial information, services must ensure high data security and compliance with regulatory requirements.
6. Scalability and elasticity -This is important for companies that plan to increase data volumes or expand functionality over time.
7. Support and updatesa reliable service should offer adequate user support and be regularly updated to meet the latest trends and standards.
It should be noted that although these systems simplify the processing of financial information, they require regular updating and adjustment to consider changes in market conditions, financial regulations and business models.Thus, the role of experts in financial analysis remains essential, especially in the context of interpretation and use of conclusions obtained with the help of artificial intelligence.
The main problems that arise in the process of generating textual data based on the analysis of financial reports of companies are: 1. Accuracy and reliability are two of the main problems in ensuring high accuracy of text generation.Financial statements contain complex and precise information, and a small error in transcription or analysis can lead to erroneous conclusions.
2. Dependence on the quality of the data because the quality of the generated text directly depends on the quality of the input data.If financial statements are incomplete, contain errors or are presented in an unstructured format, this can significantly complicate generating accurate text.
3. Financial documents often contain specific terminology, which can be a challenge for artificial intelligence systems, which cannot always correctly interpret and use such specialized vocabulary.4. Automated systems may have difficulty with contextual understanding of text.They can correctly identify key figures and facts but cannot always correctly interpret the content or identify essential relationships between different report elements.
5. Given the strict regulatory requirements in financial reporting, ensuring compliance of automatically generated texts with legislative and regulatory standards is necessary.
6.When working with financial data, it is essential to ensure the confidentiality and security of information, as they often contain sensitive data.
7. Despite the automation of the process, it is necessary to involve specialists to check and validate the generated texts to ensure their accuracy and compliance with standards.
Solving these problems requires constant research and development in the field of natural language processing, as well as the improvement of machine learning algorithms, to increase the accuracy and contextual relevance and ensure the reliability of text data generation.
These challenges require a careful balancing act between the technological possibilities of text generation and the ethical, legal, and social implications of their use.Solving these problems will require a collective effort in regulation, research and development of technologies.

Figure 3 .
Figure 3. Listing of the summarize_text function

Figure 4 .
Figure 4. Listing prompt request In this particular query, the model receives the following task: ➢ To be a text analyzer (summarize the text); ➢ Get the text from the pages of the book, starting from the beginning and ending at the end; ➢ The task consists in summarizing the text from these pages; ➢ Do not be talkative.A clear answer is required;

Figure 5 .
Figure 5. Listing of the main_prompt request