First off, thank you for considering contributing to Research2Text! 🎉 Your help is essential for making this tool even better for the research community.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Coding Standards
- Issue Guidelines
- Community
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please be respectful, inclusive, and constructive in all interactions.
Before creating bug reports, please check the existing issues to avoid duplicates. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the problem
- Expected vs actual behavior
- Environment details (OS, Python version, etc.)
- Sample files or code (if applicable)
- Screenshots (if relevant)
Enhancement suggestions are welcome! Please provide:
- Clear title and description
- Use case and motivation
- Detailed explanation of the feature
- Potential implementation approach
- Mockups or examples (if applicable)
Areas where contributions are especially welcome:
- Performance improvements
- New embedding models support
- UI/UX enhancements
- Documentation improvements
- Test coverage expansion
- Bug fixes
- Integration with other tools
# Fork the repository on GitHub, then:
git clone https://github.com/yourusername/research2text.git
cd research2text# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies (if available)
pip install -r requirements-dev.txt# Install pre-commit
pip install pre-commit
# Set up pre-commit hooks
pre-commit install# Install Ollama (if not already installed)
# Visit https://ollama.ai/ for installation instructions
# Pull required models
ollama pull gpt-oss:120b-cloud
ollama pull mistral:7b # Lightweight alternative# Test the application
streamlit run src/app_streamlit.py
# Run existing tests (if available)
python -m pytest tests/git checkout -b feature/your-feature-nameUse descriptive branch names:
feature/add-new-embedding-modelbugfix/fix-pdf-parsing-errordocs/update-installation-guide
- Write clean, readable code
- Follow the existing code style
- Add comments for complex logic
- Update documentation as needed
# Run any existing tests
python -m pytest tests/
# Test manually with the Streamlit app
streamlit run src/app_streamlit.py
# Test command-line interfaces
python src/ingest_pdf.py
python src/query_rag.py "test query"- Update README.md if needed
- Add docstrings to new functions
- Update type hints
- Add inline comments for complex code
Use clear, descriptive commit messages:
git add .
git commit -m "Add support for custom embedding models
- Add configuration option for embedding model selection
- Update documentation with new model options
- Add error handling for unsupported models"git push origin feature/your-feature-nameThen create a Pull Request on GitHub with:
- Clear title and description
- Reference to related issues (if any)
- Description of changes made
- Testing performed
- Screenshots (if UI changes)
- Follow PEP 8 style guide
- Use type hints where possible
- Write docstrings for functions and classes
- Keep functions focused and small
- Use meaningful variable names
def chunk_text_by_words(
text: str,
chunk_size_words: int = 700,
overlap_words: int = 100
) -> List[str]:
"""
Split text into overlapping chunks based on word count.
Args:
text: Input text to be chunked
chunk_size_words: Maximum words per chunk
overlap_words: Number of overlapping words between chunks
Returns:
List of text chunks with specified overlap
Raises:
ValueError: If chunk_size_words <= 0
"""
if chunk_size_words <= 0:
raise ValueError("chunk_size_words must be positive")
# Implementation here...
return chunkssrc/
├── __init__.py
├── app_streamlit.py # Main Streamlit app
├── index_documents.py # Document indexing logic
├── ingest_pdf.py # PDF processing
├── query_rag.py # RAG query handling
└── utils.py # Utility functions
tests/
├── __init__.py
├── test_utils.py
├── test_query_rag.py
└── fixtures/ # Test data
docs/
├── api_reference.md
├── user_guide.md
└── development.md
- Keep dependencies minimal
- Pin versions in
requirements.txt - Document any new dependencies in PR description
- Prefer well-maintained, popular libraries
Use the bug report template and include:
## Bug Description
Clear description of the issue
## Steps to Reproduce
1. Step one
2. Step two
3. Step three
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- OS: [e.g., Windows 11, macOS 13, Ubuntu 22.04]
- Python version: [e.g., 3.11.0]
- Package versions: [copy from pip list]
## Additional Context
Any other relevant informationUse the feature request template:
## Feature Description
Clear description of the proposed feature
## Motivation
Why is this feature needed?
## Use Case
How would you use this feature?
## Implementation Ideas
Any thoughts on how this could be implemented?
## Alternatives
What alternatives have you considered?- 📖 Documentation: Check the README and docs/ folder
- 🐛 Issues: Search existing issues first
- 💬 Discussions: Use GitHub Discussions for questions
- 📧 Email: Contact maintainers directly for sensitive issues
Contributors will be recognized in:
- README acknowledgments
- Release notes for significant contributions
- Contributors page (if applicable)
# Test with sample PDFs
mkdir -p data/raw_pdfs
# Add sample PDFs to data/raw_pdfs/
# Process and test
python src/ingest_pdf.py
python src/index_documents.py
python src/query_rag.py "What is the main contribution?"
# Test Streamlit UI
streamlit run src/app_streamlit.py# Add debug prints
import logging
logging.basicConfig(level=logging.DEBUG)
# Use debugger
import pdb; pdb.set_trace()
# Print ChromaDB collection info
collection = client.get_collection("research_papers")
print(f"Collection count: {collection.count()}")- ChromaDB path issues: Ensure paths are absolute
- Ollama connection: Check if Ollama is running (
ollama list) - Memory issues: Use smaller models for development
- PDF parsing: Test with various PDF formats
For maintainers:
- Version bump in appropriate files
- Update CHANGELOG.md
- Create release notes
- Tag release with semantic versioning
- Update documentation
Thank you for contributing to Research2Text! Your efforts help make research more accessible to everyone. 🚀