Text Improvement Assistant is an AI-powered tool that helps improve text quality using DSPy and large language models. It provides a web interface for text enhancement with reasoning and issue identification.
The assistant uses a few-shot learning approach to improve text quality:
-
Examples: You can save example improvements that demonstrate the kind of changes you want. Each example contains:
- Original input text
- Reasoning behind the changes
- Issues identified
- Improved version
-
Learning: When improving new text, the system:
- Uses your saved examples to understand your style preferences
- Applies similar improvement patterns to new inputs
- Provides detailed reasoning for changes
- Identifies potential issues
- Generates improved versions
-
Customization: You can:
- Add successful improvements as new examples
- Edit existing examples
- Provide custom instructions
- Generate multiple variations
- 🌐 Web Interface: User-friendly Streamlit interface
- 🔄 Multiple Completions: Generate multiple improved versions
- 📝 Example Management: Save and edit example improvements
- 🤖 DSPy Integration: Leverages DSPy for LLM optimization
- 🔍 Detailed Analysis: Provides reasoning and identifies issues
# Clone the repository
git clone https://github.com/tom-doerr/text_improvement.git
cd text_improvement
# Install dependencies
pip install -r requirements.txt
# Set up your OpenRouter API key
export OPENROUTER_API_KEY='your-api-key'streamlit run app.pyVisit http://localhost:8501 in your browser.
The system uses:
- DSPy with Claude 3.5 Sonnet model
- JSON storage for examples and instructions
- Streamlit for web interface
- Temperature of 2.0 for varied outputs
# Install development dependencies
pip install -r requirements-dev.txt
# Run linting
flake8- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.