This is a Python script that uses the Streamlit library to create a web application for rewriting text from uploaded files using the DeepSeek API. The script imports necessary libraries and defines several functions to handle file uploads, text extraction, text splitting, and text rewriting.
This is a Streamlit-based web application that allows users to upload documents (PDF, DOCX, and CSV) and rewrite the text content using the DeepSeek AI API. The application extracts text from the uploaded files, splits it into chunks, and sends each chunk to the DeepSeek API for rewriting. The rewritten text is then displayed in the app and can be downloaded as a text file.
- Upload multiple files (PDF, DOCX, and CSV)
- Extract text from uploaded files
- Split text into manageable chunks
- Rewrite text using the DeepSeek AI API
- Display the rewritten text
- Download the rewritten text as a text file
To run this application, you need to have the following libraries installed:
- streamlit
- os
- PyPDF2
- docx
- langchain
- requests
- python-docx (for DOCX support)
You also need to have a DeepSeek API key.
- Clone the repository:
git clone https://github.com/u10if/deepseek-chatbot.git
- Navigate to the project directory:
cd deepseek-document-rewriter
- Install the required libraries:
pip install -r requirements.txt
- Replace
"deepseek api"
in the script with your actual DeepSeek API key.
- Run the Streamlit app:
streamlit run main.py
- Open your web browser and go to the URL provided by Streamlit.
- Upload your files (PDF, DOCX, and CSV) by clicking the "Choose files" button.
- The app will extract the text from the files, split it into chunks, and send each chunk to the DeepSeek API for rewriting.
- The rewritten text will be displayed in the app.
- Click the "Download Rewritten Text" button to download the rewritten text as a text file.
Contributions are welcome! If you find any issues or want to add new features, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.