A sophisticated text analysis tool powered by Llama 3.1-8b through Groq's API, built with Chainlit. This application helps analyze text content by identifying core ideas, relationships, analogies, and generating insights.
- 🔍 Comprehensive text analysis following a structured framework:
- Core Ideas identification (Main, Supporting, Context, Counterpoints)
- Relationship mapping between ideas
- Analogy analysis
- Insight generation
- 🚀 Real-time streaming responses
- 💬 Persistent chat history within sessions
- 🎯 Focused analysis prompts
- ⚡ High-performance inference using Groq's API
- 🛡️ Secure environment variable handling
The tool analyzes text using the following structured approach:
-
Core Ideas
- Main Ideas: Central propositions or themes
- Supporting Ideas: Details, examples, or evidence
- Contextual Elements: Background and framing devices
- Counterpoints: Risks, challenges, or opposing views
-
Relationships
- Causal relationships
- Contrast/Comparison
- Sequential progression
- Hierarchical connections
- Associative links
-
Analogies
- Comparative elements
- Supporting concepts
- Implications and risks
-
Updated Insights
- Evolution of ideas
- Key takeaways
- Trade-offs and considerations
- Python 3.9+
- A Groq API key (get it from Groq Console)
- Clone the repository:
git clone https://github.com/quietrags/ideas_identification.git
cd ideas_identification
- Install dependencies:
pip install -r requirements.txt
- Set up your environment variables:
cp .env.example .env
Then edit .env
and add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
- Start the application:
chainlit run app.py -w
- Open your browser and navigate to:
http://localhost:8000
- Paste any text you want to analyze into the chat interface
- The system will provide a structured analysis following the framework
Input any text, such as articles, papers, or documents, and receive a structured analysis that includes:
1. Core Ideas
- Main Ideas: [Key themes and central arguments]
- Supporting Ideas: [Evidence and examples]
- Context: [Background information]
- Counterpoints: [Challenges and opposing views]
2. Relationships
- [Identified connections between ideas]
- [Cause-effect relationships]
- [Comparisons and contrasts]
3. Analogies
- [Analysis of comparative elements]
- [Implications and insights]
4. Updated Insights
- [Key takeaways]
- [Synthesized understanding]
- [Practical implications]
The application can be configured through:
.env
: Environment variables including API keysprompt.txt
: System prompt defining the analysis frameworkapp.py
: Model parameters and application settings
Current configuration:
- Model:
llama3-8b-8192
- Temperature: 0.7
- Max Tokens: 2048
- Top P: 1.0
This project is licensed under the MIT License - see the LICENSE file for details.