Contract-Analyzer is a web application that allows users to analyze and summarize contracts, highlighting any points that could potentially help or be dangerous to the user, as well as providing suggestions to improve the contract. This application uses OpenAI's GPT-3.5-turbo model to process and analyze the contracts.
-
Install Node.js if you don't have it installed.
-
Clone this repository and navigate to the project's root directory.
-
Run
npm install
to install the required dependencies. -
Create a
.env
file in the project's root directory and add your OpenAI API Key:OPENAI_API_KEY=your_api_key_here
-
Start the server by running
node index.js
. -
Open your browser and navigate to
http://localhost:3000
.
- Paste the contract text into the textarea on the web page.
- Click the "Submit" button to analyze the contract.
- The summarized contract, highlighting any points that could potentially help or be dangerous to the user, as well as providing suggestions to improve the contract, will be displayed below the textarea.
The project contains the following scripts:
index.js
: The main server script that sets up the Express app, listens for the GET and POST requests, and serves the HTML file.api/analyze.js
: The script responsible for analyzing the contract using the OpenAI API.html/app.html
: The HTML file containing the structure and style for the web page.
To edit the project or add new features, you can modify the existing scripts (index.js
, api/analyze.js
, and html/app.html
) or add new scripts as needed. Remember to restart the server after making any changes to the scripts.
If you want to change the model used for analysis, you can edit the api/analyze.js
file and replace the model
property in the openai.createChatCompletion
function.
App developed by Morgan Barber
ReadME generated by GPT-4