A web application for text analysis and heading generation using the OpenAI API.
- Upload text files
- Analyze text content using OpenAI's GPT-3.5 or GPT-4
- Generate hierarchical headings (level 1 through 5)
- View processed text with headings
- Option to view original text
- Download processed text
- Node.js (v14 or later)
- npm or yarn
- OpenAI API key
-
Clone the repository:
git clone https://github.com/your-username/text-analysis-tool.git cd text-analysis-tool -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory - Add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
- Create a
-
Start the development server:
npm run dev
-
Open your browser and navigate to:
http://localhost:3000
-
Upload a text file by either:
- Dragging and dropping a file into the upload area
- Clicking the "Browse Files" button and selecting a file
-
Click the "Analyze Text" button to process the file.
-
View the results with hierarchical headings.
-
Use the "Show/Hide Original Text" button to toggle between the processed text and the original text.
-
Download the processed text using the "Download Processed Text" button.
text-analysis-tool/
├── public/
│ └── index.html
├── uploads/
├── node_modules/
├── .env
├── package.json
└── server.js
POST /api/upload: Upload a text file and get it analyzed
To contribute to this project:
- Fork the repository
- Create a new branch for your feature or bug fix
- Make your changes
- Run tests to ensure everything works
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or issues, please open an issue in the repository or contact the project maintainer.