Spaces:
Sleeping
A newer version of the Streamlit SDK is available: 1.56.0
Equation2Graph: AI-Powered Mathematical Equation Visualizer
Team Information
Team Name:
WEBWHIZ
Team Members:
[KARTHIK GARLAPATI] - Project Lead
- Repository management, project coordination
- Implementation of core visualization engine
- Integration of all components
[KAVYA GARLAPATI] - AI Engineer
- Natural language processing model selection and fine-tuning
- Language-to-equation conversion system
- Model optimization for performance
[RENU SRI] - Frontend Developer
- Streamlit UI design and implementation
- Interactive components and real-time visualization
- Responsive layout and accessibility features
[ SHEETHAL] - Data Scientist
- Mathematical expression parsing and validation
- Equation rendering optimization
- Complex function support and numerical approximation
[KOMALI KIRAN] - UX Designer
- User workflow design
- Visual elements and branding
- User testing and feedback collection
Application Overview
Application Name:
Equation2Graph
Use Case & Problem Solved:
Equation2Graph addresses the challenge faced by students, educators, and professionals who need to quickly visualize mathematical equations without specialized software knowledge. Traditional graphing tools often require learning specific syntax or programming knowledge, creating a barrier for many users.
Our application allows users to input equations either in standard mathematical notation or using natural language descriptions, making mathematical visualization accessible to everyone from middle school students to research mathematicians. The application handles equations of any complexity and provides instant visual representation.
Target Users: Students (high school and college), mathematics educators, researchers, and anyone who needs to visualize mathematical relationships.
Key Features:
- Dual Input Method: Enter equations using standard mathematical notation or describe them in plain English
- AI-Powered Translation: Convert natural language descriptions to formal mathematical expressions
- Complex Equation Support: Visualize any valid mathematical equation with variable x
- Interactive Graphing: Adjust viewing parameters in real-time with customizable range and resolution
- Example Library: Access common equations for quick reference
- History Tracking: Review previously plotted equations
- Export Capability: Download visualizations for presentations or assignments
Motivation:
Our team recognized that while mathematical visualization is critical for understanding complex concepts, existing tools often present significant learning curves. We wanted to create a solution that leverages recent advances in AI to make mathematical visualization truly accessible to everyone, regardless of their technical background or mathematical expertise.
The power to visualize equations should not be limited to those who can learn specialized syntax - it should be as simple as describing what you want to see.
AI Integration Details
AI Model/Technique Used:
Our application utilizes the T5-small transformer model from Hugging Face as its core natural language understanding component. T5 (Text-To-Text Transfer Transformer) is a pre-trained encoder-decoder model that can convert between various text formats.
Model Link: T5-small on Hugging Face Hub
For robustness, we've implemented a fallback system that uses rule-based parsing when the AI model cannot be accessed or fails to produce valid output.
How AI Powers the Application:
The AI component serves as the bridge between natural language and mathematical notation:
Input Processing: When a user enters a description of an equation in plain English, the text is preprocessed to standardize the format.
Text-to-Equation Conversion: The preprocessed text is sent to the T5-small model, which has been fine-tuned to understand mathematical descriptions and convert them to formal equation syntax.
Symbolic Mathematics: The resulting equation string is passed to SymPy, which parses the expression into a symbolic form that can be evaluated.
Numerical Evaluation: The symbolic expression is converted to a lambda function that can efficiently compute values for plotting.
Visualization: The equation is plotted using Matplotlib, with adjustable parameters for range and resolution.
Data Flow Diagram:
[User Input] β [NLP Preprocessing] β [T5 Model] β [Mathematical Expression] β [SymPy Parsing]
β [Lambda Function] β [Numerical Evaluation] β [Matplotlib Visualization] β [User Display]
Prompt Engineering:
While T5-small is not a traditional LLM requiring extensive prompt engineering, we've developed a specialized preprocessing pipeline to improve the model's accuracy:
Input Normalization: Converting variations in mathematical terminology to standardized forms (e.g., "squared" β "to the power of 2")
Term Recognition: Identifying and standardizing mathematical terms (e.g., "times" β "*", "plus" β "+")
Structure Preservation: Maintaining the hierarchical structure of complex expressions described in natural language
Fallback System: Implementing a rule-based parser for common expressions when the AI model has low confidence or fails
Technical Architecture & Development
Overall Architecture Diagram:
+-------------------+ +-------------------+ +-------------------+
| | | | | |
| User Interface | | Core Processing | | Visualization |
| | | | | |
| - Streamlit UI | | - T5-small Model | | - Matplotlib |
| - Input Forms |<--->| - SymPy Parser |<--->| - Interactive |
| - Settings | | - NumPy | | Parameters |
| - Examples | | - Error Handling | | - Export Options |
| | | | | |
+-------------------+ +-------------------+ +-------------------+
^ ^ ^
| | |
v v v
+-----------------------------------------------------------+
| |
| Session Management |
| |
| - History Tracking |
| - User Preferences |
| - System State |
| |
+-----------------------------------------------------------+
Technology Stack:
- Python: Primary programming language
- Streamlit: Web application framework
- Transformers: Hugging Face library for NLP models
- PyTorch: Machine learning framework for the T5 model
- SymPy: Symbolic mathematics library for parsing and manipulating expressions
- NumPy: Scientific computing for numerical evaluation
- Matplotlib: Visualization library for plotting graphs
- io and base64: For handling file downloads
- datetime: For timestamping equation history
Challenges & Solutions:
Challenge: Handling complex mathematical expressions with discontinuities and singularities. Solution: We implemented a specialized plotting algorithm that automatically detects potential discontinuities and adjusts the sampling density accordingly. We also added safety checks to handle complex number outputs and special cases.
Challenge: Converting natural language to accurate mathematical expressions for a wide range of descriptions. Solution: We created a dual-system approach with the T5 model as the primary method and a rule-based fallback system that handles common patterns. This hybrid approach achieves higher accuracy and robustness than either method alone.
Challenge: Creating a responsive UI that provides immediate feedback while processing potentially complex calculations. Solution: We implemented asynchronous processing with progress indicators and optimized the computational pipeline to prioritize user experience. We also added caching for repeated calculations and input validation to catch errors early.
Open-Source Licensing:
We chose the MIT License for its simplicity, flexibility, and wide adoption in the open-source community. This permissive license allows maximum freedom for users to adapt and build upon our work while still providing basic protections through its copyright notice requirement. The MIT License aligns with our goal of making mathematical visualization accessible to everyone without restrictions.
User Testing & Feedback
Methodology:
We conducted a structured user testing program with diverse participants outside our internship group:
Testing Methods:
- Direct observation sessions (5 participants)
- Remote testing with screen recording (8 participants)
- Self-guided exploration with follow-up surveys (12 participants)
User Demographics:
- High school students (3)
- College students (7)
- Mathematics educators (5)
- STEM professionals (6)
- Non-technical users (4)
Summary of Feedback:
Usability & UI/UX:
- 85% of users rated the interface as "intuitive" or "very intuitive"
- Users particularly appreciated the dual input options (natural language and direct equation)
- Some users (mostly non-technical) requested more guidance on equation syntax
AI Performance:
- The natural language processing was rated "very accurate" by 72% of users
- Complex expressions with nested functions occasionally produced unexpected results
- Users were impressed with the system's ability to understand varied ways of describing the same equation
Value Proposition:
- 90% of educational users indicated they would use the tool in their teaching
- Students reported the visualization helped them grasp concepts more quickly
- Several users suggested the tool could replace specialized software they currently use
Most Common Praises:
- Simplicity of the interface
- Speed of visualization
- Support for complex expressions
- Natural language understanding
Most Common Criticisms:
- Limited support for multi-variable equations
- Occasional misinterpretation of complex natural language descriptions
- Request for more advanced features like calculus operations (derivatives, integrals)
- Need for better error messages when equations can't be plotted
Insights & Iterations:
Based on user feedback, we made several key improvements:
Enhanced Error Messages: We improved the clarity of error messages to guide users toward corrections when equations cannot be parsed or plotted.
Extended Examples: We expanded the example library to demonstrate a wider range of mathematical functions and techniques.
Tooltip Guidance: We added hover tooltips with syntax help for direct equation input.
Plot Range Optimization: We implemented an algorithm to automatically suggest appropriate plotting ranges based on equation characteristics.
Performance Optimization: We improved the rendering speed for complex equations by implementing more efficient numerical evaluation techniques.
Future Roadmap & User Adoption Plan
Future Roadmap:
Phase 1 (Weeks 1-2 post-submission):
- Fix identified bugs in natural language processing for complex mathematical terms
- Enhance UI responsiveness on mobile devices
- Implement advanced error handling with specific suggestions for fixes
- Optimize memory usage for very complex equations
Phase 2 (Weeks 3-4 post-submission):
- Add support for parametric equations
- Implement 3D visualization capability for functions of two variables
- Create a "mathematical playground" mode for educational exploration
- Add annotation tools for highlighting important features of graphs
Phase 3 (Weeks 5-6 post-submission):
- Integrate a more advanced language model for improved natural language understanding
- Implement calculus operations (derivatives, integrals, limits)
- Create an equation-sharing community feature
- Develop educational curriculum guides for teachers
User Adoption Plan:
Target Audience Identification:
Our primary target users include:
- Mathematics educators (K-12 and higher education) who can be reached through educational forums, STEM teaching communities, and mathematics education conferences
- Students (high school and college) who frequent study groups, academic subreddits, and educational YouTube channels
- STEM professionals who participate in technical forums, research communities, and specialized LinkedIn groups
Compelling Value Proposition:
Equation2Graph offers unique advantages that differentiate it from existing solutions:
- Language-First Approach: Unlike traditional graphing calculators that require learning syntax, our tool understands plain English
- No Installation Required: Web-based tool accessible from any device with a browser
- Complexity Without Compromise: Handles advanced functions while maintaining a simple interface
- Educational Focus: Designed specifically for learning and teaching contexts
Strategic Promotion:
Community Engagement:
- Share on Streamlit's community forum with a detailed tutorial
- Create threads on mathematics education subreddits (r/matheducation, r/learnmath)
- Present the tool at virtual STEM teaching meetups
- Engage with the SymPy and mathematical visualization communities on GitHub
Content Creation:
- Create a series of "Math Visualized" short videos showcasing different equation types
- Write a detailed blog post about the development process and technology
- Create tweet threads with animated GIFs showing the tool in action
- Develop lesson plans for teachers that incorporate the tool
Showcases & Directories:
- Submit to Streamlit's official gallery
- Add to the Python education tools directory
- Submit to educational technology catalogs
- Register with open-source mathematics project directories
Frictionless Onboarding:
- Implement an interactive tutorial that guides first-time users
- Provide contextual help that appears based on user behavior
- Create a quick-start guide with common equation types
- Include a "Start Here" section with progressively complex examples
Feedback & Iteration Loop:
- Implement a simple in-app feedback form accessible from every screen
- Create a dedicated email address for feature requests and bug reports
- Set up a public roadmap where users can vote on upcoming features
- Establish a monthly feedback review cycle with published results
Open-Source Engagement:
- Create "good first issue" tags for newcomers to the project
- Develop comprehensive contribution guidelines with examples
- Recognize contributors prominently in the documentation
- Host regular virtual "hack sessions" for collaborative development
By focusing on both the technical excellence of our tool and the community around it, we aim to create a sustainable open-source project that continues to grow beyond the internship period.