An agentic AI system powered by Google Gemini that automatically annotates text with named entities, sentiment analysis, keywords, and relationships.
This tool bridges the gap between static text analysis and dynamic AI interaction, featuring both a Quick Annotation Mode for instant results and an Interactive Chat Interface for conversational refinement.
| 1. Clean Input Interface | 2. Interactive Chat Mode |
|---|---|
![]() |
![]() |
| Easy-to-use input dashboard with example loaders | Conversational agent for deep context analysis |
| 3. Entity & Sentiment Analysis | 4. Relationship Mapping |
|---|---|
![]() |
![]() |
| Detailed NER extraction and sentiment scoring | Visual mapping of semantic relationships & keywords |
Designed for speed and structure. Paste your text and get structured data instantly.
- Named Entity Recognition (NER): Extracts people, organizations, locations, dates, monetary values, products, and events.
- Sentiment Analysis: Analyzes sentiment at the sentence level with precise confidence scores.
- Keyword Extraction: Identifies pivotal terms and phrases with importance weighting.
- Relationship Detection: Maps semantic connections between extracted entities.
- JSON Export: Download full analysis data for use in other applications.
Designed for depth and context.
- Conversational Interface: Chat naturally with the AI about your text.
- Interactive Refinement: Ask questions like "Why is this sentiment negative?" or "Did you miss any locations?"
- Context-Aware Memory: The AI remembers previous turns and the current state of annotations.
- Smart Suggestions: Proactively suggests improvements and deeper insights.
- Python 3.8+
- A Google Gemini API key (Get it free at Google AI Studio)
-
Clone the repository
git clone https://github.com/fms-faisal/AI-Text-Annotation-Agent.git cd AI-Text-Annotation-Agent -
Install dependencies
cd backend pip install -r requirements.txt -
Configure Environment
Create a.envfile in the root directory:GEMINI_API_KEY=your_actual_api_key_here
-
Run the application
python app.py
-
Access the App
Open your browser and navigate to: http://localhost:5000
AI-Text-Annotation-Agent/
├── backend/
│ ├── app.py # Main Flask application
│ ├── requirements.txt # Python dependencies
│ └── routes/ # API route definitions
├── static/
│ ├── css/ # Stylesheets
│ ├── js/ # Frontend logic
│ └── images/ # Assets
├── templates/
│ └── index.html # Main application UI
├── DEPLOYMENT.md # Deployment guides
└── README.md # Project documentation
- Paste your raw text into the input field.
- Click "Annotate Text".
- Watch as entities, sentiment, and relationships are extracted in real-time.
- Click "Export JSON" to save the data.
- Switch to "💬 Chat Mode" using the toggle.
- Enter a command or question:
Analyze: [your text]Who are the main people mentioned?Summarize the sentiment regarding the product launch.
Example Prompts:
- Medical:
"Extract all symptoms and prescribed medications from this note." - Financial:
"What is the relationship between the company stock and the CEO's announcement?" - General:
"Analyze: Apple Inc. launched iPhone 15 in California."
- Backend: Flask (Python)
- AI Model: Google Gemini 1.5 Flash (Optimized for speed and context)
- Frontend: Vanilla JavaScript, Modern CSS3
- Deployment: Compatible with Render, Vercel
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Web Interface |
| POST | /api/annotate |
Single text annotation |
| POST | /api/batch-annotate |
Batch processing (Array of strings) |
| POST | /api/chat |
Conversational Agent endpoint |
| GET | /api/health |
System health check |
We recommend Render for free, fast deployment:
- Fork this repo to your GitHub.
- Sign up at Render.com.
- Create a new Web Service.
- Connect your repository.
- Add Environment Variable:
GEMINI_API_KEY. - Click Deploy.
See DEPLOYMENT.md for detailed instructions.
Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- Powered by Google Gemini AI
- Built with Flask and modern web technologies.



