This repository contains a Python script for analyzing various aspects of a business plan, including executive summary, market analysis, financial projections, and additional documentation. The script leverages a combination of machine learning models and OpenAI's GPT-3 to generate a comprehensive grade and actionable feedback for the business.
- Executive Summary Analysis: Uses BERT-based sentiment analysis to evaluate the sentiment of the executive summary, mission, and vision statement.
- Market Analysis: Analyzes market sentiment, segments the market, and forecasts market trends using text analysis and clustering.
- Financial Projections: Forecasts financial metrics and performs ratio analysis and anomaly detection.
- Credit Risk and Fraud Detection: Assesses credit risk and detects potential fraud in financial data.
- Document Classification and Named Entity Recognition: Classifies additional documentation and extracts named entities.
You can install all the required packages using the requirements.txt
file included in this repository.
The application consists of:
- Frontend: User interface for uploading business plans and viewing results
- Backend: Flask server for processing and analysis
- Database: PostgreSQL for storing data
- Machine Learning Models: Various models for analysis tasks
- Python 3.8 or later
- Docker and Docker Compose
-
Create a virtual environment and install dependencies.
# Create a virtual environment python -m venv venv # Activate the virtual environment # On Windows venv\Scripts\activate # On Unix or MacOS source venv/bin/activate # Install dependencies pip install -r requirements.txt
-
Ensure the database schema is created.
# Create the database python
In the Python shell, run:
from app import db db.create_all() exit()
-
Run the Flask application.
# Set the FLASK_APP environment variable export FLASK_APP=app.py # On Windows use `set` instead of `export` set FLASK_APP=app.py # Run the Flask development server flask run
The application will be available at http://localhost:5000
.
To run the application using Docker Compose, follow these steps:
- Ensure your
Dockerfile
anddocker-compose.yml
are correctly set up.
# Use an official Python runtime as a parent image
FROM python:3.8-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 5000 available to the world outside this container
EXPOSE 5000
# Define environment variable
ENV FLASK_APP=app.py
# Run app.py when the container launches
CMD ["flask", "run", "--host=0.0.0.0"]