{"id":49614186,"url":"https://github.com/numikel/processtorag","last_synced_at":"2026-05-04T20:05:41.452Z","repository":{"id":284046059,"uuid":"953650407","full_name":"numikel/ProcessToRag","owner":"numikel","description":"ProcessToRag is a simple Python script that merges PDF files into grouped chunks — perfect for preparing documents for Retrieval-Augmented Generation (RAG) models or archiving purposes.","archived":false,"fork":false,"pushed_at":"2025-03-23T21:20:33.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T21:30:33.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numikel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-23T20:43:08.000Z","updated_at":"2025-03-23T21:20:37.000Z","dependencies_parsed_at":"2025-03-23T21:40:53.156Z","dependency_job_id":null,"html_url":"https://github.com/numikel/ProcessToRag","commit_stats":null,"previous_names":["numikel/processtorag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/numikel/ProcessToRag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numikel%2FProcessToRag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numikel%2FProcessToRag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numikel%2FProcessToRag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numikel%2FProcessToRag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numikel","download_url":"https://codeload.github.com/numikel/ProcessToRag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numikel%2FProcessToRag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32622772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-04T20:05:40.613Z","updated_at":"2026-05-04T20:05:41.447Z","avatar_url":"https://github.com/numikel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 ProcessToRag\n\n**ProcessToRag** is a modular Python tool for processing and preparing PDF documents for downstream tasks such as Retrieval-Augmented Generation (RAG), document classification, archiving or knowledge extraction.  \nIt supports PDF merging, content extraction, paragraph segmentation and optional translation to English using the [NLLB-200](https://huggingface.co/facebook/nllb-200-distilled-600M) model.\n\n## 🚀 Features\n\n- ✅ Automatically detects `.pdf` files in a given folder  \n- ✅ Merge mode: groups PDFs into chunks of defined size  \n- ✅ Mid-processing mode: extracts, cleans and splits text into paragraphs  \n- ✅ Optional translation to English (multi-language → English) via NLLB  \n- ✅ Logging of processing steps and errors  \n- ✅ Ready for integration with RAG pipelines or ML workflows\n\n## 🛠 Requirements\n\nInstall dependencies (Python ≥ 3.9 recommended):\n\n```bash\npip install -r requirements.txt\n```\n\nEnsure PyTorch is installed correctly – if using GPU, follow the installation instructions for your environment:\n➡️ https://pytorch.org/get-started/locally/\n\n## ▶️ How to Use\nRun the script manually:\n\n```bash\npython process_to_rag.py\n```\n\nYou can configure:\n1) input_folder: where your PDF files are located\n2) process_type: \"merge\" or \"mid\"\n3) translation: True to enable translation to English\n4) merge_file_count: number of files per merged PDF\n5) logging: saves logs to process_to_rag_logs.txt\n\nYou can modify these directly in __main__ or extend with CLI (argparse support planned).\n\n## 📌 Examples\nMerge 25 PDF files into chunks of 10:\n```python\nProcessToRag(input_folder=\"path/to/pdfs\", process_type=\"merge\", merge_file_count=10)\n```\n\nExtract and translate content from PDFs:\n```python\nProcessToRag(input_folder=\"path/to/pdfs\", process_type=\"mid\", translation=True)\n```\n\n## 📁 Project Structure\n```pgsql\nPROCESSSTORAG/\n├── process_to_rag.py            # Main script (PDF handling, extraction, logging)\n├── translation_tool/\n│   └── translation_tool.py      # Translation wrapper for NLLB-200\n├── requirements.txt             # Project dependencies\n├── README.md                    # Project documentation\n├── LICENSE                      # MIT license\n├── .gitignore                   # Git ignore rules\n```\n\n## 🗂 Output\nExtracted paragraphs are saved as .txt files in texts/ inside the output_folder.\nLogs are written to process_to_rag_logs.txt.\n\n## 📌 To-do\n1) Add CLI support via argparse\n2) Add full token-based chunking and embedding preparation\n3) Support .docx and other formats\n4) Add unit tests and CI pipeline\n\n## 👤 Author\nMade with ❤️ by Michał Kamiński\n\n## 🧾 License\nThis project is licensed under the MIT License.\nYou are free to use, modify, and distribute it as you wish.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumikel%2Fprocesstorag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumikel%2Fprocesstorag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumikel%2Fprocesstorag/lists"}