Giter VIP home page Giter VIP logo

document2paragraph's Introduction

document2paragraph

You can use the python script to transfer pdf, docx, and other documents to paragraph for transferring them to embedding vector. This tool is particularly useful for scenarios where text extraction and further processing from various documents are required.

Features

  • Supports text extraction from PDF and DOCX files.
  • Allows custom title patterns for segmenting text.
  • Saves extracted text into a CSV file for further processing.

Installation

Before using the document2paragraph tool, ensure that you have Python 3 installed. Follow these steps to install the necessary dependencies:

git clone https://github.com/LiuYuWei/document2paragraph.git
cd document2paragraph
pip install -r requirements.txt

Usage

To use the document2paragraph tool, follow these steps:

  1. Place your PDF or DOCX files in an appropriate directory.
  2. Execute the script with the following command:
python main.py <document_file_path> --pattern <split_pattern> --folder <output_folder>

For example:

python main.py example.pdf --pattern "(\s*[一二三四五六七八九十]{1,3}\、)" --folder result

Streamlit webUI

  1. You can use the following method to run the streamlit webUI.
git clone https://github.com/LiuYuWei/document2paragraph.git
cd document2paragraph
streamlit run streamlit.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

document2paragraph's People

Contributors

liuyuwei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.